Doc

Hierarchy

Accessors

  • get iterations(): number
  • The number of iterations that this optimizer instance has been invoked for.

    Returns number

Methods

  • Updates variables by using the computed gradients.

    Parameters

    • variableGradients: NamedTensor[] | NamedTensorMap

      A mapping of variable name to its gradient value.

    Returns void

    Doc

  • Executes f() and computes the gradient of the scalar output of f() with respect to the list of trainable variables provided by varList. If no list is provided, it defaults to all trainable variables.

    Parameters

    • f: (() => Scalar)

      The function to execute and whose output to use for computing gradients with respect to variables.

    • Optional varList: Variable<Rank>[]

      An optional list of variables to compute gradients with respect to. If specified, only the trainable variables in varList will have gradients computed with respect to. Defaults to all trainable variables.

    Returns {
        grads: NamedTensorMap;
        value: Scalar;
    }

    Doc

  • Dispose the variables (if any) owned by this optimizer instance.

    Returns void

  • Extract the first element of the weight values and set it as the iterations counter variable of this instance of optimizer.

    Parameters

    • weightValues: NamedTensor[]

    Returns Promise<NamedTensor[]>

    Weight values with the first element consumed and excluded.

  • Return the class name for this class to use in serialization contexts.

    Generally speaking this will be the same thing that constructor.name would have returned. However, the class name needs to be robust against minification for serialization/deserialization to work properly.

    There's also places such as initializers.VarianceScaling, where implementation details between different languages led to different class hierarchies and a non-leaf node is used for serialization purposes.

    Returns string

  • Return all the non-weight state needed to serialize this object.

    Returns ConfigDict

  • Executes f() and minimizes the scalar output of f() by computing gradients of y with respect to the list of trainable variables provided by varList. If no list is provided, it defaults to all trainable variables.

    Parameters

    • f: (() => Scalar)

      The function to execute and whose output to minimize.

    • Optional returnCost: boolean

      Whether to return the scalar cost value produced by executing f().

    • Optional varList: Variable<Rank>[]

      An optional list of variables to update. If specified, only the trainable variables in varList will be updated by minimize. Defaults to all trainable variables.

    Returns Scalar

    Doc

  • Type Parameters

    Parameters

    Returns T

    Nocollapse

Generated using TypeDoc