Cypress
1.0
C++ Spiking Neural Network Simulation Framework
|
#include <to_json.hpp>
Public Member Functions | |
ToJson (const std::string &simulator, const Json &setup=Json()) | |
~ToJson () override | |
std::unordered_set< const NeuronType * > | supported_neuron_types () const override |
std::string | name () const override |
void | run (NetworkBase &network, Real duration=0.0) const |
Static Public Member Functions | |
static std::vector< bool > | inhom_rec_single (const PopulationBase &pop, size_t index) |
returns a vector encoding recording flags for a single recording signal and inhomogeneous record flags More... | |
static Json | inhom_rec_to_json (const PopulationBase &pop) |
returns a json encoding all records for a single population. Json[<signal>] will return a vector of bool flags encoding, wheter <signal> will be recorded for that specific neuron More... | |
static Json | connector_to_json (const ConnectionDescriptor &conn) |
Converts the information of a ConnectionDescriptor to a JSON object. List connectors and dynamic connection strategies that cannot be reproduced by a new simulation will be expanded to list connections. More... | |
static Json | pop_to_json (const PopulationBase &pop) |
Creates a Json containing information about a population. More... | |
static void | hom_rec_to_json (const PopulationBase &pop, Json &json) |
Takes a Json object created by pop_to_json and adds information about record flags, assumes record flags are homogeneous. More... | |
static Json | pop_vec_to_json (const std::vector< PopulationBase > &pops) |
Creates an array of populations in return json, which contains all information of all populations, including record flags and parameters. More... | |
static Json | recs_to_json (const PopulationBase &pop) |
Converts all recorded data of a population to json. More... | |
static void | read_recordings_from_json (const Json &pop_data, NetworkBase &netw) |
Reads recorded signal from a json object, puts data into network object. More... | |
static void | create_pop_from_json (const Json &pop_json, Network &netw) |
Uses data in JSon to create populations and set record flags. More... | |
static std::shared_ptr< SynapseBase > | get_synapse (const std::string &name, const std::vector< Real > ¶meters) |
Create the synapse for a connection dependent on the name. More... | |
static void | create_conn_from_json (const Json &con_json, Network &netw) |
Uses the information in JSON to create a single Connection. More... | |
static NetworkBase | network_from_json (std::string path) |
Uses the data in a JSON object to create a full network. More... | |
static void | learned_weights_from_json (const Json &json, NetworkBase netw) |
Protected Member Functions | |
void | do_run (NetworkBase &network, Real duration) const override |
Json | output_json (NetworkBase &network, Real duration) const |
void | read_json (Json &result, NetworkBase &network) const |
Protected Attributes | |
std::string | m_simulator |
Json | m_setup |
bool | m_save_json = false |
bool | m_no_output = false |
std::string | m_path |
std::string | m_json_path |
The Backend class is an abstract base class which provides the facilities for network execution.
Constructor of the ToJson backend. If setup sets "save_json" : true, all simulation related data will be written to HDD. "m_no_output" : true discards all output from the simulator
simulator | is the name of the simulator backend to be used |
setup | contains additional setup information that should be passed to the backend. |
|
override |
Destructor of the ToJson class.
|
static |
Converts the information of a ConnectionDescriptor to a JSON object. List connectors and dynamic connection strategies that cannot be reproduced by a new simulation will be expanded to list connections.
conn | source connections description |
Uses the information in JSON to create a single Connection.
con_json | JSON object containing the Connection data |
netw | target network of the connection |
Uses data in JSon to create populations and set record flags.
pop_json | contains population data |
netw | network object in which the population will be created |
|
overrideprotectedvirtual |
Abstract method which has to be implemented by the backend.
Implements cypress::Backend.
|
static |
Create the synapse for a connection dependent on the name.
name | name of the synapse model |
parameters | Synapse Parameters, should be in the right order |
|
static |
Takes a Json object created by pop_to_json and adds information about record flags, assumes record flags are homogeneous.
pop | source population object |
json | target json created by ToJson::pop_to_json |
|
static |
returns a vector encoding recording flags for a single recording signal and inhomogeneous record flags
pop | Source Population |
index | Recording signal index |
|
static |
returns a json encoding all records for a single population. Json[<signal>] will return a vector of bool flags encoding, wheter <signal> will be recorded for that specific neuron
pop | source population object |
|
static |
|
overridevirtual |
Returns the canonical name of the backend.
Implements cypress::Backend.
|
static |
Uses the data in a JSON object to create a full network.
path | path of the JSON file |
|
protected |
|
static |
Creates a Json containing information about a population.
pop | source population |
|
static |
Creates an array of populations in return json, which contains all information of all populations, including record flags and parameters.
pops | vector of population objects, typically netw.populations() |
|
protected |
|
static |
Reads recorded signal from a json object, puts data into network object.
pop_data | source simulation data, should be on level of a single recording |
netw | target network |
|
static |
Converts all recorded data of a population to json.
pop | source population for recorded data |
|
inherited |
Simulates the given spiking neural network for the given duration.
network | is the network that should be simulated. The simulation result will be written to the network instance. |
duration | is the duration for which the network should be simulated. |
|
overridevirtual |
Returns a set of neuron types which are supported by this backend. Trying to execute a network with other neurons than the ones specified in the result of this function will result in an exception.
Implements cypress::Backend.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |