Interface Parameters
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
FeedForwardParameters
- All Known Implementing Classes:
CRFParameters
,LinearParameters
An interface to a
Tensor
[] array which accepts updates to the parameters.
Parameters is essentially an SGD model at training time.
Subclasses of this can add methods for calculating gradients for their prediction task, or use an external objective class.
Implementations must be serializable.
-
Method Summary
Modifier and TypeMethodDescriptionTensor[]
get()
Get a reference to the underlyingTensor
array.Tensor[]
Generates an empty copy of the underlyingTensor
array.Tensor[]
Merge together an array of gradient arrays.void
Set the underlyingTensor
array to newWeights.void
Apply gradients to the parameters.
-
Method Details
-
getEmptyCopy
-
get
-
set
-
update
Apply gradients to the parameters. Assumes that gradients is the same length as the parameters, and eachTensor
is the same size as the corresponding one from the parameters.The gradients are added to the parameters.
-
merge
Merge together an array of gradient arrays. Assumes the first dimension is the number of gradient arrays and the second dimension is the number of parameterTensor
s.- Parameters:
gradients
- An array of gradient update arrays.size
- The number of elements of gradients to merge. Allows gradients to have unused elements.- Returns:
- A single
Tensor
array of the summed gradients.
-