The argument is a function that returns the learning rate given the current step (i.e., curren running iteration).
| 79 | /// The argument is a function that returns the learning rate given the |
| 80 | /// current step (i.e., curren running iteration). |
| 81 | void SetLearningRateGenerator(function<float(int)> func) { |
| 82 | learning_rate_generator_ = func; |
| 83 | } |
| 84 | float GetLearningRate(int step) { |
| 85 | if (learning_rate_generator_) |
| 86 | return learning_rate_generator_(step); |