-
Notifications
You must be signed in to change notification settings - Fork 0
/
ORIENT_TRN.m
275 lines (216 loc) · 11.8 KB
/
ORIENT_TRN.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
%*************************************************************************%
% %
% ORIENT %
% %
%*************************************************************************%
% CONTAINS:
% Retina
% Superior Colliculus (SC)
% FEF Basal Ganglia loop (BG subsystem)
% Saccadic Generator (SG)
% Frontal Eye Fields (FEF)
% On the sizes of locs:
% locs will either be of dimensions 1x1 - with the sigma projections
% required specified by number of neurons x scaling factor, or locs = dims
% and sigma represents number of neurons.
% Notes on the configuration parameters...
% and some working settings:
STN_IN = 0.55; %0.63 (PUSH) This relates to the rate at which the damping of the Basal Ganglia
% on the gain in FEF increases with the overall activation of FEF, thus changing the
% total activation permitted in FEF - affects STN input.
GPE2STN = 1.0; % 0.8 Lower values mean slower integration, but better selection
STN2GPE = 1.0;
PUSH_PULL_RATIO = 0.37; % This is the ratio between 'push' (as above) and 'pull' -
% the strength of the winning stimulus to resist damping. Too much pull
% will result in excessive suppression of SNr. Affects D1 -> SNr and D2 ->
% GPe connections.
CAP_LEVEL = 1.0;%2.3; % Affects the rate of stimulus integration and, SNr -> Thalamus
FEF_2_THAL_RATIO = 2.0;
LOOP_GAIN = 1.0; % ...of FEF THAL loop
DIFFUSE_NORM = 0.02 / (layerDims(1)*layerDims(2)) * (layerLocs(1) * layerLocs(2)); % Scaling for adjusting STN diffuse projection normalisation.
% Affect bloom in SC
SC_BUILDUP_RECIP = 0.3;%2.8
SC_SNR_DAMPING = 3.0;
% Add subsystem
orient = sml_system('orient');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ADD NEURAL LAYERS %%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
outpars = defParsOut;
actpars = defParsAct;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RETINA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
orient = nw_modAddPop(orient, 'retina_1', fS, [In_dims], {[layerLocs]}, [p2a 'leaky'], actpars, [p2o 'linear'], outpars);
orient = nw_modAddPop(orient, 'retina_2', fS, [In_dims], {[In_locs]},[p2a 'leaky'], actpars, [p2o 'linear'], outpars);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
orient= nw_modAddPop(orient, 'SC_sup', fS, [layerDims], {[layerLocs]}, [p2a 'leaky'], actpars, [p2o 'tanh'], outpars);
orient= nw_modAddPop(orient, 'SC_buildup', fS, [layerDims], {[layerLocs]}, [p2a 'leaky'], actpars, [p2o 'tanh'], outpars);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FEF etc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
orient = nw_modAddPop(orient, 'FEF', fS, [layerDims], {[layerLocs]}, [p2a 'leaky'], actpars, [p2o 'linear'], outpars);
orient = nw_modAddPop(orient, 'THAL', fS, [layerDims], {[layerLocs]}, [p2a 'leaky'], actpars, [p2o 'tanh'], outpars);
orient = nw_modAddPop(orient, 'TRN', fS, [layerDims], {[layerLocs]}, [p2a 'leaky'], actpars, [p2o 'tanh'], outpars);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BG %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BG = sml_system('BG');
% dopamine source
state = [];
state.data = DAData;
state.repeat = true;
state.ndims = 1;
BG = BG.addprocess('DA', 'dev\std\source\numeric', fS, state);
outpars.c = 0.2;
BG = nw_modAddPop(BG, 'STR_D1', fS, [layerDims], {[layerLocs]}, [p2a 'leaky'], actpars, [p2o 'linear'], outpars);
BG = nw_modAddPop(BG, 'STR_D2', fS, [layerDims], {[layerLocs]}, [p2a 'leaky'], actpars, [p2o 'linear'], outpars);
outpars.c = -0.10;
actpars.neg_reversal_potential = -0.5;
actpars.tau_membrane = 0.02;
BG = nw_modAddPop(BG, 'STN', fS, [layerDims], {[layerLocs]}, [p2a 'leaky'], actpars, [p2o 'exp'], outpars);
actpars.tau_membrane = 0.02;
outpars.c = -0.10;
BG = nw_modAddPop(BG, 'GPe', fS, [layerDims], {[layerLocs]}, [p2a 'leaky'], actpars, [p2o 'tanh'], outpars);
BG = nw_modAddPop(BG, 'SNr', fS, [layerDims], {[layerLocs]}, [p2a 'leaky'], actpars, [p2o 'linear'], outpars);
actpars.neg_reversal_potential = inf;
%%%%%%%%%%%%%%%%%%%%%%%%%%%% SACCADIC GENERATOR %%%%%%%%%%%%%%%%%%%%%%%%%%%
state = [];
state.xRange = pantilt_scale*In_dims(2);
state.yRange = pantilt_scale*In_dims(1);
state.threshold = 20*(layerDims(1)/layerLocs(1))*(layerDims(2)/layerLocs(2));
orient = orient.addprocess('SG', 'dev/abrg/2008/emSG', fS, state);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ADD PROJECTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RETINA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add intrinsic projections (see "help nw_addProj")
projState = [];
projState.delay = 0.0;
projState.norm='affx'; %- confirm the modlin default
defParsProj = projState;
projState.delay = 0.01;
orient = nw_modAddProj(orient, fS, 'retina_2', 'retina_1', -6, [p2p 'onetoone'], projState, 'add');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
projState = defParsProj;
projState.sigma = 1.0; % number of neurons - orientlayers are locs = dims
orient = nw_modAddProj(orient, fS, 'SC_sup', 'SC_buildup', 0.1, [p2p 'gaussian'], projState, 'add');
orient = nw_modAddProj(orient, fS, 'SC_buildup', 'SC_buildup', SC_BUILDUP_RECIP, [p2p 'gaussian'], projState, 'add');%0.05
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FEF etc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
THAL_2_FEF_SCALAR = sqrt(LOOP_GAIN/FEF_2_THAL_RATIO);
FEF_2_THAL_SCALAR = LOOP_GAIN/THAL_2_FEF_SCALAR;
orient = nw_modAddProj(orient, fS, 'FEF', 'THAL', FEF_2_THAL_SCALAR, [p2p 'onetoone'], projState, 'add');
orient = nw_modAddProj(orient, fS, 'THAL', 'FEF', THAL_2_FEF_SCALAR, [p2p 'onetoone'], projState, 'add');
orient = nw_modAddProj(orient, fS, 'FEF', 'TRN', 1, [p2p 'onetoone'], projState, 'add');
orient = nw_modAddProj(orient, fS, 'TRN', 'THAL', -0.6, [p2p 'allbutsame'], projState, 'shunt');
orient = nw_modAddProj(orient, fS, 'TRN', 'THAL', -0.3, [p2p 'onetoone'], projState, 'shunt');
orient = nw_modAddProj(orient, fS, 'THAL', 'TRN', 0.5, [p2p 'onetoone'], projState, 'add');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BG %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%STN_IN = PUSH;
STR_IN = STN_IN*PUSH_PULL_RATIO;
STR_IN = 0.4;
projState = defParsProj;
projState.srcDims = 1;
projState.norm = 'none';
BG = nw_modAddInput(BG, fS, 'DA', 'STR_D1', 1, [p2p 'diffuse'], projState, 'shunt');
BG = nw_modAddInput(BG, fS, 'DA', 'STR_D2', -1, [p2p 'diffuse'], projState, 'shunt');
projState.norm = 'affx';
projState = defParsProj;
BG = nw_modAddProj(BG, fS, 'STR_D1', 'SNr', -STR_IN, [p2p 'onetoone'], projState, 'add');
BG = nw_modAddProj(BG, fS, 'STR_D2', 'GPe', -STR_IN, [p2p 'onetoone'], projState, 'add');
projState.norm = 'none'; % just STN
BG = nw_modAddProj(BG, fS, 'STN', 'SNr', 1.0, [p2p 'diffuse'], projState, 'add');
BG = nw_modAddProj(BG, fS, 'STN', 'GPe', 1.0, [p2p 'diffuse'], projState, 'add');
projState.norm = 'affx';
BG = nw_modAddProj(BG, fS, 'GPe', 'STN', -1, [p2p 'onetoone'], projState, 'add');
projState.norm = 'affx';
BG = nw_modAddProj(BG, fS, 'GPe', 'SNr', -0.3, [p2p 'onetoone'], projState, 'add');
orient = orient.addsubsystem('BG', BG);
%%%%%%%%%%%%%%%%%%%%%%%%% links between subsystems %%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% orient to BG ------------------------------------------------------------
projState = defParsProj;
projState.sigma = 6;
projState.norm = 'none'; % Just for STN in
orient = nw_modAddProj(orient, fS, 'FEF', 'BG.STR_D1', 0.5, [p2p 'onetoone'], projState, 'add');
orient = nw_modAddProj(orient, fS, 'FEF', 'BG.STR_D2', 0.5, [p2p 'onetoone'], projState, 'add');
orient = nw_modAddProj(orient, fS, 'FEF', 'BG.STN', STN_IN/(layerDims(1)*layerDims(2)), [p2p 'diffuse'], projState, 'add');
orient = nw_modAddProj(orient, fS, 'THAL', 'BG.STR_D1', 0.5, [p2p 'onetoone'], projState, 'add');
orient = nw_modAddProj(orient, fS, 'THAL', 'BG.STR_D2', 0.5, [p2p 'onetoone'], projState, 'add');
orient = nw_modAddProj(orient, fS, 'THAL', 'BG.STN', STN_IN/(layerDims(1)*layerDims(2)), [p2p 'diffuse'], projState, 'add');
projState.norm = 'affx';
% Retina to orient --------------------------------------------------------
% sigma here can be decreased if necessary
projState = defParsProj;
projState.sigma = 0.6;
projState.delay = 0.05;
%orient = nw_modAddProj(orient, fS, 'retina_1', 'FEF', 0.5, [p2p 'gaussian'], projState, 'add');
projState.delay = 0.0;
% orient to orient ------------------------------------------------------------
orient = nw_modAddProj(orient, fS, 'SC_sup', 'THAL', 0.5, [p2p 'onetoone'], projState, 'add');
orient = nw_modAddProj(orient, fS, 'SC_buildup', 'THAL', 0.6, [p2p 'onetoone'], projState, 'add');
% BG to orient ------------------------------------------------------------
projState.sigma = 1.3;
orient = nw_modAddProj(orient, fS, 'BG.SNr', 'THAL', -0.6/CAP_LEVEL, [p2p 'gaussian'], projState, 'shunt');
orient = nw_modAddProj(orient, fS, 'BG.SNr', 'TRN', -3.0/CAP_LEVEL, [p2p 'gaussian'], projState, 'shunt');
%orient = nw_modAddProj(orient, fS, 'BG.SNr', 'THAL', -0.0, [p2p 'onetoone'], projState, 'add');
% Retina to orient------------------------------------------------------------
projState.delay = 0.05;
projState.sigma = 0.6;
orient = nw_modAddProj(orient, fS, 'retina_1', 'SC_sup', 1, [p2p 'gaussian'], projState, 'add');
% orient to orient------------------------------------------------------------
projState.delay = 0.0;
projState.sigma = 0.6;
orient = nw_modAddProj(orient, fS, 'FEF', 'SC_buildup', 0.3, [p2p 'gaussian'], projState, 'add');%0.02
% BG to orient----------------------------------------------------------------
orient = nw_modAddProj(orient, fS, 'BG.SNr', 'SC_buildup', -SC_SNR_DAMPING, [p2p 'onetoone'], projState, 'shunt');
orient= orient.link('SC_buildup>out', 'SG<<SC');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SCOPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if scopesOn == true && reach_scopes == false
state = [];
state.dims = [layerDims];
state.scale=[0 1.01];
state.zoom = 8;
state.interval = inter;
state.position = [20 300];
state.colours = 'fire';
state.title = scopeTarg;
orient = orient.addprocess('scopeFEF', 'dev\abrg\2008\scope', fS, state);
orient =orient.link(scopeTarg, 'scopeFEF<<mono<in');
state = [];
state.dims = [layerDims];
state.scale=[0 1.01];
state.zoom = 8;
state.interval = inter;
state.position = [400 300];
state.colours = 'fire';
state.title = scopeTargA;
orient = orient.addprocess('scopeA', 'dev\abrg\2008\scope', fS, state);
orient =orient.link(scopeTargA, 'scopeA<<mono<in');
state = [];
state.dims = [layerDims];
state.scale=[0 1.01];
state.zoom = 8;
state.interval = inter;
state.position = [20 600];
state.colours = 'fire';
state.title = scopeTargB;
orient = orient.addprocess('scopeB', 'dev\abrg\2008\scope', fS, state);
orient =orient.link(scopeTargB, 'scopeB<<mono<in');
state = [];
state.dims = [layerDims];
state.scale=[0 1.01];
state.zoom = 8;
state.interval = inter;
state.position = [400 600];
state.colours = 'fire';
state.title = scopeTarg2;
orient = orient.addprocess('scope2', 'dev\abrg\2008\scope', fS, state);
orient =orient.link(scopeTarg2, 'scope2<<mono<in');
state = [];
state.scale = [-0.3 1.4];
state.position = [20 900];
state.title = 'SG_inhib';
state.height = 100;
state.length =200;
state.interval = inter;
orient = orient.addprocess('scopeOPN', 'dev\abrg\2008\scalarScope', fS, state);
orient =orient.link('SG>inhib', 'scopeOPN<in');
end
%*************************************************************************%
% END ORIENT %
%*************************************************************************%
sys = sys.addsubsystem('orient', orient);