public interface Parameters
Tensor
[] array which accepts updates to the parameters.
Parameters is essentially an SGD model at training time.
Subclasses of this should add methods for calculating gradients for their prediction task.
Modifier and Type | Method and Description |
---|---|
Tensor[] |
get()
Get a reference to the underlying
Tensor array. |
Tensor[] |
getEmptyCopy()
Generates an empty copy of the underlying
Tensor array. |
Tensor[] |
merge(Tensor[][] gradients,
int size)
Merge together an array of gradient arrays.
|
void |
set(Tensor[] newWeights)
Set the underlying
Tensor array to newWeights. |
void |
update(Tensor[] gradients)
Apply gradients to the parameters.
|
Tensor[] getEmptyCopy()
Tensor
array.
It's the same size and shape as the parameters, but all the values are 0.0.
void set(Tensor[] newWeights)
Tensor
array to newWeights.newWeights
- New parameters to store in this object.void update(Tensor[] gradients)
Tensor
is the same size as the corresponding one from the parameters.
The gradients are added to the parameters.
Tensor[] merge(Tensor[][] gradients, int size)
Tensor
s.gradients
- An array of gradient update arrays.size
- The number of elements of gradients to merge. Allows gradients to have unused elements.Tensor
array of the summed gradients.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.