GeNN
2.2.3
GPU enhanced Neuronal Networks (GeNN)
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
simulation_synapse_policy_none.h
Go to the documentation of this file.
1
#pragma once
2
3
// Standard includes
4
#include <numeric>
5
6
//----------------------------------------------------------------------------
7
// SimulationSynapsePolicyNone
8
//----------------------------------------------------------------------------
9
class
SimulationSynapsePolicyNone
10
{
11
public
:
12
//----------------------------------------------------------------------------
13
// Public API
14
//----------------------------------------------------------------------------
15
void
Init
()
16
{
17
}
18
19
template
<
typename
UpdateFn,
typename
StepGeNNFn>
20
float
Simulate
(UpdateFn updateFn, StepGeNNFn stepGeNNFn)
21
{
22
float
err = 0.0f;
23
inputpre = 0.0f;
24
for
(
int
i = 0; i < (int)(20.0f /
DT
); i++)
25
{
26
// **YUCK** update global time - this shouldn't be user responsibility
27
t = i *
DT
;
28
29
// for all pre-synaptic neurons
30
float
x[10];
31
for
(
int
j = 0; j < 10; j++)
32
{
33
// generate expected values
34
float
newX;
35
if
(updateFn(i, j, t, newX))
36
{
37
x[j]= newX;
38
}
39
else
40
{
41
x[j] = 0.0f;
42
}
43
}
44
45
// Add error for this time step to total
46
err += std::inner_product(&x[0], &x[10],
47
&xpre[glbSpkShiftpre],
48
0.0f,
49
std::plus<float>(),
50
[](
float
a,
float
b){
return
abs(a - b); });
51
52
// Update global
53
inputpre = pow(t, 2.0);
54
55
// Step GeNN kernel
56
stepGeNNFn();
57
}
58
59
return
err;
60
}
61
};
SimulationSynapsePolicyNone::Simulate
float Simulate(UpdateFn updateFn, StepGeNNFn stepGeNNFn)
Definition:
simulation_synapse_policy_none.h:20
DT
#define DT
This defines the global time step at which the simulation will run.
Definition:
HHVclampGA_project/model/MBody1.cc:21
SimulationSynapsePolicyNone
Definition:
simulation_synapse_policy_none.h:9
SimulationSynapsePolicyNone::Init
void Init()
Definition:
simulation_synapse_policy_none.h:15
tests
utils
simulation_synapse_policy_none.h
Generated on Tue May 30 2017 12:01:09 for GeNN by
1.8.11