SNABSuite
0.x
Spiking Neural Architecture Benchmark Suite
|
#include <mnist.hpp>
Public Member Functions | |
MnistSpikey (const std::string backend, size_t bench_index) | |
std::shared_ptr< SNABBase > | clone () override |
Virtual method cloning the SNAB without knowing which SNAB it is. More... | |
virtual cypress::Network & | build_netw (cypress::Network &netw) override |
Building the neural network for benchmarking. If you want to use an external network, you should use the first version of building (and the corresponding run function), for the member network use the second function. The implementation is contained in the first one. More... | |
virtual void | run_netw (cypress::Network &netw) override |
virtual std::vector< std::array< cypress::Real, 4 > > | evaluate () override |
This should contain the evaluation process and return the result in order of those in names(), types() and measures(). The array contains in this order: result, standard deviation, minimal value, maximal value. If these are not provided, use NaN() as entry. More... | |
cypress::Network & | build () |
Calls SNABBase::build_netw with the internal network. More... | |
void | run () |
Calls SNABBase::run_netw on the internal network. More... | |
const std::string | snab_name () const |
Returns the name of the current benchmark. More... | |
const std::vector< std::string > & | indicator_names () const |
Getter for SNABSSuite::m_indicator_names. More... | |
const std::vector< std::string > & | indicator_types () const |
Getter for SNABSSuite::m_indicator_types. More... | |
const std::vector< std::string > & | indicator_measures () const |
Getter for SNABSSuite::m_indicator_measures. More... | |
cypress::Json | evaluate_json () |
The result of evaluation() is converted into the format used by the HBP benchmark repository. More... | |
cypress::Json | get_config () const |
Getter for the config file. More... | |
void | set_config (cypress::Json json) |
Setting a new config file. Note that before building the new network you probably want to reset the network structure, because the old populations and results will not be deleted automatically. More... | |
void | reset_network () |
Reset the internal cypress network, therefore deleting all old populations. For example in several concurrent runs with different configurations. More... | |
bool | valid () const |
Returns the state of the m_valid flag. Simulation should not be executed when valid() returns false. More... | |
Protected Member Functions | |
size_t | create_deep_network (cypress::Network &netw, Real max_weight=0.0, Real max_pool_weight=0.0, Real pool_inhib_weight=0.0) |
Converts a prepared json to a network. More... | |
void | read_config () |
Read config from m_config. More... | |
cypress::Network & | build_netw_int (cypress::Network &netw) |
Build the network, maybe scale down image. More... | |
std::string | _debug_filename (const std::string append=std::string()) const |
Beginning of the filename of all debug data (including directories) More... | |
Protected Attributes | |
NeuronParameter | m_neuro_params |
std::string | m_neuron_type_str |
size_t | m_images |
size_t | m_batchsize |
cypress::Real | m_duration |
cypress::Real | m_max_freq |
cypress::Real | m_pause |
bool | m_poisson |
bool | m_train_data |
cypress::Real | m_max_weight |
cypress::Real | m_max_pool_weight |
cypress::Real | m_pool_inhib_weight |
cypress::Real | m_pool_delay |
std::vector< std::pair< std::vector< std::vector< Real > >, std::vector< uint16_t > > > | m_batch_data |
bool | m_batch_parallel = true |
std::vector< cypress::Network > | m_networks |
std::vector< cypress::PopulationBase > | m_label_pops |
std::string | m_dnn_file = "" |
bool | m_scaled_image = false |
std::shared_ptr< MNIST::MLPBase > | m_mlp |
cypress::Real | m_weights_scale_factor = 0.0 |
std::vector< cypress::Real > | m_conv_weights_scale_factors |
bool | m_count_spikes = false |
std::vector< cypress::PopulationBase > | m_all_pops |
cypress::Network | m_netw |
Internal spiking network which should be used by the SNAB. More... | |
cypress::Json | m_config_file |
Platform specific config file which is read in with the constructor. More... | |
std::string | m_backend |
String which contains the name of the simulation backend. More... | |
bool | m_valid = false |
Flag which tracks whether the SNAB can be executed on the backend This can be set in config file by setting the key "invalid" for the simulator. More... | |
const std::string | m_snab_name |
The name of the Benchmark/SNAB. More... | |
const std::vector< std::string > | m_indicator_names |
For formatting the output in the correct structure introduced in the SP9 Guidebook, the evaluation process needs the exact order of the names, types and measures of the results returned from the function SNABBase::evaluate(). indicator_names should be unique for the measurement and represent the idea behind the value. More... | |
const std::vector< std::string > | m_indicator_types |
indicator_types can be e.g. "quality", "performance", "energy
consumption". See also SNABBase::indicator_names. More... | |
const std::vector< std::string > | m_indicator_measures |
indicator_measures should be the "type of the measurement", or what has been measures, e.g. norm, p-value, time. See also SNABBase::indicator_names. More... | |
const std::vector< std::string > | m_indicator_units |
indicator_units should be the "unit of the measurement", therefore the unit of the value. More... | |
const size_t | m_bench_index |
A simple feed-forward network with densely connected layers. This network has 89x100x10 layout with images downscales by 3x3 average pooling and no inhibition
|
inline |
|
protectedinherited |
Beginning of the filename of all debug data (including directories)
|
inlineinherited |
Calls SNABBase::build_netw with the internal network.
Definition at line 77 of file snab_base.hpp.
|
overridevirtualinherited |
Building the neural network for benchmarking. If you want to use an external network, you should use the first version of building (and the corresponding run function), for the member network use the second function. The implementation is contained in the first one.
network | External network SNAB/benchmark will be constructed in |
Implements SNAB::SNABBase.
Reimplemented in SNAB::MnistITLLastLayer.
|
protectedinherited |
Build the network, maybe scale down image.
netw | cypress network |
|
inlineoverridevirtual |
Virtual method cloning the SNAB without knowing which SNAB it is.
Implements SNAB::SNABBase.
Definition at line 131 of file mnist.hpp.
|
protectedinherited |
Converts a prepared json to a network.
data | data of the network. The repo provides a python script to create a compatible json file |
netw | network object in which the deep network will be created |
|
overridevirtualinherited |
This should contain the evaluation process and return the result in order of those in names(), types() and measures(). The array contains in this order: result, standard deviation, minimal value, maximal value. If these are not provided, use NaN() as entry.
Implements SNAB::SNABBase.
Reimplemented in SNAB::MnistITLLastLayer.
|
inherited |
The result of evaluation() is converted into the format used by the HBP benchmark repository.
|
inlineinherited |
Getter for the config file.
Definition at line 154 of file snab_base.hpp.
|
inlineinherited |
Getter for SNABSSuite::m_indicator_measures.
Definition at line 128 of file snab_base.hpp.
|
inlineinherited |
Getter for SNABSSuite::m_indicator_names.
Definition at line 106 of file snab_base.hpp.
|
inlineinherited |
Getter for SNABSSuite::m_indicator_types.
Definition at line 117 of file snab_base.hpp.
|
protectedinherited |
Read config from m_config.
|
inlineinherited |
Reset the internal cypress network, therefore deleting all old populations. For example in several concurrent runs with different configurations.
Definition at line 170 of file snab_base.hpp.
|
inlineinherited |
Calls SNABBase::run_netw on the internal network.
Definition at line 91 of file snab_base.hpp.
|
overridevirtualinherited |
Execution of the benchmark on the simulation platform. Similar to the build function, the first function contains the implementation, while the second simply uses the first with member networks.
network | External network SNAB/benchmark will be constructed in |
Implements SNAB::SNABBase.
Reimplemented in SNAB::MnistITLLastLayer.
|
inlineinherited |
Setting a new config file. Note that before building the new network you probably want to reset the network structure, because the old populations and results will not be deleted automatically.
json | new config |
Definition at line 163 of file snab_base.hpp.
|
inlineinherited |
Returns the name of the current benchmark.
Definition at line 98 of file snab_base.hpp.
|
inlineinherited |
Returns the state of the m_valid flag. Simulation should not be executed when valid() returns false.
Definition at line 179 of file snab_base.hpp.
|
protectedinherited |
|
protectedinherited |
String which contains the name of the simulation backend.
Definition at line 210 of file snab_base.hpp.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Definition at line 260 of file snab_base.hpp.
|
protectedinherited |
Platform specific config file which is read in with the constructor.
Definition at line 204 of file snab_base.hpp.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
indicator_measures should be the "type of the measurement", or what has been measures, e.g. norm, p-value, time. See also SNABBase::indicator_names.
Definition at line 244 of file snab_base.hpp.
|
protectedinherited |
For formatting the output in the correct structure introduced in the SP9 Guidebook, the evaluation process needs the exact order of the names, types and measures of the results returned from the function SNABBase::evaluate(). indicator_names should be unique for the measurement and represent the idea behind the value.
Definition at line 231 of file snab_base.hpp.
|
protectedinherited |
indicator_types can be e.g. "quality", "performance", "energy consumption". See also SNABBase::indicator_names.
Definition at line 237 of file snab_base.hpp.
|
protectedinherited |
indicator_units should be the "unit of the measurement", therefore the unit of the value.
Definition at line 250 of file snab_base.hpp.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Internal spiking network which should be used by the SNAB.
Definition at line 197 of file snab_base.hpp.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
The name of the Benchmark/SNAB.
Definition at line 222 of file snab_base.hpp.
|
protectedinherited |
Flag which tracks whether the SNAB can be executed on the backend This can be set in config file by setting the key "invalid" for the simulator.
Definition at line 217 of file snab_base.hpp.
|
protectedinherited |