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

Base class implementing a weight optimizer model. More...

#include <weight_optimizer.h>

Inheritance diagram for nest::WeightOptimizer:
[legend]

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ WeightOptimizer() [1/2]

nest::WeightOptimizer::WeightOptimizer ( )

Default constructor.

References cumulative_gradient_, eta_current_, n_optimize_, and optimization_step_.

Referenced by operator=(), WeightOptimizer(), nest::WeightOptimizerAdam::WeightOptimizerAdam(), and nest::WeightOptimizerGradientDescent::WeightOptimizerGradientDescent().

Here is the caller graph for this function:

◆ ~WeightOptimizer()

virtual nest::WeightOptimizer::~WeightOptimizer ( )
inlinevirtual

Destructor.

◆ WeightOptimizer() [2/2]

nest::WeightOptimizer::WeightOptimizer ( const WeightOptimizer & )
default

Copy constructor.

References WeightOptimizer().

Here is the call graph for this function:

Member Function Documentation

◆ get_status()

void nest::WeightOptimizer::get_status ( Dictionary & d) const
virtual

Get parameter dictionary.

Reimplemented in nest::WeightOptimizerAdam.

Referenced by nest::WeightOptimizerAdam::get_status().

Here is the caller graph for this function:

◆ operator=()

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

Assignment operator.

References WeightOptimizer().

Here is the call graph for this function:

◆ optimize_()

virtual double nest::WeightOptimizer::optimize_ ( const WeightOptimizerCommonProperties & cp,
double weight,
size_t current_opt_step )
protectedpure virtual

Perform specific optimization.

Implemented in nest::WeightOptimizerAdam, and nest::WeightOptimizerGradientDescent.

Referenced by optimized_weight().

Here is the caller graph for this function:

◆ optimized_weight()

double nest::WeightOptimizer::optimized_weight ( const WeightOptimizerCommonProperties & cp,
const size_t idx_current_update,
const double gradient,
double weight )

◆ set_status()

void nest::WeightOptimizer::set_status ( const Dictionary & d)
virtual

Update values in parameter dictionary.

Reimplemented in nest::WeightOptimizerAdam.

Referenced by nest::WeightOptimizerAdam::set_status().

Here is the caller graph for this function:

Member Data Documentation

◆ cumulative_gradient_

double nest::WeightOptimizer::cumulative_gradient_
protected

◆ eta_current_

double nest::WeightOptimizer::eta_current_
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::WeightOptimizerAdam::optimize_(), nest::WeightOptimizerGradientDescent::optimize_(), optimized_weight(), and WeightOptimizer().

◆ n_optimize_

long nest::WeightOptimizer::n_optimize_
protected

Number of optimizations.

Referenced by optimized_weight(), and WeightOptimizer().

◆ optimization_step_

size_t nest::WeightOptimizer::optimization_step_
protected

Current optimization step, whereby optimization happens every batch_size_ steps.

Referenced by nest::WeightOptimizerAdam::optimize_(), optimized_weight(), and WeightOptimizer().


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