LARS

class ivy.neural_net_stateful.optimizers.LARS(lr=<function LARS.<lambda>>, decay_lambda=0, compile_step=False, inplace=True, stop_gradients=True)[source]

Bases: ivy.neural_net_stateful.optimizers.Optimizer

__init__(lr=<function LARS.<lambda>>, decay_lambda=0, compile_step=False, inplace=True, stop_gradients=True)[source]

Construct a Layerwise Adaptive Rate Scaling (LARS) optimizer.

Parameters
  • lr (float, optional) – Learning rate, default is 1e-4.

  • decay_lambda (float, optional) – The factor used for weight decay. Default is zero.

  • compile_step (bool, optional) – Whether to compile the optimizer step, default is False.

  • inplace (bool, optional) – Whether to update the variables in-place, or to create new variable handles. This is only relevant for frameworks with stateful variables such as PyTorch. Default is True.

  • stop_gradients (bool, optional) – Whether to stop the gradients of the variables after each gradient step. Default is True.

set_state(state)[source]

Set state of the optimizer.

Parameters

state (Ivy container of state tensors) – Nested state to update.

property state

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty