Optimise.Learning_RateStrategies for learning rate update
Representation of learning rate update strategies. Possible values include:
Adam (alpha, beta1, beta2), see ref for parameter meaningval run : typ -> int -> Algodiff.t -> Algodiff.t array -> Algodiff.tExecute the computations defined in module typ.
val update_ch : typ -> Algodiff.t -> Algodiff.t array -> Algodiff.t arrayUpdate the cache of gradients.
val update :
typ ->
int ->
Algodiff.t ->
Algodiff.t ->
Algodiff.t array ->
Algodiff.tupdate typ i p' g' c returns the weight update of step i from the search direction p', the gradient g' and the gradient cache c (already updated with update_ch).
For Adam this is -a_t * m / (sqrt v + 1e-8) with the bias-corrected step a_t = alpha * sqrt (1 - beta2^i) / (1 - beta1^i); it ignores p', so Adam is only meaningful with Gradient.GD. For every other strategy it is p' * run typ i g' c. Use this rather than run for Adam: run divides by g', which is wrong where the gradient is zero or tiny.
val scale : typ -> int -> floatscale typ i is the factor of the step-i update that depends on i: update typ i p' g' c equals scale typ i * unscaled_update typ p' g' c up to rounding. It is 1. for Adagrad and RMSprop.
val unscaled_update :
typ ->
Algodiff.t ->
Algodiff.t ->
Algodiff.t array ->
Algodiff.tunscaled_update typ p' g' c is the part of the update that does not depend on the step; see scale.
val to_string : typ -> stringConvert the module typ to its string representation.