You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
753 B
Matlab
30 lines
753 B
Matlab
function [Y2,Y1]=nonlinear_PCBC_attention_model(x,W2,attn,eta,stim_off)
|
|
%set network parameters
|
|
iterations=20;
|
|
[n,m]=size(W2);
|
|
[W2,W2hat]=norm_weights(W2);
|
|
W1=eye(m);
|
|
[W1,W1hat]=norm_weights(W1);
|
|
|
|
%initialise activation values
|
|
y1=zeros(m,1);
|
|
y2=zeros(n,1);
|
|
z2=zeros(m,1);
|
|
Y2=y2;
|
|
Y1=y1;
|
|
|
|
%iterate to calculate node activations
|
|
for t=2:iterations
|
|
%calculate response of 1st processing stage
|
|
[y1]=nonlinear_PCBC_iteration(x,y1,W1,W1hat,z2,attn(:,:,1),eta);
|
|
|
|
%calculate response of 2nd processing stage
|
|
[y2,z2,e2]=nonlinear_PCBC_iteration(y1,y2,W2,W2hat,0,attn(1:n,:,2),eta);
|
|
|
|
Y2=[Y2,y2]; %return time varying response of stage 2
|
|
Y1=[Y1,y1]; %return time varying response of stage 1
|
|
|
|
%remove input to network
|
|
if t==stim_off, x=x.*0; end
|
|
end
|