Basic schedules
While ParameterSchedulers.jl has some complex scheduling capability, its core is made of two kinds of basic schedules: decay schedules and cyclic schedules. Each kind of schedule conforms to a formula which is relevant for understanding the schedules behavior. Still, both types of schedules can be called and iterated like we saw in the getting started tutorial.
Decay schedules
A decay schedule is defined by the following formula:
where is the schedule output, is the base (initial) value, and is the decay function. Typically, the decay function is expected to be bounded between , but this requirement is only suggested and not enforced.
For example, here is an exponential decay schedule:
expdecay(γ, t) = γ^(t - 1)
s = Exp(λ = 0.1, γ = 0.8)
println("λ g(1) == s(1): ",
0.1 * expdecay(0.8, 1) == s(1))
λ g(1) == s(1): true
As you can see above, Exp
is a type of decay schedule. Below is a list of all the decay schedules implemented, and the parameters and decay functions for each one.
Schedule | Parameters | Decay Function |
---|---|---|
Step | λ , γ , step_sizes | where |
Exp | λ , γ | |
Poly | λ , p , max_iter | |
Inv | λ , γ , p |
Cyclic schedules
A cyclic schedule exhibits periodic behavior, and it is described by the following formula:
where is the schedule output, and are the range endpoints, and is the cycle function. Similar to the decay function, the cycle function is expected to be bounded between , but this requirement is only suggested and not enforced.
For example, here is triangular wave schedule:
tricycle(period, t) = (2 / π) * abs(asin(sin(π * (t - 1) / period)))
s = Triangle(λ0 = 0.1, λ1 = 0.4, period = 2)
println("abs(λ0 - λ1) g(1) + min(λ0, λ1) == s(1): ",
abs(0.1 - 0.4) * tricycle(2, 1) + min(0.1, 0.4) == s(1))
abs(λ0 - λ1) g(1) + min(λ0, λ1) == s(1): true
Triangle
(used in the above example) is a type of cyclic schedule. Below is a list of all the cyclic schedules implemented, and the parameters and cycle functions for each one.
Schedule | Parameters | Cycle Function |
---|---|---|
Triangle | λ0 , λ1 , period | |
TriangleDecay2 | λ0 , λ1 , period | |
TriangleExp | λ0 , λ1 , period , γ | |
Sin | λ0 , λ1 , period | |
SinDecay2 | λ0 , λ1 , period | |
SinExp | λ0 , λ1 , period , γ | |
Cos | λ0 , λ1 , period |