org.neuroph.core
Class Weight

java.lang.Object
  extended by org.neuroph.core.Weight
All Implemented Interfaces:
Serializable

public class Weight
extends Object
implements Serializable

Neuron connection weight.

Author:
Zoran Sevarac
See Also:
Connection, Serialized Form

Field Summary
 double value
          Weight value
 double weightChange
          Weight change
 
Constructor Summary
Weight()
          Creates an instance of connection weight with random weight value in range [0..1]
Weight(double value)
          Creates an instance of connection weight with the specified weight value
 
Method Summary
 void dec(double amount)
          Decreases the weight for specified amount
 Object getTrainingData()
          Returns training data buffer for this weight
 double getValue()
          Returns weight value
 void inc(double amount)
          Increases the weight for the specified amount
 void randomize()
          Sets random weight value
 void randomize(double min, double max)
          Sets random weight value within specified interval
 void randomize(Random generator)
           
 void setTrainingData(Object trainingData)
           
 void setValue(double value)
          Sets the weight value
 String toString()
          Returns weight value as String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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..1]


Weight

public Weight(double value)
Creates an instance of connection weight with the specified weight value

Parameters:
value - weight value
Method Detail

inc

public void inc(double amount)
Increases the weight for the specified amount

Parameters:
amount - amount to add to current weight value

dec

public void dec(double amount)
Decreases the weight for specified amount

Parameters:
amount - amount to subtract from the current weight value

setValue

public void setValue(double value)
Sets the weight value

Parameters:
value - weight value to set

getValue

public double getValue()
Returns weight value

Returns:
value of this weight

toString

public String toString()
Returns weight value as String

Overrides:
toString in class Object

randomize

public void randomize()
Sets random weight value


randomize

public void randomize(double min,
                      double max)
Sets random weight value within specified interval


randomize

public void randomize(Random generator)

getTrainingData

public Object getTrainingData()
Returns training data buffer for this weight

Returns:
training data buffer for this weight

setTrainingData

public void setTrainingData(Object trainingData)


Copyright © 2012. All Rights Reserved.