Package ann4j
Class Connection
java.lang.Object
ann4j.Connection
-
Field Summary
Modifier and TypeFieldDescription -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
The backpropagation algorithm is calculating the gradient of the loss function with respect to the weight.double
Calculate the activation of the left neuron times the weight of the connection.double
The function returns the gradient of the loss function with respect to the weightdouble
This function returns the weight of the objectvoid
This function initializes the weight of the connection to a small random numbertoString()
This function returns a string that contains the neuron numbers of the neurons that are connected by this connection, as well as the weight of the connection
-
Field Details
-
leftNeuron
-
rightNeuron
-
changeWishlist
-
-
Constructor Details
-
Connection
-
-
Method Details
-
getWeight
public double getWeight()This function returns the weight of the object- Returns:
- The weight of the object.
-
initializeWeights
public void initializeWeights()This function initializes the weight of the connection to a small random number -
calculateActivationForwardPropagation
public double calculateActivationForwardPropagation()Calculate the activation of the left neuron times the weight of the connection.- Returns:
- The activation of the left neuron times the weight of the connection.
-
toString
This function returns a string that contains the neuron numbers of the neurons that are connected by this connection, as well as the weight of the connection -
backPropagate
public void backPropagate()The backpropagation algorithm is calculating the gradient of the loss function with respect to the weight. It then updates the weight by subtracting the learning rate times the gradient -
getBackwardWeightedSum
public double getBackwardWeightedSum()The function returns the gradient of the loss function with respect to the weight- Returns:
- The gradient of the loss function with respect to the weight.
-