26 #ifndef MXNET_CPP_LR_SCHEDULER_H_ 27 #define MXNET_CPP_LR_SCHEDULER_H_ 29 #include "dmlc/logging.h" 53 virtual float GetLR(
unsigned num_update) = 0;
69 stop_factor_lr_ = stop_factor_lr;
72 float GetLR(
unsigned num_update)
override {
73 while (num_update >
unsigned(count_ + step_)) {
78 LG <<
"Update[" << num_update <<
"]: now learning rate arrived at " \
79 <<
base_lr_ <<
", will not change in the future";
81 LG <<
"Update[" << num_update <<
"]: Change learning rate to " <<
base_lr_;
91 float stop_factor_lr_;
97 #endif // MXNET_CPP_LR_SCHEDULER_H_ virtual float GetLR(unsigned num_update)=0
get a new learning rate
namespace of mxnet
Definition: base.h:127
lr scheduler interface
Definition: lr_scheduler.h:37
FactorScheduler(int step, float factor=1, float stop_factor_lr=1e-8)
Definition: lr_scheduler.h:65
LRScheduler(float base_lr=0.01)
constructor
Definition: lr_scheduler.h:43
float GetLR(unsigned num_update) override
get a new learning rate
Definition: lr_scheduler.h:72
float base_lr_
Definition: lr_scheduler.h:60
void SetLR(const float lr)
set base lr
Definition: lr_scheduler.h:49
Definition: lr_scheduler.h:63
virtual ~LRScheduler()
destructor
Definition: lr_scheduler.h:57