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.
GazeSimulation/expts_gain_modulation_eye.m

105 lines
3.5 KiB
Matlab

function expts_gain_modulation_eye()
[W,V,interconnects]=define_network(1);
%choose node from which to record
[angles,ranges,partitions,values,stdx]=simulate_agent();
nullH=zeros(1,length(values{1,3}));
retinaRF=-30;
panRF=30;
indR=find(ranges.Rcentres==retinaRF);
indE=find(ranges.Ecentres==panRF);
node=(indR-1)*length(ranges.Ecentres)+indE;
%record response of neuron to different combinations of retinal input and eye pan
retinaTestvals=retinaRF+[-30:90];
eyeTestvals=panRF+[0:-7.5:-30];
k=0;
for b=eyeTestvals
k=k+1;
p=0;
for a=retinaTestvals
p=p+1;
x{1}=[code(a,values{1,1},stdx),code(b,values{1,2},stdx),nullH]';
[y,e,r,ytrace]=dim_activation_hierarchical(W,x,V,interconnects);
resp(k,p)=mean(ytrace{1}(node,:));
end
end
figured(1),clf
plot(resp','LineWidth',3)
legend([num2str(eyeTestvals', 'pan=% 2.1f')],'Location','NorthEast');legend('boxoff')
axis([1,length(retinaTestvals),0,0.17])
tolabel=[1:30:length(retinaTestvals)];
set(gca,'XTick',tolabel,'XTickLabel',retinaTestvals(tolabel),'FontSize',15);
xlabel('retinal location of stimulus (degrees)');ylabel('response')
set(gcf,'PaperSize',[11 11],'PaperPosition',[0.5 0.5 10.5 10.5],'PaperOrientation','Portrait');
print(gcf, '-dpdf', 'gain_modulation_eye.pdf');
%record response of neuron to different combinations of head-centred visual position and eye pan
clear resp
targetTestvals=[-60:1:60];
eyeTestvals=panRF+[0:-7.5:-30];
k=0;
for b=eyeTestvals
k=k+1;
p=0;
for a=targetTestvals
p=p+1;
%calc visual input produced by current target
vistarget=simulate_agent_world_to_retina(a,b,0,0);
x{1}=[code(vistarget,values{1,1},stdx),code(b,values{1,2},stdx),nullH]';
[y,e,r,ytrace]=dim_activation_hierarchical(W,x,V,interconnects);
resp(k,p)=mean(ytrace{1}(node,:));
end
end
figured(2),clf
plot(resp','LineWidth',3)
legend([num2str(eyeTestvals', 'pan=% 2.1f')],'Location','NorthEast');legend('boxoff')
%axis([1,length(retinaTestvals),0,0.3])
tolabel=[1:60:121];
set(gca,'XTick',tolabel,'XTickLabel',targetTestvals(tolabel),'FontSize',15);
xlabel('body-centred location of stimulus (degrees)');ylabel('response')
set(gcf,'PaperSize',[11 11],'PaperPosition',[0.5 0.5 10.5 10.5],'PaperOrientation','Portrait');
%record response of neuron to different combinations of retinal input and eye
%pan - repeat first experiment, but initially setting network to look at the
%fixation point, and keeping fixation point to present throughout
retinaTestvals=retinaRF+[-30:90];
eyeTestvals=panRF+[0:-7.5:-30];
nullE=zeros(1,length(values{1,1}));
k=0;
for b=eyeTestvals
k=k+1;
p=0;
for a=retinaTestvals
p=p+1;
%fixate FP:
x{1}=[code(0,values{1,1},stdx),code(b,values{1,2},stdx),nullH]';
y=dim_activation_hierarchical(W,x,V,interconnects);
%show FP and flash probe:
for t=1:50
x{1}(:,t)=[code(0,values{1,1},stdx)+code(a,values{1,1},stdx),code(b,values{1,2},stdx),nullH]';
end
x{1}(:,t+1)=[code(0,values{1,1},stdx),code(b,values{1,2},stdx),nullH]';
[y,e,r,ytrace]=dim_activation_hierarchical(W,x,V,interconnects,y);
resp(k,p)=mean(ytrace{1}(node,:));
end
end
figured(3),clf
plot(resp','LineWidth',3)
legend([num2str(eyeTestvals', 'pan=% 2.1f')],'Location','NorthEast');legend('boxoff')
axis([1,length(retinaTestvals),0,0.17])
tolabel=[1:30:length(retinaTestvals)];
set(gca,'XTick',tolabel,'XTickLabel',retinaTestvals(tolabel),'FontSize',15);
xlabel('retinal location of stimulus (degrees)');ylabel('response')
set(gcf,'PaperSize',[11 11],'PaperPosition',[0.5 0.5 10.5 10.5],'PaperOrientation','Portrait');
%print(gcf, '-dpdf', 'gain_modulation_eye.pdf');