public class ParameterAveraging extends Object implements StochasticGradientOptimiser
Wraps an inner gradient optimiser. Only changes the values when finalise()
is called
See:
Polyak BT, Juditsky AB "Acceleration of Stochastic Approximation by Averaging" SIAM Journal on Control and Optimization, 1992.
Constructor and Description |
---|
ParameterAveraging(StochasticGradientOptimiser optimiser)
Adds parameter averaging around a gradient optimiser.
|
Modifier and Type | Method and Description |
---|---|
ParameterAveraging |
copy()
Copies a gradient optimiser with it's configuration.
|
void |
finalise()
This sets the parameters to their average value.
|
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)
This passes the gradient update to the inner optimiser, then updates
the average weight values.
|
String |
toString() |
public ParameterAveraging(StochasticGradientOptimiser optimiser)
optimiser
- The inner optimiser to use to scale the gradients.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)
step
in interface StochasticGradientOptimiser
updates
- An array of gradients.weight
- The weight for the current gradients.public void finalise()
finalise
in interface StochasticGradientOptimiser
public void reset()
StochasticGradientOptimiser
Parameters
.reset
in interface StochasticGradientOptimiser
public ParameterAveraging 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.