Spike
Loading...
Searching...
No Matches
IFAC.h
Go to the documentation of this file.
1
6#ifndef SPIKE_IFAC_H
7#define SPIKE_IFAC_H
8
9#include <cassert>
10#include <cmath>
11#include <random>
12#include <vector>
13
14#include "Spike/Neuron/IF.h"
16#include "Spike/Signal/Signal.h"
17#include "Spike/SpikeTrain/SpikeTrain.h"
18#include "Spike/TimeFrame/TimeFrame.h"
19
20namespace Spike {
21
26class IFAC : public IF {
27protected:
28 double tau_a;
29 double Delta;
30public:
35 explicit IFAC(const std::string &input_file);
36
44 IFAC(double mu, double D, double tau_a, double Delta);
45
51 void get_spikes(SpikeTrain &spike_train) override;
52
59 void get_spikes(Signal &signal, SpikeTrain &spike_train) override;
60
68 void get_voltage_curve(const TimeFrame &time, std::vector<double> &v,
69 std::vector<double> &a);
70
75 void set_tau_a(double tau_a_new) {tau_a = tau_a_new;};
76
81 void set_Delta(double Delta_new) {Delta = Delta_new;};
82};
83
88class PIFAC : public IFAC {
89public:
97 PIFAC(double mu, double D, double tau_a, double Delta);
98
103 explicit PIFAC(const std::string &input_file);
104
110 [[nodiscard]] double drift(double v) const override;
111
116 void print(std::ostream &out) const override {
117 out << "PIFAC(mu: " << mu << ", D: " << D << ", tau_a: " << tau_a
118 << ", Delta: " << Delta << ")";
119 }
120};
121
126class LIFAC : public IFAC {
127public:
135 LIFAC(double mu, double D, double tau_a, double Delta);
136
141 explicit LIFAC(const std::string &input_file);
142
148 [[nodiscard]] double drift(double v) const override;
149
154 void print(std::ostream &out) const override {
155 out << "LIFAC(mu: " << mu << ", D: " << D << ", tau_a: " << tau_a
156 << ", Delta: " << Delta << ")";
157 }
158};
159
160} // namespace Spike
161
162#endif // SPIKE_IFAC_H
An abstract base class for integrate-and-fire neurons with an adaptation current.
Definition IFAC.h:26
void set_tau_a(double tau_a_new)
Sets a new adaptation time constant.
Definition IFAC.h:75
IFAC(const std::string &input_file)
Construct IFAC from .ini file.
Definition IFAC.cpp:22
void set_Delta(double Delta_new)
Sets a new kick size.
Definition IFAC.h:81
double Delta
kick size of the adaptation
Definition IFAC.h:29
double tau_a
adaptation time constant
Definition IFAC.h:28
void get_spikes(SpikeTrain &spike_train) override
Obtains spikes by integrating the Langevin equation using an Euler-Maruyama scheme.
Definition IFAC.cpp:34
void get_voltage_curve(const TimeFrame &time, std::vector< double > &v, std::vector< double > &a)
Calculates the trajectory, i.e. v(t) and a(t) for a given time frame.
Definition IFAC.cpp:83
Abstract base class for integrate-and-fire (IF) neurons.
Definition IF.h:26
double D
diffusion coefficient
Definition IF.h:29
double mu
mean input current
Definition IF.h:28
Implements a leaky integrate-and-fire neuron with an adaptation current (LIFAC).
Definition IFAC.h:126
double drift(double v) const override
Returns the drift of the LIFAC neuron, i.e. mu - v.
Definition IFAC.cpp:141
void print(std::ostream &out) const override
Prints the LIFAC to out stream.
Definition IFAC.h:154
LIFAC(double mu, double D, double tau_a, double Delta)
Construct LIFAC from parameters.
Definition IFAC.cpp:126
Implement a perfect integrate-and-fire neuron with an adaptation current (PIFAC).
Definition IFAC.h:88
double drift(double v) const override
Returns drift of the PIFAC neuron, i.e. mu.
Definition IFAC.cpp:123
PIFAC(double mu, double D, double tau_a, double Delta)
Construct PIFAC from parameters.
Definition IFAC.cpp:108
void print(std::ostream &out) const override
Prints the PIFAC neuron to out stream.
Definition IFAC.h:116
An abstract base class for signals.
Definition Signal.h:20
A spike train for discretized times. For a given time discretization with time step dt,...
Definition SpikeTrain.h:18
A time frame with discrete time steps.
Definition TimeFrame.h:13