public class WeightGradient
extends java.lang.Object
Constructor and Description |
---|
WeightGradient()
Initializes with the gradient unspecified for any weights.
|
WeightGradient(int capacity)
Initializes with the gradient unspecified, but reserves space for the given capacity
|
Modifier and Type | Method and Description |
---|---|
double |
getPartialDerivative(int weightId)
Returns the partial derivative for the given weight
|
void |
put(int weightId,
double partialDerivative)
Adds the partial derivative for a given weight
|
public WeightGradient()
public WeightGradient(int capacity)
capacity
- how much space to reserve for storing the gradient; i.e., the number of weights over which the gradient will be definedpublic void put(int weightId, double partialDerivative)
weightId
- the weight identifier for which the partial derivative is to be stored is to be storedpartialDerivative
- the partial derivative value for the weightpublic double getPartialDerivative(int weightId)
weightId
-