26 template <
typename math_t>
27 math_t
max(math_t a, math_t b)
29 return (a < b) ? b : a;
33 template <
typename math_t>
36 return (eta / pow(t, power_t));
39 template <
typename math_t>
45 template <
typename math_t>
48 math_t typw = sqrt(math_t(1.0) / sqrt(alpha));
49 math_t initial_eta0 = typw /
max(math_t(1.0),
regDLoss(-typw, math_t(1.0)));
50 return (math_t(1.0) / (initial_eta0 * alpha));
53 template <
typename math_t>
54 math_t
optimal(math_t alpha, math_t optimal_init,
int t)
56 return math_t(1.0) / (alpha * (optimal_init + t - 1));
59 template <
typename math_t>
math_t max(math_t a, math_t b)
Definition: learning_rate.h:27
math_t invScaling(math_t eta, math_t power_t, int t)
Definition: learning_rate.h:34
math_t optimal(math_t alpha, math_t optimal_init, int t)
Definition: learning_rate.h:54
math_t regDLoss(math_t a, math_t b)
Definition: learning_rate.h:40
math_t calLearningRate(ML::lr_type lr_type, math_t eta, math_t power_t, math_t alpha, math_t t)
Definition: learning_rate.h:60
math_t calOptimalInit(math_t alpha)
Definition: learning_rate.h:46
Definition: dbscan.hpp:30
lr_type
Definition: params.hpp:21
@ OPTIMAL
Definition: params.hpp:22
@ INVSCALING
Definition: params.hpp:24
@ CONSTANT
Definition: params.hpp:23