Base class implementing common properties of a weight optimizer model. More...
#include <weight_optimizer.h>
Public Member Functions | |
| WeightOptimizerCommonProperties () | |
| Default constructor. | |
| virtual | ~WeightOptimizerCommonProperties () |
| Destructor. | |
| WeightOptimizerCommonProperties (const WeightOptimizerCommonProperties &) | |
| 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 parameters in parameter dictionary. | |
| virtual WeightOptimizerCommonProperties * | clone () const =0 |
| Clone constructor. | |
| virtual WeightOptimizer * | get_optimizer () const =0 |
| Get optimizer. | |
| double | get_Wmin () const |
| Get minimal value for synaptic weight. | |
| double | get_Wmax () const |
| Get maximal value for synaptic weight. | |
| virtual std::string | get_name () const =0 |
| Get optimizer name. | |
Public Attributes | |
| size_t | batch_size_ |
| Size of an optimization batch. | |
| double | eta_ |
| Common learning rate for all synapses. | |
| double | eta_first_change_ |
| First non-default learning rate. | |
| long | eta_change_count_ |
| Count of learning rate changes so far in the simulation to identify the first change. | |
| double | Wmin_ |
| Minimal value for synaptic weight. | |
| double | Wmax_ |
| Maximal value for synaptic weight. | |
| bool | optimize_each_step_ |
| If true, optimize each step, else once per spike. | |
Base class implementing common properties of a weight optimizer model.
The CommonProperties of synapse models supporting weight optimization own an object of this class hierarchy. The values in these objects are used by the synapse-specific optimizer object. Change of the optimizer type is only possible before synapses of the model have been created.
| nest::WeightOptimizerCommonProperties::WeightOptimizerCommonProperties | ( | ) |
Default constructor.
|
inlinevirtual |
Destructor.
| nest::WeightOptimizerCommonProperties::WeightOptimizerCommonProperties | ( | const WeightOptimizerCommonProperties & | cp | ) |
Copy constructor.
|
pure virtual |
Clone constructor.
Implemented in nest::WeightOptimizerCommonPropertiesGradientDescent, and nest::WeightOptimizerCommonPropertiesAdam.
|
pure virtual |
Get optimizer name.
Implemented in nest::WeightOptimizerCommonPropertiesGradientDescent, and nest::WeightOptimizerCommonPropertiesAdam.
Referenced by nest::EpropSynapseCommonProperties::get_status(), get_status(), nest::EpropSynapseCommonProperties::set_status(), and nest::EpropSynapseBSSHSLM2020CommonProperties::set_status().
|
pure virtual |
Get optimizer.
Implemented in nest::WeightOptimizerCommonPropertiesGradientDescent, and nest::WeightOptimizerCommonPropertiesAdam.
Referenced by nest::eprop_synapse< targetidentifierT >::check_connection(), and nest::eprop_synapse_bsshslm_2020< targetidentifierT >::check_connection().
|
virtual |
Get parameter dictionary.
Reimplemented in nest::WeightOptimizerCommonPropertiesAdam.
References nest::names::batch_size(), batch_size_, nest::names::eta(), eta_, get_name(), nest::names::optimize_each_step(), optimize_each_step_, nest::names::optimizer(), nest::names::Wmax(), Wmax_, nest::names::Wmin(), and Wmin_.
Referenced by nest::EpropSynapseCommonProperties::get_status(), nest::EpropSynapseBSSHSLM2020CommonProperties::get_status(), and nest::WeightOptimizerCommonPropertiesAdam::get_status().
|
inline |
Get maximal value for synaptic weight.
References Wmax_.
|
inline |
Get minimal value for synaptic weight.
References Wmin_.
|
delete |
Assignment operator.
|
virtual |
Update parameters in parameter dictionary.
Reimplemented in nest::WeightOptimizerCommonPropertiesAdam.
References nest::names::batch_size(), batch_size_, nest::names::eta(), eta_, eta_change_count_, eta_first_change_, nest::names::optimize_each_step(), optimize_each_step_, nest::names::Wmax(), Wmax_, nest::names::Wmin(), and Wmin_.
Referenced by nest::WeightOptimizerCommonPropertiesAdam::set_status(), nest::EpropSynapseCommonProperties::set_status(), and nest::EpropSynapseBSSHSLM2020CommonProperties::set_status().
| size_t nest::WeightOptimizerCommonProperties::batch_size_ |
Size of an optimization batch.
Referenced by get_status(), nest::WeightOptimizer::optimized_weight(), and set_status().
| double nest::WeightOptimizerCommonProperties::eta_ |
Common learning rate for all synapses.
Referenced by get_status(), nest::WeightOptimizer::optimized_weight(), and set_status().
| long nest::WeightOptimizerCommonProperties::eta_change_count_ |
Count of learning rate changes so far in the simulation to identify the first change.
Referenced by nest::WeightOptimizer::optimized_weight(), and set_status().
| double nest::WeightOptimizerCommonProperties::eta_first_change_ |
First non-default learning rate.
Stores the first non-default learning rate, ensuring correct handling when the global learning rate (eta) is modified before the first optimization step. Once optimization begins, eta_current aligns with eta. Along with eta_change_count and eta_current, this enables simulations with distinct phases, such as training (nonzero learning rate) and validation, testing, or early stopping (zero learning rate).
Referenced by nest::WeightOptimizer::optimized_weight(), and set_status().
| bool nest::WeightOptimizerCommonProperties::optimize_each_step_ |
If true, optimize each step, else once per spike.
Referenced by get_status(), and set_status().
| double nest::WeightOptimizerCommonProperties::Wmax_ |
Maximal value for synaptic weight.
Referenced by get_status(), get_Wmax(), nest::WeightOptimizer::optimized_weight(), and set_status().
| double nest::WeightOptimizerCommonProperties::Wmin_ |
Minimal value for synaptic weight.
Referenced by get_status(), get_Wmin(), nest::WeightOptimizer::optimized_weight(), and set_status().