jsat.math.optimization.stochastic
Interface GradientUpdater
-
- All Superinterfaces:
- java.io.Serializable
- All Known Implementing Classes:
- AdaDelta, AdaGrad, Adam, NAdaGrad, RMSProp, Rprop, SGDMomentum, SimpleSGD
public interface GradientUpdater extends java.io.SerializableThis interface defines the method of updating some weight vector using a gradient and a learning rate. The method may then apply its own set of learning rates on top of the given learning rate in order to accelerate convergence in general or for specific conditions / methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description GradientUpdaterclone()voidsetup(int d)Sets up this updater to update a weight vector of dimensiondby a gradient of the same dimensionvoidupdate(Vec w, Vec grad, double eta)Updates the weight vectorxsuch that x = x-ηf(grad), where f(grad) is some function on the gradient that effectively returns a new vector.doubleupdate(Vec w, Vec grad, double eta, double bias, double biasGrad)Updates the weight vectorxsuch that x = x-ηf(grad), where f(grad) is some function on the gradient that effectively returns a new vector.
-
-
-
Method Detail
-
update
void update(Vec w, Vec grad, double eta)
Updates the weight vectorxsuch that x = x-ηf(grad), where f(grad) is some function on the gradient that effectively returns a new vector. It is not necessary for the internal implementation to ever explicitly form any of these objects, so long asxis mutated to have the correct result.- Parameters:
w- the vector to mutate such that is has been updated by the gradientgrad- the gradient to update the weight vectorxfrometa- the learning rate to apply
-
update
double update(Vec w, Vec grad, double eta, double bias, double biasGrad)
Updates the weight vectorxsuch that x = x-ηf(grad), where f(grad) is some function on the gradient that effectively returns a new vector. It is not necessary for the internal implementation to ever explicitly form any of these objects, so long asxis mutated to have the correct result.
This version of the update method includes two extra parameters to make it easer to use when a scalar bias term is also used- Parameters:
w- the vector to mutate such that is has been updated by the gradientgrad- the gradient to update the weight vectorxfrometa- the learning rate to applybias- the bias term of the vectorbiasGrad- the gradient for the bias term- Returns:
- the value to change the bias by, the update being
bias = bias - returnValue
-
setup
void setup(int d)
Sets up this updater to update a weight vector of dimensiondby a gradient of the same dimension- Parameters:
d- the dimension of the weight vector that will be updated
-
clone
GradientUpdater clone()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG