   public typealias Model = Model
   /// The learning rate.
   public var learningRate: Float
-  /// The momentum factor. It accelerates stochastic gradient descent in the relevant direction
-  /// and dampens oscillations.
+  /// The momentum factor. It accelerates stochastic gradient descent in the relevant direction and
+  /// dampens oscillations.
   public var momentum: Float
   /// The learning rate decay.
   public var decay: Float

// See the License for the specific language governing permissions and
// limitations under the License.

/// Stochastic gradient descent (SGD) optimizer.
///
/// An optimizer that implements stochastic gradient descent, with support for momentum, learning
/// rate decay, and Nesterov momentum.
public class SGD<Model: Differentiable>: Optimizer
where
  Model.TangentVector: VectorProtocol & ElementaryFunctions & KeyPathIterable,

  /// The set of steps taken.
  public var step: Int = 0

  /// Creates an instance for `model`.
  ///
  /// - Parameters:
  ///   - learningRate: The learning rate. The default value is `0.01`.
  ///   - momentum: The momentum factor that accelerates stochastic gradient descent in the relevant
  ///     direction and dampens oscillations. The default value is `0`.
  ///   - decay: The learning rate decay. The default value is `0`.
  ///   - nesterov: Use Nesterov momentum iff `true`. The default value is `true`.
  public init(
    for model: __shared Model,
    learningRate: Float = 0.01,
