Optimizer

public protocol Optimizer

Optimizer that updates a neural network along its gradients

  • Type of the layer that is optimized

    Declaration

    Swift

    associatedtype Layer : LayerType
  • Model to optimize

    Note, that models are value types, so only optimizer.model is changed.

    Declaration

    Swift

    var model: Layer { get }
  • Updates the model along its gradient. The provided gradients must match the count and order of parameters in the network.

    Declaration

    Swift

    mutating func update(along gradients: [Tensor<Layer.Parameter, Layer.Device>])

    Parameters

    gradients

    Gradient tangent vector of the model.