NEST main@f146f75
Loading...
Searching...
No Matches
nest::WeightOptimizerCommonProperties Class Referenceabstract

Base class implementing common properties of a weight optimizer model. More...

#include <weight_optimizer.h>

Inheritance diagram for nest::WeightOptimizerCommonProperties:
[legend]

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ WeightOptimizerCommonProperties() [1/2]

nest::WeightOptimizerCommonProperties::WeightOptimizerCommonProperties ( )

◆ ~WeightOptimizerCommonProperties()

virtual nest::WeightOptimizerCommonProperties::~WeightOptimizerCommonProperties ( )
inlinevirtual

Destructor.

◆ WeightOptimizerCommonProperties() [2/2]

nest::WeightOptimizerCommonProperties::WeightOptimizerCommonProperties ( const WeightOptimizerCommonProperties & cp)

Copy constructor.

References batch_size_, eta_, eta_change_count_, eta_first_change_, optimize_each_step_, WeightOptimizerCommonProperties(), Wmax_, and Wmin_.

Here is the call graph for this function:

Member Function Documentation

◆ clone()

virtual WeightOptimizerCommonProperties * nest::WeightOptimizerCommonProperties::clone ( ) const
pure virtual

Clone constructor.

Implemented in nest::WeightOptimizerCommonPropertiesAdam, and nest::WeightOptimizerCommonPropertiesGradientDescent.

References WeightOptimizerCommonProperties().

Here is the call graph for this function:

◆ get_name()

virtual std::string nest::WeightOptimizerCommonProperties::get_name ( ) const
pure virtual

Get optimizer name.

Implemented in nest::WeightOptimizerCommonPropertiesAdam, and nest::WeightOptimizerCommonPropertiesGradientDescent.

Referenced by get_status().

Here is the caller graph for this function:

◆ get_optimizer()

virtual WeightOptimizer * nest::WeightOptimizerCommonProperties::get_optimizer ( ) const
pure virtual

Get optimizer.

Implemented in nest::WeightOptimizerCommonPropertiesAdam, and nest::WeightOptimizerCommonPropertiesGradientDescent.

Referenced by nest::eprop_synapse< targetidentifierT >::check_connection(), and nest::eprop_synapse_bsshslm_2020< targetidentifierT >::check_connection().

Here is the caller graph for this function:

◆ get_status()

void nest::WeightOptimizerCommonProperties::get_status ( Dictionary & d) const
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::WeightOptimizerCommonPropertiesAdam::get_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_Wmax()

double nest::WeightOptimizerCommonProperties::get_Wmax ( ) const
inline

Get maximal value for synaptic weight.

References Wmax_.

◆ get_Wmin()

double nest::WeightOptimizerCommonProperties::get_Wmin ( ) const
inline

Get minimal value for synaptic weight.

References Wmin_.

◆ operator=()

WeightOptimizer & nest::WeightOptimizerCommonProperties::operator= ( const WeightOptimizer & )
delete

Assignment operator.

◆ set_status()

void nest::WeightOptimizerCommonProperties::set_status ( const Dictionary & d)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ batch_size_

size_t nest::WeightOptimizerCommonProperties::batch_size_

◆ eta_

double nest::WeightOptimizerCommonProperties::eta_

◆ eta_change_count_

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(), set_status(), WeightOptimizerCommonProperties(), and WeightOptimizerCommonProperties().

◆ eta_first_change_

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(), set_status(), WeightOptimizerCommonProperties(), and WeightOptimizerCommonProperties().

◆ optimize_each_step_

bool nest::WeightOptimizerCommonProperties::optimize_each_step_

If true, optimize each step, else once per spike.

Referenced by get_status(), set_status(), WeightOptimizerCommonProperties(), and WeightOptimizerCommonProperties().

◆ Wmax_

double nest::WeightOptimizerCommonProperties::Wmax_

◆ Wmin_

double nest::WeightOptimizerCommonProperties::Wmin_

The documentation for this class was generated from the following files: