Package ai.djl.training.tracker
Class LinearTracker.Builder
- java.lang.Object
-
- ai.djl.training.tracker.LinearTracker.Builder
-
- Enclosing class:
- LinearTracker
public static final class LinearTracker.Builder extends java.lang.ObjectThe Builder to construct anLinearTrackerobject.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinearTrackerbuild()Builds aLinearTrackerblock.LinearTracker.BuilderoptMaxUpdates(int maxUpdates)Sets the maximum number of updates after which the value should remain constant.LinearTracker.BuilderoptMaxValue(float max)Sets the maximum value for a positive slope.LinearTracker.BuilderoptMinValue(float min)Sets the minimum value for a negative slope.LinearTracker.BuilderoptSlope(float slope)Sets the value of the linear slope.LinearTracker.BuildersetBaseValue(float baseValue)Sets the initial value after no steps.
-
-
-
Method Detail
-
setBaseValue
public LinearTracker.Builder setBaseValue(float baseValue)
Sets the initial value after no steps.- Parameters:
baseValue- the initial value- Returns:
- this
Builder
-
optSlope
public LinearTracker.Builder optSlope(float slope)
Sets the value of the linear slope.Use a positive number for an increasing value and negative for decreasing.
- Parameters:
slope- the value of the linear slope- Returns:
- this
Builder
-
optMaxValue
public LinearTracker.Builder optMaxValue(float max)
Sets the maximum value for a positive slope.This is equivalent to the max updates. Only one can be set.
- Parameters:
max- the max value- Returns:
- this
Builder
-
optMinValue
public LinearTracker.Builder optMinValue(float min)
Sets the minimum value for a negative slope.This is equivalent to the max updates. Only one can be set.
- Parameters:
min- the minimum value- Returns:
- this
Builder
-
optMaxUpdates
public LinearTracker.Builder optMaxUpdates(int maxUpdates)
Sets the maximum number of updates after which the value should remain constant.- Parameters:
maxUpdates- the maximum number of updates after which the value should remain constant- Returns:
- this
Builder
-
build
public LinearTracker build()
Builds aLinearTrackerblock.- Returns:
- the
LinearTrackerblock
-
-