-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathH_binned_nDin_circuits.m
114 lines (80 loc) · 4.08 KB
/
H_binned_nDin_circuits.m
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
109
110
111
112
113
% binned H metrics for nDin circuits, scaled and unscaled subunit weights
clearvars
addpath(genpath('/home/ellag9/matlab_funcs'))
sig_s = 10;
sig_n = 0;
sig_m = 0;
sdims = 1:25; %1:40; %[1,2,5,10,25,50];
linthrs = [-inf,-inf];
reluthrs = [0,0];
linout = 'linear';
reluout = 'relu';
cgout = 'cg';
%% discrete numerics set up (binned)
Nstim = 1e6; %no need for tailored Nstim since no noise
bw = 0.25; %sig_s*(1e-3); %*sqrt(sdim);
runs = 10; %6;
savestr = ['H_binned_nDin_sigs' num2str(sig_s) '_sqsc_cg_relu_out_4Sep20.mat'];
%% nDin, 1Dout scaled subunits
rdim = 1;
Hr_linsubs_linout_nDin_1Dout_sqsc = zeros(size(sdims));
Hr_linsubs_nlout_nDin_1Dout_sqsc = zeros(size(sdims));
Hr_nlsubs_nlout_nDin_1Dout_sqsc = zeros(size(sdims));
sdHru_linsubs_linout_nDin_1Dout_sqsc = zeros(size(sdims));
sdHru_linsubs_nlout_nDin_1Dout_sqsc = zeros(size(sdims));
sdHru_nlsubs_nlout_nDin_1Dout_sqsc = zeros(size(sdims));
for i = 1:length(sdims)
sdim = sdims(i);
[Hr_linsubs_linout_nDin_1Dout_sqsc(i),sdHru_linsubs_linout_nDin_1Dout_sqsc(i)] = binnedHr_threshs(sdim,rdim,linthrs,sig_s,sig_n,sig_m,Nstim,bw,runs,linout,linthrs);
[Hr_linsubs_nlout_nDin_1Dout_sqsc(i),sdHru_linsubs_nlout_nDin_1Dout_sqsc(i)] = binnedHr_threshs(sdim,rdim,linthrs,sig_s,sig_n,sig_m,Nstim,bw,runs,reluout,reluthrs);
[Hr_nlsubs_nlout_nDin_1Dout_sqsc(i),sdHru_nlsubs_nlout_nDin_1Dout_sqsc(i)] = binnedHr_threshs(sdim,rdim,reluthrs,sig_s,sig_n,sig_m,Nstim,bw,runs,reluout,reluthrs);
end
save(savestr)
%% shuts down the parallel pool so that it can start afresh for the next block
poolobj = gcp('nocreate');
delete(poolobj);
%% nDin, 1Dout scaled subunits CG out
rdim = 1;
Hr_linsubs_cgout_nDin_1Dout_sqsc = zeros(size(sdims));
Hr_nlsubs_cgout_nDin_1Dout_sqsc = zeros(size(sdims));
sdHru_linsubs_cgout_nDin_1Dout_sqsc = zeros(size(sdims));
sdHru_nlsubs_cgout_nDin_1Dout_sqsc = zeros(size(sdims));
for i = 1:length(sdims)
sdim = sdims(i);
[Hr_linsubs_cgout_nDin_1Dout_sqsc(i),sdHru_linsubs_cgout_nDin_1Dout_sqsc(i)] = binnedHr_threshs(sdim,rdim,linthrs,sig_s,sig_n,sig_m,Nstim,bw,runs,cgout,linthrs);
[Hr_nlsubs_cgout_nDin_1Dout_sqsc(i),sdHru_nlsubs_cgout_nDin_1Dout_sqsc(i)] = binnedHr_threshs(sdim,rdim,reluthrs,sig_s,sig_n,sig_m,Nstim,bw,runs,cgout,linthrs);
end
save(savestr)
%% shuts down the parallel pool so that it can start afresh for the next block
poolobj = gcp('nocreate');
delete(poolobj);
%% nDin, 2Dout scaled subunits
rdim = 2;
Hr_linsubs_linout_nDin_2Dout_sqsc = zeros(size(sdims));
Hr_linsubs_nlout_nDin_2Dout_sqsc = zeros(size(sdims));
Hr_nlsubs_nlout_nDin_2Dout_sqsc = zeros(size(sdims));
sdHru_linsubs_linout_nDin_2Dout_sqsc = zeros(size(sdims));
sdHru_linsubs_nlout_nDin_2Dout_sqsc = zeros(size(sdims));
sdHru_nlsubs_nlout_nDin_2Dout_sqsc = zeros(size(sdims));
for i = 1:length(sdims)
sdim = sdims(i);
[Hr_linsubs_linout_nDin_2Dout_sqsc(i),sdHru_linsubs_linout_nDin_2Dout_sqsc(i)] = binnedHr_threshs(sdim,rdim,linthrs,sig_s,sig_n,sig_m,Nstim,bw,runs,linout,linthrs);
[Hr_linsubs_nlout_nDin_2Dout_sqsc(i),sdHru_linsubs_nlout_nDin_2Dout_sqsc(i)] = binnedHr_threshs(sdim,rdim,linthrs,sig_s,sig_n,sig_m,Nstim,bw,runs,reluout,reluthrs);
[Hr_nlsubs_nlout_nDin_2Dout_sqsc(i),sdHru_nlsubs_nlout_nDin_2Dout_sqsc(i)] = binnedHr_threshs(sdim,rdim,reluthrs,sig_s,sig_n,sig_m,Nstim,bw,runs,reluout,reluthrs);
end
save(savestr)
%% shuts down the parallel pool so that it can start afresh for the next block
poolobj = gcp('nocreate');
delete(poolobj);
%% nDin, 2Dout scaled subunits CG out
rdim = 2;
Hr_linsubs_cgout_nDin_2Dout_sqsc = zeros(size(sdims));
Hr_nlsubs_cgout_nDin_2Dout_sqsc = zeros(size(sdims));
sdHru_linsubs_cgout_nDin_2Dout_sqsc = zeros(size(sdims));
sdHru_nlsubs_cgout_nDin_2Dout_sqsc = zeros(size(sdims));
for i = 1:length(sdims)
sdim = sdims(i);
[Hr_linsubs_cgout_nDin_2Dout_sqsc(i),sdHru_linsubs_cgout_nDin_2Dout_sqsc(i)] = binnedHr_threshs(sdim,rdim,linthrs,sig_s,sig_n,sig_m,Nstim,bw,runs,cgout,linthrs);
[Hr_nlsubs_cgout_nDin_2Dout_sqsc(i),sdHru_nlsubs_cgout_nDin_2Dout_sqsc(i)] = binnedHr_threshs(sdim,rdim,reluthrs,sig_s,sig_n,sig_m,Nstim,bw,runs,cgout,linthrs);
end
save(savestr)