jsat.math.decayrates
Class PowerDecay
- java.lang.Object
-
- jsat.math.decayrates.PowerDecay
-
- All Implemented Interfaces:
- java.io.Serializable, DecayRate, Parameterized
public class PowerDecay extends java.lang.Object implements DecayRate, Parameterized
Decays an input by power of the amount of time that has occurred, the max time being irrelevant. More specifically as η (τ+ time)-α
InverseDecayis a special case of this decay when α=1.
NoDecayis a special case of this decay when α = 0- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PowerDecay()Creates a new Power Decay ratePowerDecay(double tau, double alpha)Creates a new Power decay rate
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description DecayRateclone()doublegetAlpha()Returns the scaling parameterdoublegetTau()Returns the early rate dampening parameterdoublerate(double time, double initial)Decays the initial value over time.doublerate(double time, double maxTime, double initial)Decays the initial value over time.voidsetAlpha(double alpha)Controls the scaling via exponentiation, increasing α increases the rate at which the rate decays.voidsetTau(double tau)Controls the rate early in time, but has a decreasing impact on the rate returned as time goes forward.java.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
-
PowerDecay
public PowerDecay(double tau, double alpha)Creates a new Power decay rate- Parameters:
tau- the initial time offsetalpha- the time scaling
-
PowerDecay
public PowerDecay()
Creates a new Power Decay rate
-
-
Method Detail
-
setAlpha
public void setAlpha(double alpha)
Controls the scaling via exponentiation, increasing α increases the rate at which the rate decays. As α goes to zero, the decay rate goes toward zero (meaning the value returned becomes constant),- Parameters:
alpha- the scaling parameter in [0, ∞), but should generally be kept in (0, 1).
-
getAlpha
public double getAlpha()
Returns the scaling parameter- Returns:
- the scaling parameter
-
setTau
public void setTau(double tau)
Controls the rate early in time, but has a decreasing impact on the rate returned as time goes forward. Larger values of τ dampen the initial rates returned, while lower values let the initial rates start higher.- Parameters:
tau- the early rate dampening parameter
-
getTau
public double getTau()
Returns the early rate dampening parameter- Returns:
- the early rate dampening parameter
-
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