ribs.emitters.opt.GradientAscentOpt

class ribs.emitters.opt.GradientAscentOpt(theta0: ArrayLike, lr: float | floating)[source]

Vanilla gradient ascent.

Parameters:
theta0: ArrayLike

Initial solution. 1D array.

lr: float | floating

Learning rate for the update.

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.