Package ai.djl.training.tracker
Class CosineTracker
- java.lang.Object
-
- ai.djl.training.tracker.CosineTracker
-
- All Implemented Interfaces:
ParameterTracker
,Tracker
public class CosineTracker extends java.lang.Object implements Tracker
CosineTracker
is an implementation ofTracker
which is updated by taking sections of a cosine curve to smoothly reduce learning rate until a specified step and base learning rate.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CosineTracker.Builder
The Builder to construct anCosineTracker
object.
-
Constructor Summary
Constructors Constructor Description CosineTracker(CosineTracker.Builder builder)
Creates a new instance ofCosineTracker
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CosineTracker.Builder
builder()
Creates a new builder.float
getNewValue(int numUpdate)
Fetches the value after the given number of steps/updates.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ai.djl.training.tracker.Tracker
getNewValue
-
-
-
-
Constructor Detail
-
CosineTracker
public CosineTracker(CosineTracker.Builder builder)
Creates a new instance ofCosineTracker
.- Parameters:
builder
- the builder to create a new instance ofCosineTracker
-
-
Method Detail
-
builder
public static CosineTracker.Builder builder()
Creates a new builder.- Returns:
- a new builder
-
getNewValue
public float getNewValue(int numUpdate)
Fetches the value after the given number of steps/updates.- Specified by:
getNewValue
in interfaceTracker
- Parameters:
numUpdate
- the total number of steps/updates- Returns:
- this
Builder
-
-