ribs.emitters.opt.AdamOpt

class ribs.emitters.opt.AdamOpt(theta0: ArrayLike, lr: float | floating = 0.001, beta1: float | floating = 0.9, beta2: float | floating = 0.999, epsilon: float | floating = 1e-08, l2_coeff: float | floating = 0.0)[source]

Adam optimizer.

Refer to Kingma and Ba 2014 for more information on hyperparameters.

Parameters:
theta0: ArrayLike

Initial solution. 1D array.

lr: float | floating = 0.001

Learning rate for the update.

beta1: float | floating = 0.9

Exponential decay rate for the moment estimates.

beta2: float | floating = 0.999

Another exponential decay rate for the moment estimates.

epsilon: float | floating = 1e-08

Hyperparameter for numerical stability.

l2_coeff: float | floating = 0.0

Coefficient for L2 regularization. Note this is not the same as “weight decay” – see this blog post <https://www.fast.ai/posts/2018-07-02-adam-weight-decay.html>_ and Loshchilov and Hutler 2019 <https://arxiv.org/abs/1711.05101>_ for more info.

Methods

reset(theta0)

Resets the solution point to a new value.

step(gradient)

Ascends the solution based on the given gradient.

Attributes

theta

The current solution point.

reset(theta0: ArrayLike) None[source]

Resets the solution point to a new value.

Parameters:
theta0: ArrayLike

The new solution point. 1D array.

step(gradient: ArrayLike) None[source]

Ascends the solution based on the given gradient.

Parameters:
gradient: ArrayLike

The (estimated) gradient of the current solution point. 1D array.

property theta : ndarray

The current solution point.