Optimizer

torch.optim.Optimizer
abstract class Optimizer

Base class for all optimizers.

Attributes

Source
Optimizer.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Adam
class AdamW
class SGD

Members list

Value members

Concrete methods

def step(): Unit

Performs a single optimization step (parameter update).

Performs a single optimization step (parameter update).

Attributes

Note

Unless otherwise specified, this function should not modify the .grad field of the parameters.

Source
Optimizer.scala
def zeroGrad(): Unit

Sets the gradients of all optimized Tensors to zero.

Sets the gradients of all optimized Tensors to zero.

Attributes

Source
Optimizer.scala

Attributes

Source
Optimizer.scala