pub struct Optimizer { /* private fields */ }
Expand description

An optimizer to run gradient descent.

Implementations

Zeroes the gradient for the tensors tracked by this optimizer.

Clips gradient value at some specified maximum value.

Clips gradient L2 norm over all trainable parameters.

The norm is computed over all gradients together, as if they were concatenated into a single vector.

Performs an optimization step, updating the tracked tensors based on their gradients.

Applies a backward step pass, update the gradients, and performs an optimization step.

Applies a backward step pass, update the gradients, and performs an optimization step.

The gradients are clipped based on max before being applied.

Applies a backward step pass, update the gradients, and performs an optimization step.

The gradients L2 norm is clipped based on max.

Sets the optimizer learning rate.

Sets the optimizer momentum.

Sets the optimizer learning rate for a parameter group.

Sets the optimizer momentum.

Returns all the trainable variables for this optimizer.

Sets the optimizer weight decay.

Sets the optimizer weight decay.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.