25 #ifndef MXNET_CPP_LR_SCHEDULER_H_ 26 #define MXNET_CPP_LR_SCHEDULER_H_ 28 #include "dmlc/logging.h" 52 virtual float GetLR(
unsigned num_update) = 0;
68 stop_factor_lr_ = stop_factor_lr;
71 float GetLR(
unsigned num_update)
override {
72 while (num_update >
unsigned(count_ + step_)) {
77 LG <<
"Update[" << num_update <<
"]: now learning rate arrived at " \
78 <<
base_lr_ <<
", will not change in the future";
80 LG <<
"Update[" << num_update <<
"]: Change learning rate to " <<
base_lr_;
90 float stop_factor_lr_;
96 #endif // MXNET_CPP_LR_SCHEDULER_H_ virtual float GetLR(unsigned num_update)=0
get a new learning rate
namespace of mxnet
Definition: base.h:126
lr scheduler interface
Definition: lr_scheduler.h:36
FactorScheduler(int step, float factor=1, float stop_factor_lr=1e-8)
Definition: lr_scheduler.h:64
LRScheduler(float base_lr=0.01)
constructor
Definition: lr_scheduler.h:42
float GetLR(unsigned num_update) override
get a new learning rate
Definition: lr_scheduler.h:71
float base_lr_
Definition: lr_scheduler.h:59
void SetLR(const float lr)
set base lr
Definition: lr_scheduler.h:48
Definition: lr_scheduler.h:62
virtual ~LRScheduler()
destructor
Definition: lr_scheduler.h:56