Class HpFloat
- java.lang.Object
-
- ai.djl.training.hyperparameter.param.Hyperparameter<java.lang.Float>
-
- ai.djl.training.hyperparameter.param.HpFloat
-
public class HpFloat extends Hyperparameter<java.lang.Float>
AHyperparameter
for a float.
-
-
Field Summary
-
Fields inherited from class ai.djl.training.hyperparameter.param.Hyperparameter
name
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Float
random()
Returns a random value for the hyperparameter for a range of a fixed value if it is aHpVal
.java.lang.String
toString()
-
Methods inherited from class ai.djl.training.hyperparameter.param.Hyperparameter
getName
-
-
-
-
Constructor Detail
-
HpFloat
public HpFloat(java.lang.String name, float lower, float upper, boolean log)
Constructs aHpFloat
.- Parameters:
name
- the name of the hyperparameterlower
- the lower bound (inclusive)upper
- the upper bound (exclusive)log
- whether to use log space. This is useful if your bounds cover different orders of magnitude (e.g. 1E-5 to 1E-2) instead of same magnitude (e.g. 2 to 5).
-
-
Method Detail
-
random
public java.lang.Float random()
Returns a random value for the hyperparameter for a range of a fixed value if it is aHpVal
.- Specified by:
random
in classHyperparameter<java.lang.Float>
- Returns:
- a random value for the hyperparameter for a range of a fixed value if it is a
HpVal
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-