ribs.emitters.opt.GradientOptBase¶
- class ribs.emitters.opt.GradientOptBase(theta0: ArrayLike, lr: float | floating)[source]¶
Base class for gradient-based optimizers.
Note
These optimizers are designed for gradient ascent rather than gradient descent.
These optimizers maintain a current solution point \(\theta\). The solution point is obtained with the
thetaproperty, and it is updated by passing a gradient tostep(). Finally, the point can be reset to a new value withreset().Your constructor may take in additional arguments beyond
theta0andlr, but expect that these two arguments will always be passed in.- Parameters:¶
Methods
reset(theta0)Resets the solution point to a new value.
step(gradient)Ascends the solution based on the given gradient.
Attributes
The current solution point.