Cypress  1.0
C++ Spiking Neural Network Simulation Framework
Static Public Member Functions | List of all members
cypress::SpikingUtils Class Reference

#include <spiking_utils.hpp>

Static Public Member Functions

template<typename T >
static PopulationBase add_typed_population (Network &network, const NeuronParameter &neuronParams, const size_t size, const typename T::Signals &rec_signal=typename T::Signals().record_spikes())
 
template<typename T >
static cypress::PopulationBase add_typed_population_no_record (Network &network, const NeuronParameter &neuronParams, const size_t size)
 
static const NeuronTypedetect_type (std::string neuron_type_str)
 
static cypress::PopulationBase add_population (const std::string neuron_type_str, Network &network, const NeuronParameter &neuronParams, const size_t size, const std::string record_signal="")
 
static bool rerun_fixed_number_trials (Network &network, Backend &backend, Real time, size_t n_trials=3)
 
static int calc_num_spikes (const std::vector< cypress::Real > &spiketrain, const cypress::Real start=0.0, const cypress::Real end=0.0)
 Calculate the number of spikes of spiketrain in interval [start,stop]. More...
 
template<typename T >
static std::vector< int > calc_num_spikes_vec (const cypress::Matrix< T > &spiketrains, const cypress::Real start=0.0, const cypress::Real end=std::numeric_limits< cypress::Real >::max())
 Calculate the number of spikes in a vector of spiketrains in intervall [start,stop]. More...
 
template<typename T >
static std::vector< T > spike_time_binning (const Real &start, const Real &stop, const size_t &n_bins, const std::vector< cypress::Real > &spike_times)
 
static std::vector< Realspike_time_binning_TTFS (const Real &start, const Real &stop, const size_t &n_bins, const std::vector< cypress::Real > &spike_times)
 

Member Function Documentation

static cypress::PopulationBase cypress::SpikingUtils::add_population ( const std::string  neuron_type_str,
Network network,
const NeuronParameter neuronParams,
const size_t  size,
const std::string  record_signal = "" 
)
static

Runs SpikingUtils::add_typed_population, but gets a string containing the neuron type instead of a template argument

Parameters
neuron_type_strstring naming the neuron type
networkinstace in wich the population is placed
neuronParamsNeuron parameters of the cell in the population
sizeNumber of neurons in the population
record_signalstring of the signal to be recorded by the backend, e.g. "spikes" or "v"
template<typename T >
static PopulationBase cypress::SpikingUtils::add_typed_population ( Network network,
const NeuronParameter neuronParams,
const size_t  size,
const typename T::Signals &  rec_signal = typename T::Signals().record_spikes() 
)
inlinestatic

Creates a population of type T and adds them to m_net

Parameters
networkinstace in wich the population is placed
neuronParamsNeuron parameters of the cell in the population
sizeNumber of neurons in the population
rec_signalsignal to be recorded by the backend
Returns
Network containing the add Population (same as network)
template<typename T >
static cypress::PopulationBase cypress::SpikingUtils::add_typed_population_no_record ( Network network,
const NeuronParameter neuronParams,
const size_t  size 
)
static

Creates a population of type T and adds them to m_net without recording

Parameters
networkinstace in wich the population is placed
neuronParamsNeuron parameters of the cell in the population
sizeNumber of neurons in the population
Returns
Network containing the add Population (same as network)
static int cypress::SpikingUtils::calc_num_spikes ( const std::vector< cypress::Real > &  spiketrain,
const cypress::Real  start = 0.0,
const cypress::Real  end = 0.0 
)
static

Calculate the number of spikes of spiketrain in interval [start,stop].

Parameters
spiketrainThe spiketrain for which the number of spikes should be calculated
startTimepoint from which counting starts
endEndpoint where counting stops
Returns
int returns the number of spikes in [start, stop]
template<typename T >
static std::vector<int> cypress::SpikingUtils::calc_num_spikes_vec ( const cypress::Matrix< T > &  spiketrains,
const cypress::Real  start = 0.0,
const cypress::Real  end = std::numeric_limits<cypress::Real>::max() 
)
inlinestatic

Calculate the number of spikes in a vector of spiketrains in intervall [start,stop].

Parameters
spiketrainsThe vector of spiketrains for which the number of spikes should be calculated
startTimepoint from which counting starts
endEndpoint where counting stops, leave empty to count all
Returns
int returns the number of spikes in [start, stop]
static const NeuronType& cypress::SpikingUtils::detect_type ( std::string  neuron_type_str)
static

Generates a NeuronType object from a string

Parameters
neuron_type_strstring naming the neuron type
Returns
the corresponding NeuronType object
static bool cypress::SpikingUtils::rerun_fixed_number_trials ( Network network,
Backend backend,
Real  time,
size_t  n_trials = 3 
)
static

Tries to run the simulation on given backend several times if backend produces an unexpected error (needed for e.g. BrainScaleS).

Parameters
networknetwork object to simulate
backendtarget of the simulation
timesimulation time
n_trialsnumber of trials before giving up
Returns
true if simulation was succesful
template<typename T >
static std::vector<T> cypress::SpikingUtils::spike_time_binning ( const Real start,
const Real stop,
const size_t &  n_bins,
const std::vector< cypress::Real > &  spike_times 
)
inlinestatic

Calculate the number of spikes in given intervals (bins) of a single spike train. Size of bins is calculated from start, stop and the number of bins n_bins

Parameters
starttime for starting the binning. First bin is [start, start + bin_size]
stopend time of last bin
n_binsnumber of bins
spike_timesvector containing spike times as given by neuron.signals().data(0)
Returns
A vector with each entry representing a bin, containing the number of spikes that appeared in that bin
static std::vector<Real> cypress::SpikingUtils::spike_time_binning_TTFS ( const Real start,
const Real stop,
const size_t &  n_bins,
const std::vector< cypress::Real > &  spike_times 
)
static

Calculate the first spike in given intervals (bins) of a single spike train. Size of bins is calculated from start, stop and the number of bins n_bins

Parameters
starttime for starting the binning. First bin is [start, start + bin_size]
stopend time of last bin
n_binsnumber of bins
spike_timesvector containing spike times as given by neuron.signals().data(0)
Returns
A vector with each entry representing a bin, containing the first spike that appeared in that bin

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