Interface Parameters
- All Superinterfaces:
 ProtoSerializable<org.tribuo.math.protos.ParametersProto>,Serializable
- All Known Subinterfaces:
 FeedForwardParameters
- All Known Implementing Classes:
 CRFParameters,FMParameters,LinearParameters
public interface Parameters
extends ProtoSerializable<org.tribuo.math.protos.ParametersProto>, Serializable
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.
- 
Field Summary
Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER - 
Method Summary
Modifier and TypeMethodDescriptionstatic Parametersdeserialize(org.tribuo.math.protos.ParametersProto proto) Deserializes the parameters from the supplied protobuf.Tensor[]get()Get a reference to the underlyingTensorarray.Tensor[]Generates an empty copy of the underlyingTensorarray.Tensor[]Merge together an array of gradient arrays.voidSet the underlyingTensorarray to newWeights.voidApply gradients to the parameters.Methods inherited from interface org.tribuo.protos.ProtoSerializable
serialize 
- 
Method Details
- 
getEmptyCopy
 - 
get
 - 
set
 - 
update
Apply gradients to the parameters. Assumes that gradients is the same length as the parameters, and eachTensoris 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 parameterTensors.For performance reasons this call may mutate the input gradient array, and may return a subset of those elements as the merge output.
- 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 
Tensorarray of the summed gradients. 
 - 
deserialize
Deserializes the parameters from the supplied protobuf.- Parameters:
 proto- The protobuf to deserialize.- Returns:
 - The parameters.
 
 
 -