jsat.math.decayrates
Class ExponetialDecay
- java.lang.Object
-
- jsat.math.decayrates.ExponetialDecay
-
- All Implemented Interfaces:
- java.io.Serializable, DecayRate, Parameterized
public class ExponetialDecay extends java.lang.Object implements DecayRate, Parameterized
The Exponential Decay requires the maximum time step to be explicitly known ahead of time. Provided either in the call torate(double, double, double), or internal bysetMinRate(double).
The Exponential Decay will decay at an exponential rate from the initial value until the specifiedsetMinRate(double)is reached.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ExponetialDecay()Creates a new decay rate that decays down to 1e-4ExponetialDecay(double min)Creates a new Exponential DecayExponetialDecay(double min, double maxTime)Creates a new Exponential Decay
Note that when usingrate(double, double, double), the maxTime is always superceded by the value given to the function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description DecayRateclone()doublegetMaxTime()Returns the maximum time to use in the rate decaydoublegetMinRate()Returns the minimum value to return from he rate methodsdoublerate(double time, double initial)Decays the initial value over time.doublerate(double time, double maxTime, double initial)Decays the initial value over time.voidsetMaxTime(double maxTime)Sets the maximum amount of time to allow in the rate decay.voidsetMinRate(double min)Sets the minimum learning rate to returnjava.lang.StringtoString()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jsat.parameters.Parameterized
getParameter, getParameters
-
-
-
-
Constructor Detail
-
ExponetialDecay
public ExponetialDecay(double min)
Creates a new Exponential Decay- Parameters:
min- a value less than the learning rate that, that will be the minimum rate returned once the maximum time is reached
-
ExponetialDecay
public ExponetialDecay(double min, double maxTime)Creates a new Exponential Decay
Note that when usingrate(double, double, double), the maxTime is always superceded by the value given to the function.- Parameters:
min- a value less than the learning rate that, that will be the minimum returned valuemaxTime- the maximum amount of time
-
ExponetialDecay
public ExponetialDecay()
Creates a new decay rate that decays down to 1e-4
-
-
Method Detail
-
setMinRate
public void setMinRate(double min)
Sets the minimum learning rate to return- Parameters:
min- the minimum learning rate to return
-
getMinRate
public double getMinRate()
Returns the minimum value to return from he rate methods- Returns:
- the minimum value to return
-
setMaxTime
public void setMaxTime(double maxTime)
Sets the maximum amount of time to allow in the rate decay. Any time value larger will be treated as the set maximum.
Any calls torate(double, double, double)will use the value provided in that method call instead.- Parameters:
maxTime- the maximum amount of time to allow
-
getMaxTime
public double getMaxTime()
Returns the maximum time to use in the rate decay- Returns:
- the maximum time to use in the rate decay
-
rate
public double rate(double time, double maxTime, double initial)Description copied from interface:DecayRateDecays the initial value over time.
-
rate
public double rate(double time, double initial)Description copied from interface:DecayRateDecays the initial value over time.
-
clone
public DecayRate clone()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG