-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpaper_figures.cpp
More file actions
108 lines (97 loc) · 2.69 KB
/
paper_figures.cpp
File metadata and controls
108 lines (97 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#include "LIF_spike.h"
using namespace std;
void fig_2mu_comps(const parameters_t& XIF_params, string neuron_model,
double subplot, int loop_iteration, int num_neurons=100)
{
LIF_spike S(num_neurons);
if(loop_iteration < 0 || loop_iteration > 10) {
cout << "Not a valid loop number!" << endl;
exit(0);
}
int lower_loop=loop_iteration*10;
int upper_loop=loop_iteration*10+10;
stringstream ss;
ss << num_neurons;
for(int i=lower_loop; i<upper_loop; ++i)
{
S.seed_ran_gen(i+9872349);
S.create_XIF_data(XIF_params.gamma,
XIF_params.lambda,
XIF_params.sigma,
neuron_model);
S.print_statistics_to_file("fig_2mu_"+ss.str()+"_",
subplot,loop_iteration,i,num_neurons);
S.zero_LIF_data();
}
}
void paper_fig_2_const_mu(double subplot, std::string neuron_model, int loop_iteration,
int num_neurons)
{
double sigma_LIF = 6.23;
if(subplot == 0.05) {
if(neuron_model == "EIF") {
parameters_t LIF_params = {-60,0.17,sigma_LIF,0,0};
fig_2mu_comps(LIF_params,neuron_model,subplot,
loop_iteration,num_neurons);
}
}
else if(subplot == 0.1) {
if(neuron_model == "EIF") {
parameters_t LIF_params = {-60,0.305,sigma_LIF,0,0};
fig_2mu_comps(LIF_params,neuron_model,subplot,
loop_iteration,num_neurons);
}
}
else if(subplot == 0.25) {
if(neuron_model == "EIF") {
parameters_t LIF_params = {-60.02,0.599,sigma_LIF,0,0};
fig_2mu_comps(LIF_params,neuron_model,subplot,
loop_iteration,num_neurons);
}
}
else {
cout << "Not a valid subplot value!" << endl;
}
}
void paper_fig_2_const_rho(double subplot, std::string neuron_model, int loop_iteration,
int num_neurons)
{
double sigma_LIF = 6.23;
if(subplot == 0.1) {
if(neuron_model == "EIF") {
parameters_t LIF_params = {-60,0.305,sigma_LIF,0,0};
fig_2mu_comps(LIF_params,neuron_model,subplot,
loop_iteration,num_neurons);
}
}
else if(subplot == 0.2) {
if(neuron_model == "EIF") {
parameters_t LIF_params = {-58.21,0.256,sigma_LIF,0,0};
fig_2mu_comps(LIF_params,neuron_model,subplot,
loop_iteration,num_neurons);
}
}
else if(subplot == 0.3) {
if(neuron_model == "EIF") {
parameters_t LIF_params = {-56.8,0.237,sigma_LIF,0,0};
fig_2mu_comps(LIF_params,neuron_model,subplot,
loop_iteration,num_neurons);
}
}
else {
cout << "Not a valid subplot value!" << endl;
}
}
void paper_figure_control(string figure_name, double subplot, string neuron_model,
int loop_iteration, int num_neurons)
{
if(figure_name == "paper2mu") {
paper_fig_2_const_mu(subplot,neuron_model,loop_iteration,num_neurons);
}
else if(figure_name == "paper2rho") {
paper_fig_2_const_rho(subplot,neuron_model,loop_iteration,num_neurons);
}
else {
cout << "Not a valid figure name!" << endl;
}
}