Expand description
Optimizers with the computations of Optax’s: gradient transformations that are chained, applied to the gradient, and whose result is added to the parameters.
The transformations are generic over the backend, so a training step runs
natively or is traced (and compiled with XLA, inside jit). They follow
the operations of Optax 0.2, so that with the same inputs they compute
the same values.
Structs§
- Adam
State - The state of
ScaleByAdam(optax.ScaleByAdamState). - Chain
- Two transformations applied one after the other (
optax.chain). - Clip
ByGlobal Norm - Scales the updates so that their global norm is at most
max_norm(optax.clip_by_global_norm). - Linear
Schedule initdecreasing (or increasing) linearly toendovertransition_stepsupdates, then constant (optax.linear_schedule).- Scale
- Multiplies the updates by a constant (
optax.scale). - Scale
ByAdam - Adam’s rescaling of the updates (
optax.scale_by_adam). - Scale
BySchedule - Multiplies the updates by minus the learning rate of the schedule
(
optax.scale_by_learning_ratewith a schedule).
Traits§
- Gradient
Transformation - A transformation of updates (
optax.GradientTransformation), applied to the leaves of the parameters, all of typeT. - Schedule
- A learning rate that depends on the number of updates so far
(
optax.Schedule).
Functions§
- adam
- Adam with a constant learning rate (
optax.adam); set the other hyperparameters on the result’s first part. - adam_
with_ schedule - Adam with a learning rate schedule (
optax.adamwith a schedule). - apply_
updates params + updatesfor each leaf (optax.apply_updates).- chain
- Applies
a, thenc(optax.chain(a, c)). - clip_
by_ global_ norm - See
ClipByGlobalNorm. - global_
norm - The L2 norm of all the leaves together (
optax.tree.norm). - linear_
schedule - See
LinearSchedule. - sgd
- Stochastic gradient descent with a constant learning rate (
optax.sgdwithout momentum).