Record Class CosineLearningRateSchedule
java.lang.Object
java.lang.Record
io.github.kirstenali.deepj.training.CosineLearningRateSchedule
public record CosineLearningRateSchedule(float peakLearningRate, float minimumLearningRate, int warmupSteps, int totalSteps)
extends Record
Linear warmup followed by cosine decay.
-
Constructor Summary
ConstructorsConstructorDescriptionCosineLearningRateSchedule(float peakLearningRate, float minimumLearningRate, int warmupSteps, int totalSteps) Creates an instance of aCosineLearningRateSchedulerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatlearningRate(int step) floatReturns the value of theminimumLearningRaterecord component.floatReturns the value of thepeakLearningRaterecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalStepsrecord component.intReturns the value of thewarmupStepsrecord component.
-
Constructor Details
-
CosineLearningRateSchedule
public CosineLearningRateSchedule(float peakLearningRate, float minimumLearningRate, int warmupSteps, int totalSteps) Creates an instance of aCosineLearningRateSchedulerecord class.- Parameters:
peakLearningRate- the value for thepeakLearningRaterecord componentminimumLearningRate- the value for theminimumLearningRaterecord componentwarmupSteps- the value for thewarmupStepsrecord componenttotalSteps- the value for thetotalStepsrecord component
-
-
Method Details
-
learningRate
public float learningRate(int step) -
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. -
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. -
equals
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. All components in this record class are compared with '=='. -
peakLearningRate
public float peakLearningRate()Returns the value of thepeakLearningRaterecord component.- Returns:
- the value of the
peakLearningRaterecord component
-
minimumLearningRate
public float minimumLearningRate()Returns the value of theminimumLearningRaterecord component.- Returns:
- the value of the
minimumLearningRaterecord component
-
warmupSteps
public int warmupSteps()Returns the value of thewarmupStepsrecord component.- Returns:
- the value of the
warmupStepsrecord component
-
totalSteps
public int totalSteps()Returns the value of thetotalStepsrecord component.- Returns:
- the value of the
totalStepsrecord component
-