Cypress
1.0
C++ Spiking Neural Network Simulation Framework
|
#include <network.hpp>
Public Member Functions | |
Network ()=default | |
Network (const Network &)=default | |
Network (Network &&) noexcept=default | |
Network & | operator= (const Network &)=default |
Network & | operator= (Network &&)=default |
~Network ()=default | |
Network (const NetworkBase &network) | |
Network & | operator= (const NetworkBase &o) |
template<typename T > | |
std::vector< Population< T > > | populations (const std::string &name=std::string()) |
PopulationBase | population (const std::string &name=std::string()) |
template<typename T > | |
Population< T > | population (const std::string &name=std::string()) |
template<typename T > | |
Population< T > | create_population (size_t size, const typename T::Parameters ¶ms, const typename T::Signals &signals, const char *name="") |
template<typename T > | |
Population< T > | create_population (size_t size, const typename T::Parameters ¶ms=typename T::Parameters(), const char *name="") |
template<typename T > | |
Network & | add_population (const char *name, size_t size, const typename T::Parameters ¶ms, const typename T::Signals &signals=typename T::Signals()) |
template<typename Source , typename Target > | |
Network & | add_connection (const Source &source, const Target &target, std::unique_ptr< Connector > connector, const char *name="") |
Network & | run (const Backend &backend, Real duration=0.0) |
Network & | run (const std::string &backend_id, Real duration=0.0, int argc=0, const char *argv[]=nullptr) |
Logger & | logger () const |
void | logger (Logger &logger) |
std::shared_ptr< PopulationData > | population_data (PopulationIndex pid) |
std::shared_ptr< const PopulationData > | population_data (PopulationIndex pid) const |
bool | operator== (const NetworkBase &o) const |
bool | operator!= (const NetworkBase &o) const |
NetworkBase | clone () const |
size_t | population_count () const |
size_t | population_count (const NeuronType &type) const |
template<typename T > | |
size_t | population_count () const |
size_t | neuron_count () const |
size_t | neuron_count (const NeuronType &type) const |
template<typename T > | |
size_t | neuron_count () const |
PopulationBase | population (PopulationIndex pid) |
const PopulationBase | population (PopulationIndex pid) const |
PopulationBase | operator[] (PopulationIndex pid) |
const PopulationBase | operator[] (PopulationIndex pid) const |
const std::vector< PopulationBase > | populations (const std::string &name=std::string(), const NeuronType &type=NullNeuron::inst()) const |
const std::vector< PopulationBase > | populations (const NeuronType &type) const |
const std::vector< ConnectionDescriptor > & | connections () const |
const ConnectionDescriptor & | connection (std::string name) const |
void | update_connection (std::unique_ptr< Connector > connector, const char *name) |
bool | use_lossy_trafos () const |
void | use_lossy_trafos (bool use_lossy) const |
const std::unordered_set< std::string > & | disabled_trafo_ids () const |
std::unordered_set< std::string > & | disabled_trafo_ids () |
Real | duration () const |
NetworkRuntime | runtime () const |
void | runtime (const NetworkRuntime &runtime) |
Static Public Member Functions | |
static std::unique_ptr< Backend > | make_backend (std::string backend_id, int argc=0, const char *argv[]=nullptr, Json setup=Json()) |
Protected Member Functions | |
void | connect (PopulationIndex pid_src, NeuronIndex nid_src0, NeuronIndex nid_src1, PopulationIndex pid_tar, NeuronIndex nid_tar0, NeuronIndex nid_tar1, std::unique_ptr< Connector > connector, const char *name="") |
PopulationIndex | create_population_index (size_t size, const NeuronType &type, const NeuronParameters ¶ms, const NeuronSignals &signals, const std::string &name) |
Friends | |
template<typename T > | |
class | Population |
Class representing the entire spiking neural network.
|
default |
|
default |
|
defaultnoexcept |
|
default |
|
inline |
Allow creation of a network instance from a NetworkBase instance.
|
inline |
|
inline |
|
inherited |
Creates and returns a copy of the network.
|
protectedinherited |
Base connection method. Connects a range of neurons in the source population to a range of neurons in the target population. All connection methods in ConnectableMixin are relayed to this method.
pid_src | is the index of the source population. |
nid_src0 | is the index of the first neuron in this population that is going to be connected. |
nid_src1 | is the index of the last-plus-one neuron in this population being connected. |
pid_tar | is the index of the target population. |
nid_tar0 | is the index of the first neuron in the target population that is going to be connected. |
nid_tar1 | is the index of the last-plus-one neuron in the target population that is going to be connected. |
connector | is a connector which is used to construct the actual neuron-to-neuron connections on demand. |
|
inherited |
Returns a a reference at ConnectionDescriptor instances with name, describing the connection between the individual populations.
|
inherited |
Returns a a reference at a list of ConnectionDescriptor instances, describing the connections between the individual populations.
|
inline |
|
inline |
|
protectedinherited |
Internally used to add a new population. Use the templated public create_population method in the Network class instead.
size | is the number of neurons in the population. |
type | is the type of the neurons in the population. |
params | contains the initial neuron parameters. The parameters may be a list of neuron parameters, in which case the size of the list must be equal to the size of the population. |
signals | contains the initial flags describing which signals should be recorded. The signals object may contain a list of signal instances, in which case the size of the list must be equal to the size of the population. |
name | is the name of the population. |
|
inherited |
Returns the list of currently disabled transformation ids.
|
inherited |
Returns the list of currently disabled transformation ids.
|
inherited |
Returns the duration of the network. The duration is defined as the last spike stored in a SpikeSourceArray.
|
inherited |
Returns the logger that should be used to log messages related to this network. The "global_logger()" is used per default.
|
inherited |
Sets a new logger that should be used to log messages related to this network.
|
staticinherited |
Returns the backend instance for the given backend string. The backend string may be one of the following:
backend_id | is the id of the backend that should be created. |
argc | is the number of command line arguments. Needed when the NMPI backend should be used. |
argv | is the array containing the command line arguments. Needed when the NMPI backend should be used. |
setup | is an optional Json object which contains backend configuration. |
|
inherited |
Returns the total number of neurons in the network.
|
inherited |
Returns the number of neurons of a given type.
|
inlineinherited |
Returns the number of neurons of a certain neuron type.
|
inlineinherited |
Compares whether two NetworkBase instances point at different underlying network instances.
|
inline |
Allow assigning a NetworkBase instance to a Network instance.
|
inlineinherited |
Compares whether two NetworkBase instances point at the same underlying network.
|
inherited |
|
inherited |
|
inherited |
Returns a PopulationBase instance pointing at the population with the given index.
|
inherited |
|
inline |
Returns a PopulationBase object pointing at the last created population with the given name. If no such population exists, an exception is thrown.
T | is the neuron type of the population that should be returned. |
name | is the name of the population that should be looked up. If empty, the last created population of the given type is returned. |
|
inline |
Returns a Population object pointing at the last created population with the given name. If no such population exists, an exception is thrown.
T | is the neuron type of the population that should be returned. |
name | is the name of the population that should be looked up. If empty, the last created population of the given type is returned. |
|
inherited |
Returns the number of created populations.
|
inherited |
Returns the number of populations of a certain neuron type.
|
inlineinherited |
Returns the number of populations of a certain neuron type.
|
inherited |
Returns the raw population data associated with the given population index. Try to avoid using this function directly. Proper use cases are network transformations.
pid | is the index of the population for which a reference at the internal data should be returned. |
|
inherited |
Returns the raw population data associated with the given population index. Try to avoid using this function directly. Proper use cases are network transformations.
pid | is the index of the population for which a reference at the internal data should be returned. |
|
inherited |
Returns a list of populations available in the network, filtered by the given name and type.
name | is the name the returned populations should be filtered by. If an empty string is given, no filtering is performed (default). |
type | is the neuron type the list should be filtered for. If a pointer at the special NullNeuron instance is given, no filtering by type is performed (default). |
|
inherited |
Returns a list of populations filtered by the given neuron type.
type | is the neuron type the list should be filtered for. If a pointer at the special NullNeuron instance is given, no filtering by type is performed (default). |
|
inline |
Returns population objects pointing at the population with the given name.
T | is the neuron type of the population that should be returned. |
name | is the name of the population that is being searched for. If empty, all populations are matched. |
Executes the network on the given backend and stores the results in the population objects. This function is simply a wrapper for Backend.run(). If there is an error during execution, the run function will throw a exception.
backend | is a reference at the backend instance the network should be executed on. |
duration | is the simulation-time. If a value smaller or equal to zero is given, the simulation time is automatically chosen. |
|
inline |
Executes the network on the given backend and stores the results in the population objects. This function is simply a wrapper for Backend.run(). If there is an error during execution, the run function will throw a exception. The backend string may be one of the following:
backend_id | is a string describing the backend instance. See make_backend() for more information on available backend strings. |
argc | is the number of command line arguments. Needed when the NMPI backend should be used. |
argv | is the array containing the command line arguments. Needed when the NMPI backend should be used. |
duration | is the simulation-time. If a value smaller or equal to zero is given, the simulation time is automatically chosen. |
|
inherited |
Returns information about the network runtime. Behaviour is undefined if the network has not yet been executed.
|
inherited |
Allows to set the runtime information to the given values.
|
inherited |
Change the connector from an existing connection.
connector | The new connector |
name | Name tag of the target connection |
|
inherited |
Returns the state of the "use_lossy_trafos" flag. If true, applies possibly lossy transformations to the network in order to run it on the target platform. The default value is "true".
|
inherited |
Sets the "use_lossy_trafos" flag. If true, allows to apply lossy transformations to allow running a network on the target platform. The defautl value is "true".
|
friend |