class mentpy.optimizers.RCDOpt(mentpy.optimizers.base.BaseOpt)

Class for the random coordinate descent optimizer.

Parameters:
step_size : float, optional

The initial step size of the optimizer, by default 0.1

adaptive : bool, optional

Whether to use an adaptive step size, by default False

Examples

Create a random coordinate descent optimizer

In [1]: opt = mp.optimizers.RCDOpt()

In [2]: print(opt)
<mentpy.optimizers.rcd.RCDOpt object at 0x7f61b45c1300>

Constructors

RCDOpt(step_size=0.1, adaptive=False)

Initialize the random coordinate descent optimizer.

Methods

optimize(f, x0, num_iters=100, callback=None, verbose=False, **)

Optimize a function f using the random coordinate descent optimizer.

optimize_and_gradient_norm(f, x0, num_iters=100, callback=None, ...)

Optimize a function f using the random coordinate descent optimizer.

reset(*args, **kwargs)
step(f, x, i, **kwargs)

Take a step using the random coordinate descent optimizer.

update_step_size(x, i, factor=0.99)

Update the step size of the optimizer.