Class Optimizer

java.lang.Object
com.jml.optimizers.Optimizer
Direct Known Subclasses:
Adam, GradientDescent, Momentum

public abstract class Optimizer extends Object
Interface for an optimizer which can be used to minimize a function by utilizing the gradients of that function.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract String
    Gets the details of this optimizer.
    double
    Gets the learning rate for this optimizer.
    void
    setScheduler​(Scheduler schedule)
    Sets the learning rate scheduler for this optimizer.
    abstract linalg.Matrix[]
    step​(boolean flag, linalg.Matrix... params)
     
    abstract linalg.Matrix[]
    step​(linalg.Matrix... params)
    Steps the optimizer a single iteration by applying the update rule of the optimizer to the matrix w.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Optimizer

      public Optimizer()
  • Method Details

    • step

      public abstract linalg.Matrix[] step(linalg.Matrix... params)
      Steps the optimizer a single iteration by applying the update rule of the optimizer to the matrix w.
      Parameters:
      params - An array of Matrices strictly containing the relevant parameters for that optimizer.
      Returns:
      The result of applying the update rule of the optimizer to the matrix w.
    • step

      public abstract linalg.Matrix[] step(boolean flag, linalg.Matrix... params)
    • getDetails

      public abstract String getDetails()
      Gets the details of this optimizer.
      Returns:
      Important details of this optimizer as a string.
    • setScheduler

      public void setScheduler(Scheduler schedule)
      Sets the learning rate scheduler for this optimizer.
      Parameters:
      schedule - Learning rate scheduler.
    • getLearningRate

      public double getLearningRate()
      Gets the learning rate for this optimizer.
      Returns:
      The learning rate for this optimizer.