SNABSuite  0.x
Spiking Neural Architecture Benchmark Suite
max_inter_neuron.hpp
Go to the documentation of this file.
1 /*
2  * SNABSuite - Spiking Neural Architecture Benchmark Suite
3  * Copyright (C) 2016 Christoph Jenzen
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #ifndef SNABSUITE_SNABS_MAX_INTER_NEURON_HPP
22 #define SNABSUITE_SNABS_MAX_INTER_NEURON_HPP
23 
24 #include <cypress/cypress.hpp>
25 
26 #include "common/snab_base.hpp"
27 
28 namespace SNAB {
29 using cypress::NeuronParameter;
39 private:
40  cypress::PopulationBase m_pop_single, m_pop_group;
41  cypress::Real m_simulation_length = 150; // ms
42  cypress::Real m_start_time = 50; // ms
43  NeuronParameter m_group_params;
44 
45 public:
46  SingleMaxFreqToGroup(const std::string backend, size_t bench_index);
47  cypress::Network &build_netw(cypress::Network &netw) override;
48  void run_netw(cypress::Network &netw) override;
49  std::vector<std::array<cypress::Real, 4>> evaluate() override;
50  std::shared_ptr<SNABBase> clone() override
51  {
52  return std::make_shared<SingleMaxFreqToGroup>(m_backend, m_bench_index);
53  }
54 };
55 
62 class GroupMaxFreqToGroup : public SNABBase {
63 protected:
64  cypress::PopulationBase m_pop_max, m_pop_retr;
65  cypress::Real m_simulation_length = 150; // ms
66  cypress::Real m_start_time = 50; // ms
67  NeuronParameter m_retr_params;
68 
73  GroupMaxFreqToGroup(std::string name, std::string backend,
74  std::initializer_list<std::string> indicator_names,
75  std::initializer_list<std::string> indicator_types,
76  std::initializer_list<std::string> indicator_measures,
77  std::initializer_list<std::string> indicator_units,
78  std::initializer_list<std::string> required_parameters,
79  size_t bench_index);
80 
81 public:
82  GroupMaxFreqToGroup(const std::string backend, size_t bench_index);
83  cypress::Network &build_netw(cypress::Network &netw) override;
84  void run_netw(cypress::Network &netw) override;
85  std::vector<std::array<cypress::Real, 4>> evaluate() override;
86  virtual std::shared_ptr<SNABBase> clone() override
87  {
88  return std::make_shared<GroupMaxFreqToGroup>(m_backend, m_bench_index);
89  }
90 };
91 
97 public:
98  GroupMaxFreqToGroupAllToAll(const std::string backend, size_t bench_index);
99  cypress::Network &build_netw(cypress::Network &netw) override;
100 
101  std::shared_ptr<SNABBase> clone() override
102  {
103  return std::make_shared<GroupMaxFreqToGroupAllToAll>(m_backend,
104  m_bench_index);
105  }
106 };
107 
113 public:
114  GroupMaxFreqToGroupProb(const std::string backend, size_t bench_index);
115  cypress::Network &build_netw(cypress::Network &netw) override;
116  std::shared_ptr<SNABBase> clone() override
117  {
118  return std::make_shared<GroupMaxFreqToGroupProb>(m_backend,
119  m_bench_index);
120  }
121 };
122 } // namespace SNAB
123 
124 #endif /* SNABSUITE_SNABS_MAX_INTER_NEURON_HPP */
std::shared_ptr< SNABBase > clone() override
Virtual method cloning the SNAB without knowing which SNAB it is.
std::shared_ptr< SNABBase > clone() override
Virtual method cloning the SNAB without knowing which SNAB it is.
std::string m_backend
String which contains the name of the simulation backend.
Definition: snab_base.hpp:210
SingleMaxFreqToGroup(const std::string backend, size_t bench_index)
Virtual Base class for SNABs(Benchmarks). All SNABs should have seperate building of networks...
Definition: snab_base.hpp:33
void run_netw(cypress::Network &netw) override
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.
virtual std::shared_ptr< SNABBase > clone() override
Virtual method cloning the SNAB without knowing which SNAB it is.
const std::vector< std::string > & indicator_measures() const
Getter for SNABSSuite::m_indicator_measures.
Definition: snab_base.hpp:128
const std::vector< std::string > & indicator_names() const
Getter for SNABSSuite::m_indicator_names.
Definition: snab_base.hpp:106
const std::vector< std::string > & indicator_types() const
Getter for SNABSSuite::m_indicator_types.
Definition: snab_base.hpp:117
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()...
const size_t m_bench_index
Definition: snab_base.hpp:260
std::shared_ptr< SNABBase > clone() override
Virtual method cloning the SNAB without knowing which SNAB it is.
cypress::PopulationBase m_pop_retr