Record Class AdamW.State

java.lang.Object
java.lang.Record
io.github.kirstenali.deepj.optimisers.AdamW.State
Enclosing class:
AdamW

public static record AdamW.State(long step, float learningRate, float beta1, float beta2, float epsilon, float weightDecay, List<Tensor> firstMoments, List<Tensor> secondMoments, Map<Integer,Tensor> masterWeights) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    State(long step, float learningRate, float beta1, float beta2, float epsilon, float weightDecay, List<Tensor> firstMoments, List<Tensor> secondMoments)
     
    State(long step, float learningRate, float beta1, float beta2, float epsilon, float weightDecay, List<Tensor> firstMoments, List<Tensor> secondMoments, Map<Integer,Tensor> masterWeights)
    Creates an instance of a State record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Returns the value of the beta1 record component.
    float
    Returns the value of the beta2 record component.
    float
    Returns the value of the epsilon record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the firstMoments record component.
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the learningRate record component.
    Returns the value of the masterWeights record component.
    Returns the value of the secondMoments record component.
    long
    Returns the value of the step record component.
    final String
    Returns a string representation of this record class.
    float
    Returns the value of the weightDecay record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • State

      public State(long step, float learningRate, float beta1, float beta2, float epsilon, float weightDecay, List<Tensor> firstMoments, List<Tensor> secondMoments)
    • State

      public State(long step, float learningRate, float beta1, float beta2, float epsilon, float weightDecay, List<Tensor> firstMoments, List<Tensor> secondMoments, Map<Integer,Tensor> masterWeights)
      Creates an instance of a State record class.
      Parameters:
      step - the value for the step record component
      learningRate - the value for the learningRate record component
      beta1 - the value for the beta1 record component
      beta2 - the value for the beta2 record component
      epsilon - the value for the epsilon record component
      weightDecay - the value for the weightDecay record component
      firstMoments - the value for the firstMoments record component
      secondMoments - the value for the secondMoments record component
      masterWeights - the value for the masterWeights record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • step

      public long step()
      Returns the value of the step record component.
      Returns:
      the value of the step record component
    • learningRate

      public float learningRate()
      Returns the value of the learningRate record component.
      Returns:
      the value of the learningRate record component
    • beta1

      public float beta1()
      Returns the value of the beta1 record component.
      Returns:
      the value of the beta1 record component
    • beta2

      public float beta2()
      Returns the value of the beta2 record component.
      Returns:
      the value of the beta2 record component
    • epsilon

      public float epsilon()
      Returns the value of the epsilon record component.
      Returns:
      the value of the epsilon record component
    • weightDecay

      public float weightDecay()
      Returns the value of the weightDecay record component.
      Returns:
      the value of the weightDecay record component
    • firstMoments

      public List<Tensor> firstMoments()
      Returns the value of the firstMoments record component.
      Returns:
      the value of the firstMoments record component
    • secondMoments

      public List<Tensor> secondMoments()
      Returns the value of the secondMoments record component.
      Returns:
      the value of the secondMoments record component
    • masterWeights

      public Map<Integer,Tensor> masterWeights()
      Returns the value of the masterWeights record component.
      Returns:
      the value of the masterWeights record component