ANNarchy 4.8.2
  • ANNarchy
  • Installation
  • Tutorial
  • Manual
  • Notebooks
  • Reference

  • Reference
  • Core components
    • Population
    • Projection
    • Neuron
    • Synapse
    • Monitor
    • PopulationView
    • Dendrite
    • Network
  • Configuration
    • setup
    • compile
    • clear
    • reset
    • set_seed
    • get_population
    • get_projection
    • populations
    • projections
    • monitors
  • Simulation
    • simulate
    • simulate_until
    • step
    • parallel_run
    • enable_learning
    • disable_learning
    • get_time
    • set_time
    • get_current_step
    • set_current_step
    • dt
  • Neuron models
    • LeakyIntegrator
    • Izhikevich
    • IF_curr_exp
    • IF_cond_exp
    • IF_curr_alpha
    • IF_cond_alpha
    • HH_cond_exp
    • EIF_cond_alpha_isfa_ista
    • EIF_cond_exp_isfa_ista
  • Synapse models
    • STP
    • STDP
    • Hebb
    • Oja
    • IBCM
  • Inputs
    • InputArray
    • TimedArray
    • PoissonPopulation
    • TimedPoissonPopulation
    • SpikeSourceArray
    • HomogeneousCorrelatedSpikeTrains
    • CurrentInjection
    • DecodingProjection
    • ImagePopulation
    • VideoPopulation
  • IO
    • save
    • load
    • save_parameters
    • load_parameters
  • Utilities
    • report
  • Random Distributions
    • Uniform
    • DiscreteUniform
    • Normal
    • LogNormal
    • Exponential
    • Gamma
    • Binomial
  • Functions and Constants
    • add_function
    • functions
    • Constant
    • get_constant
  • Plotting
    • raster_plot
    • histogram
    • inter_spike_interval
    • coefficient_of_variation
    • population_rate
    • smoothed_rate
  • Callbacks
    • every
    • callbacks_enabled
    • disable_callbacks
    • enable_callbacks
    • clear_all_callbacks
  • Convolution
    • Convolution
    • Pooling
    • Transpose
    • Copy
  • BOLD monitoring
    • BoldMonitor
    • BoldModel
    • balloon_RN
    • balloon_RL
    • balloon_CN
    • balloon_CL
    • balloon_maith2021
    • balloon_two_inputs
  • Tensorboard logging
    • Logger
  • ANN-to-SNN conversion
    • ANNtoSNNConverter

On this page

  • Constant
    • Parameters
    • Attributes
    • Methods
      • set

Constant

core.Constant.Constant(self, name, value)

Constant parameter that can be used by all neurons and synapses.

The class Constant derives from float, so any legal operation on floats (addition, multiplication) can be used.

If a Neuron/Synapse defines a parameter with the same name, the constant parameters will not be visible.

Example:


tau = ann.Constant('tau', 20)
factor = ann.Constant('factor', 0.1)
real_tau = ann.Constant('real_tau', tau*factor)

neuron = ann.Neuron(
    equations='''
        real_tau*dr/dt + r =1.0
    '''
)

The value of the constant can be changed anytime with the set() method. Assignments will have no effect (e.g. tau = 10.0 only creates a new float).

The value of constants defined as combination of other constants (real_tau) is not updated if the value of these constants changes (changing tau with tau.set(10.0) will not modify the value of real_tau).

Parameters

Name Type Description Default
name name of the constant (unique), which can be used in equations. required
value the value of the constant, which must be a float, or a combination of Constants. required

Attributes

Name Description
name Name.
value Value.

Methods

Name Description
set Changes the value of the constant.

set

core.Constant.Constant.set(value, network=None)

Changes the value of the constant.

Parameters

Name Type Description Default
value float Value. required
network Network instance which should be updated. By default, all active networks are updated. None
functions
get_constant
 

Copyright Julien Vitay, Helge Ülo Dinkelbach, Fred Hamker