SNABSuite  0.x
Spiking Neural Architecture Benchmark Suite
refractory_period.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_REFRACTORY_PERIOD_HPP
22 #define SNABSUITE_SNABS_REFRACTORY_PERIOD_HPP
23 
24 #include <cypress/cypress.hpp>
25 
26 #include "common/snab_base.hpp"
27 
28 namespace SNAB {
35 class RefractoryPeriod : public SNABBase {
36 private:
37  cypress::PopulationBase m_pop;
38  cypress::Real m_tolerance = 1.0;
39  cypress::Population<cypress::SpikeSourceArray> m_pop_source;
40  cypress::NeuronParameter m_neuro_params;
41 
42 public:
43  RefractoryPeriod(const std::string backend, size_t bench_index);
44  cypress::Network &build_netw(cypress::Network &netw) override;
45  void run_netw(cypress::Network &netw) override;
46  std::vector<std::array<cypress::Real, 4>> evaluate() override;
47  std::shared_ptr<SNABBase> clone() override
48  {
49  return std::make_shared<RefractoryPeriod>(m_backend, m_bench_index);
50  }
51 };
52 } // namespace SNAB
53 
54 #endif /* SNABSUITE_SNABS_REFRACTORY_PERIOD_HPP*/
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
void run_netw(cypress::Network &netw) override
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()...
Virtual Base class for SNABs(Benchmarks). All SNABs should have seperate building of networks...
Definition: snab_base.hpp:33
RefractoryPeriod(const std::string backend, size_t bench_index)
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.
const size_t m_bench_index
Definition: snab_base.hpp:260