Spike
Loading...
Searching...
No Matches
Spike::IF Class Referenceabstract

Abstract base class for integrate-and-fire (IF) neurons. More...

#include <IF.h>

Public Member Functions

 IF (const std::string &input_file)
 Constructs an IF neuron from a .ini file.
 
 IF (double mu, double D)
 Construct an IF neuron from given parameters.
 
virtual double drift (double v) const =0
 Calculates the drift of the IF neuron.
 
double diffusion () const
 Calculates the diffusion of the IF neurons, i.e. sqrt(2D).
 
void get_spikes (SpikeTrain &spike_train) override
 Obtains spikes by integrating the Langevin equation using an Euler-Maruyama scheme.
 
void get_spikes (Signal &signal, SpikeTrain &spike_train) override
 Obtains spikes by integrating the Langevin equation using an Euler-Maruyama scheme. Neuron is subject to an applied signal.
 
void get_voltage_curve (const TimeFrame &time, std::vector< double > &v)
 Calculates the trajectory, i.e. v(t) for a given time frame.
 
void set_mu (double mu_new)
 Set new mean input current.
 
void set_D (double D_new)
 Set new diffusion coefficient.
 
double get_D () const
 Returns the diffusion coefficient.
 
virtual void print (std::ostream &out) const =0
 Prints the IF neuron to the outstream.
 

Protected Attributes

double mu
 mean input current
 
double D
 diffusion coefficient
 
std::random_device rd
 random device (seeding)
 
std::mt19937 generator
 random number generator
 
std::normal_distribution< double > dist
 normal distribution
 

Friends

std::ostream & operator<< (std::ostream &out, const IF &neuron)
 Overloads the << operator, so we can print the neuron.
 

Detailed Description

Abstract base class for integrate-and-fire (IF) neurons.

Constructor & Destructor Documentation

◆ IF() [1/2]

Spike::IF::IF ( const std::string & input_file)
explicit

Constructs an IF neuron from a .ini file.

Parameters
input_filePath to .ini file

◆ IF() [2/2]

Spike::IF::IF ( double mu,
double D )

Construct an IF neuron from given parameters.

Parameters
muMean input current
DDiffusion coefficient

Member Function Documentation

◆ diffusion()

double Spike::IF::diffusion ( ) const

Calculates the diffusion of the IF neurons, i.e. sqrt(2D).

Returns
Diffusion

◆ drift()

virtual double Spike::IF::drift ( double v) const
pure virtual

Calculates the drift of the IF neuron.

Parameters
vVoltage
Returns
Drift

Implemented in Spike::PIF, Spike::LIF, Spike::PIFAC, and Spike::LIFAC.

◆ get_D()

double Spike::IF::get_D ( ) const
inline

Returns the diffusion coefficient.

Returns
diffusion coefficient

◆ get_spikes() [1/2]

void Spike::IF::get_spikes ( Signal & signal,
SpikeTrain & spike_train )
overridevirtual

Obtains spikes by integrating the Langevin equation using an Euler-Maruyama scheme. Neuron is subject to an applied signal.

Parameters
signalSignal
spike_trainSpike train

Implements Spike::Neuron.

Reimplemented in Spike::IFAC.

◆ get_spikes() [2/2]

void Spike::IF::get_spikes ( SpikeTrain & spike_train)
overridevirtual

Obtains spikes by integrating the Langevin equation using an Euler-Maruyama scheme.

Parameters
spike_trainSpike train

Implements Spike::Neuron.

Reimplemented in Spike::IFAC.

◆ get_voltage_curve()

void Spike::IF::get_voltage_curve ( const TimeFrame & time,
std::vector< double > & v )

Calculates the trajectory, i.e. v(t) for a given time frame.

Parameters
timeTime frame
vVoltage array

◆ print()

virtual void Spike::IF::print ( std::ostream & out) const
pure virtual

Prints the IF neuron to the outstream.

Parameters
outout stream

Implemented in Spike::PIF, Spike::LIF, Spike::PIFAC, and Spike::LIFAC.

◆ set_D()

void Spike::IF::set_D ( double D_new)
inline

Set new diffusion coefficient.

Parameters
D_newdiffusion coefficient

◆ set_mu()

void Spike::IF::set_mu ( double mu_new)
inline

Set new mean input current.

Parameters
mu_newnew mean input current

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const IF & neuron )
friend

Overloads the << operator, so we can print the neuron.

Parameters
outout stream
neuronIF neuron
Returns
out stream

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