public class AdaGradRDA extends Object implements StochasticGradientOptimiser
This gradient optimiser rewrites all the Tensor
s in the Parameters
with AdaGradRDATensor
. This means it keeps a different value in the Tensor
to the one produced when you call get(), so it can correctly apply regularisation to the parameters.
When finalise()
is called it rewrites the Parameters
with standard dense Tensor
s.
Follows the implementation in Factorie.
See:
Duchi, J., Hazan, E., and Singer, Y. "Adaptive Subgradient Methods for Online Learning and Stochastic Optimization" Journal of Machine Learning Research, 2012, 2121-2159.
Constructor and Description |
---|
AdaGradRDA(double initialLearningRate,
double epsilon) |
AdaGradRDA(double initialLearningRate,
double epsilon,
double l1,
double l2,
int numExamples) |
Modifier and Type | Method and Description |
---|---|
AdaGradRDA |
copy()
Copies a gradient optimiser with it's configuration.
|
void |
finalise()
Finalises the gradient optimisation, setting the parameters to their correct values.
|
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
void |
initialise(Parameters parameters)
Initialises the gradient optimiser.
|
void |
reset()
Resets the optimiser so it's ready to optimise a new
Parameters . |
Tensor[] |
step(Tensor[] updates,
double weight)
Take a
Tensor array of gradients and transform them
according to the current weight and learning rates. |
String |
toString() |
public AdaGradRDA(double initialLearningRate, double epsilon, double l1, double l2, int numExamples)
public AdaGradRDA(double initialLearningRate, double epsilon)
public void initialise(Parameters parameters)
StochasticGradientOptimiser
Configures any learning rate parameters.
initialise
in interface StochasticGradientOptimiser
parameters
- The parameters to optimise.public Tensor[] step(Tensor[] updates, double weight)
StochasticGradientOptimiser
Tensor
array of gradients and transform them
according to the current weight and learning rates.
Can return the same Tensor
array or a new one.
step
in interface StochasticGradientOptimiser
updates
- An array of gradients.weight
- The weight for the current gradients.Tensor
array of gradients.public void finalise()
StochasticGradientOptimiser
ParameterAveraging
amongst others.finalise
in interface StochasticGradientOptimiser
public void reset()
StochasticGradientOptimiser
Parameters
.reset
in interface StochasticGradientOptimiser
public AdaGradRDA copy()
StochasticGradientOptimiser
copy
in interface StochasticGradientOptimiser
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.