Base class implementing a weight optimizer model. More...
#include <weight_optimizer.h>
Public Member Functions | |
| WeightOptimizer () | |
| Default constructor. | |
| virtual | ~WeightOptimizer () |
| Destructor. | |
| WeightOptimizer (const WeightOptimizer &)=default | |
| Copy constructor. | |
| WeightOptimizer & | operator= (const WeightOptimizer &)=delete |
| Assignment operator. | |
| virtual void | get_status (Dictionary &d) const |
| Get parameter dictionary. | |
| virtual void | set_status (const Dictionary &d) |
| Update values in parameter dictionary. | |
| double | optimized_weight (const WeightOptimizerCommonProperties &cp, const size_t idx_current_update, const double gradient, double weight) |
| Return optimized weight based on current weight. | |
Protected Member Functions | |
| virtual double | optimize_ (const WeightOptimizerCommonProperties &cp, double weight, size_t current_opt_step)=0 |
| Perform specific optimization. | |
Protected Attributes | |
| double | cumulative_gradient_ |
| Cumulative gradient over the current batch. | |
| size_t | optimization_step_ |
| Current optimization step, whereby optimization happens every batch_size_ steps. | |
| double | eta_current_ |
| Synapse-specific learning rate when the history for its upcoming weight update was archived. | |
| long | n_optimize_ |
| Number of optimizations. | |
Base class implementing a weight optimizer model.
An optimizer is used by a synapse that supports this mechanism to optimize the weight.
An optimizer may have an internal state which is maintained from call to call of the optimized_weight() method. Each optimized object belongs to exactly one synapse.
| nest::WeightOptimizer::WeightOptimizer | ( | ) |
Default constructor.
|
inlinevirtual |
Destructor.
|
default |
Copy constructor.
|
virtual |
Get parameter dictionary.
Reimplemented in nest::WeightOptimizerAdam.
Referenced by nest::WeightOptimizerAdam::get_status().
|
delete |
Assignment operator.
|
protectedpure virtual |
Perform specific optimization.
Implemented in nest::WeightOptimizerGradientDescent, and nest::WeightOptimizerAdam.
Referenced by optimized_weight().
| double nest::WeightOptimizer::optimized_weight | ( | const WeightOptimizerCommonProperties & | cp, |
| const size_t | idx_current_update, | ||
| const double | gradient, | ||
| double | weight | ||
| ) |
Return optimized weight based on current weight.
References nest::WeightOptimizerCommonProperties::batch_size_, cumulative_gradient_, nest::WeightOptimizerCommonProperties::eta_, nest::WeightOptimizerCommonProperties::eta_change_count_, eta_current_, nest::WeightOptimizerCommonProperties::eta_first_change_, n_optimize_, optimization_step_, optimize_(), nest::WeightOptimizerCommonProperties::Wmax_, and nest::WeightOptimizerCommonProperties::Wmin_.
|
virtual |
Update values in parameter dictionary.
Reimplemented in nest::WeightOptimizerAdam.
Referenced by nest::WeightOptimizerAdam::set_status().
|
protected |
Cumulative gradient over the current batch.
Referenced by nest::WeightOptimizerGradientDescent::optimize_(), nest::WeightOptimizerAdam::optimize_(), and optimized_weight().
|
protected |
Synapse-specific learning rate when the history for its upcoming weight update was archived.
Ensures the correct learning rate during the next optimization, even if the global learning rate changes before activation of the synapse.
Referenced by nest::WeightOptimizerGradientDescent::optimize_(), nest::WeightOptimizerAdam::optimize_(), and optimized_weight().
|
protected |
Number of optimizations.
Referenced by optimized_weight().
|
protected |
Current optimization step, whereby optimization happens every batch_size_ steps.
Referenced by nest::WeightOptimizerAdam::optimize_(), and optimized_weight().