org.neuroph.core
Class Weight<T>
- java.lang.Object
-
- org.neuroph.core.Weight<T>
-
- Type Parameters:
T- weight training data
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class Weight<T> extends java.lang.Object implements java.io.Serializable, java.lang.CloneableNeuron connection weight.- See Also:
Connection, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description doublevalueWeight valuedoubleweightChangeWeight change
-
Constructor Summary
Constructors Constructor and Description Weight()Creates an instance of connection weight with random weight value in range [-0.5 ..Weight(double value)Creates an instance of connection weight with the specified weight value
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description java.lang.Objectclone()Returns cloned instance of this weight Important: trainingData will be lost in cloned instancevoiddec(double amount)Decreases the weight for specified amountbooleanequals(java.lang.Object obj)TgetTrainingData()Returns training data buffer for this weightdoublegetValue()Returns weight valueinthashCode()voidinc(double amount)Increases the weight for the specified amountvoidrandomize(double min, double max)Deprecated.voidsetTrainingData(T trainingData)voidsetValue(double value)Sets the weight valuejava.lang.StringtoString()Returns weight value as String
-
-
-
Field Detail
-
value
public double value
Weight value
-
weightChange
public transient double weightChange
Weight change
-
-
Constructor Detail
-
Weight
public Weight()
Creates an instance of connection weight with random weight value in range [-0.5 .. 0.5]
-
Weight
public Weight(double value)
Creates an instance of connection weight with the specified weight value- Parameters:
value- weight value
-
-
Method Detail
-
inc
public final void inc(double amount)
Increases the weight for the specified amount- Parameters:
amount- amount to add to current weight value
-
dec
public final void dec(double amount)
Decreases the weight for specified amount- Parameters:
amount- amount to subtract from the current weight value
-
setValue
public final void setValue(double value)
Sets the weight value- Parameters:
value- weight value to set
-
getValue
public final double getValue()
Returns weight value- Returns:
- value of this weight
-
toString
public java.lang.String toString()
Returns weight value as String- Overrides:
toStringin classjava.lang.Object
-
randomize
@Deprecated public void randomize(double min, double max)Deprecated.Sets random weight value within specified interval Use weight randomizers for this
-
getTrainingData
public final T getTrainingData()
Returns training data buffer for this weight- Returns:
- training data buffer for this weight
-
setTrainingData
public final void setTrainingData(T trainingData)
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns cloned instance of this weight Important: trainingData will be lost in cloned instance- Overrides:
clonein classjava.lang.Object- Returns:
- cloned instance of this weight
- Throws:
java.lang.CloneNotSupportedException
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG