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.

127 lines
5.6 KiB
Matlab

function expts_compression
%A double-step saccade task. One stimulus presented and saccade to that target
%is planned. Prior to the saccade to the first target, a second stimulus is
%presented. The network's estimate of the location of this second stimulus is
%evaluated under different conditions.
%define network for performing saccades
[W,V,interconnects]=define_network(1);
[angles,ranges,partitions,values]=simulate_agent();
figoff=100;
%Simulate Lappe etal 2000 (but using different probe durations and contrasts)
eyepanseq=6.4.*[-1,1,1];
probeposn=[-2.6,2.6,10,13];
probelen=[5,10,20,30];
probeamp=[0.25,0.5];
seqlen=length(eyepanseq);
for c=1:length(probeamp) %iterate over contrast
for k=1:length(probelen) %iterate over probe duration
for p=1:length(probeposn) %iterate over location of probe
%plan eye movement to saccade target:
vistarget=eyepanseq(end)-eyepanseq(1);% sacccade target
eyepaninit=eyepanseq(1);
[~,eyeposn,~,y,r]=control_eye(vistarget,eyepaninit,W,V,interconnects,[],0,1);
%flash probe and then move:
%should really use eyeposn(2) as eye pan value for latter part of eye movement
%sequence, but we assume that the planned movement is accurate and that we
%can used value predefined in eyepanseq
vistargetseq=NaN.*ones(1,seqlen);
vistargetseq(1)=probeposn(p)-eyepanseq(1); %flash the probe
[~,rTrace]=control_eye_sequence(vistargetseq,eyepanseq,W,V,interconnects,y,r,probelen(k),probeamp(c));
%decode head-centred representation to determine perceived location of the probe
r=rTrace(partitions{1,3},end);
est_posn(p,k)=decode(r',values{1,3});
end
end
figured(figoff+c),clf,
set(gcf,'DefaultAxesColorOrder',[0,0.447,0.741;0.635,0.078,0.184;0.301,0.745,0.933;0.466,0.674,0.188]);
h=plot(repmat(probelen,length(probeposn),1)',est_posn','-','LineWidth',2,'MarkerFaceColor','w'); hold on
h(1).Marker='x';h(2).Marker='o';h(3).Marker='s';h(4).Marker='d';
plot([5,probelen(end)],eyepanseq(end).*[1,1],'k--','LineWidth',2)
text(1,eyepanseq(end),'ST');
plot([5,probelen(end)],eyepanseq(1).*[1,1],'k--','LineWidth',2)
text(1,eyepanseq(1),'FP');
true_posn=repmat(probeposn,2,1);
ax = gca; ax.ColorOrderIndex = 1;
h=plot(repmat([-1,2]',1,4),true_posn,'-','LineWidth',2,'MarkerFaceColor','w');
h(1).Marker='x';h(2).Marker='o';h(3).Marker='s';h(4).Marker='d';
axis([0,30,-7.5,14.5])
xlabel('probe duration (iterations)'); ylabel('position (degrees)')
set(gcf,'PaperSize',[6 6],'PaperPosition',[0.5 0.25 5.5 5.25],'PaperOrientation','Portrait');
print('-dpdf',['compression_contrast',num2str(probeamp(c)),'.pdf'])
end
%Simulate Michels and Lappe 2004, Fig.4
clear est_posn
eyepanseq=10.*[-1,1,1];
probeposn=[-0.4,5.9,14.9,20.4];
probelen=12;
probeamp=[0.05,0.08,0.14,0.25,0.65];
seqlen=length(eyepanseq);
for c=1:length(probeamp) %iterate over contrast
for p=1:length(probeposn) %iterate over location of probe
%plan eye movement to saccade target:
vistarget=eyepanseq(end)-eyepanseq(1);% sacccade target
eyepaninit=eyepanseq(1);
[~,eyeposn,~,y,r]=control_eye(vistarget,eyepaninit,W,V,interconnects,[],0,1);
%flash probe and then move:
%should really use eyeposn(2) as eye pan value for latter part of eye movement
%sequence, but we assume that the planned movement is accurate and that we
%can used value predefined in eyepanseq
vistargetseq=NaN.*ones(1,seqlen);
vistargetseq(1)=probeposn(p)-eyepanseq(1); %flash the probe
[~,rTrace]=control_eye_sequence(vistargetseq,eyepanseq,W,V,interconnects,y,r,probelen,probeamp(c)/2);
%decode head-centred representation to determine perceived location of the probe
r=rTrace(partitions{1,3},end);
est_posn(p,c)=decode(r',values{1,3});
end
compression_index(c)=std(est_posn(:,c))/std(probeposn);
shift_index(c)=mean(est_posn(:,c))-mean(probeposn);%?????
end
figured(figoff+3),clf,
semilogx(probeamp,compression_index,'-x','LineWidth',2,'Color',[0,0.447,0.741]), hold on
axis([0.01,1,0,1])
xlabel('probe contrast'); ylabel('relative separation')
set(gcf,'PaperSize',[6 6],'PaperPosition',[0.5 0.25 5.5 5.25],'PaperOrientation','Portrait');
print('-dpdf','compression_index_with_contrast.pdf')
%Simulate Van Wetter and Van Opstal 2008, Fig 10b
clear error est_posn
eyepanST=[5:5:70]; %[9,14,27,35];
probeposn=[-10:10:10];
probelen=15;
probeamp=0.2;
seqlen=2;
eyepanFP=0;
for p=1:length(eyepanST) %iterate over amplitude of initial saccade
for k=1:length(probeposn) %iterate over positions of probe
%plan eye movement to saccade target:
vistarget=eyepanST(p)-eyepanFP;% sacccade target
[~,eyeposn,~,y,r]=control_eye(vistarget,eyepanFP,W,V,interconnects,[],0,1);
%flash probe and then move:
%for large saccades, planned movement will undershoot position of ST, so we use
%planned eye pan value given by eyeposn(2)
vistargetseq=NaN.*ones(1,seqlen);
vistargetseq(1)=probeposn(k)-eyepanFP; %flash the probe
[~,rTrace]=control_eye_sequence(vistargetseq,[eyepanFP,eyeposn(2)],W,V,interconnects,y,r,probelen,probeamp);
%decode head-centred representation to determine perceived location of the probe
r=rTrace(partitions{1,3},end);
est_posn(k,p)=decode(r',values{1,3});
error(k,p)=(est_posn(k,p)-probeposn(k));
end
end
figured(figoff+4), clf,
plot(eyepanST,mean(error,1),'-','LineWidth',2,'Color',[0,0.447,0.741]), hold on
set(gca,'XTick',[0:20:80]);
axis([0,75,0,12.5])
xlabel({'saccade amplitude','(degrees)'}); ylabel({'probe localisation','error (degrees)'})
set(gcf,'PaperSize',[6.4 6.4],'PaperPosition',[0.5 0.25 5.9 5.65],'PaperOrientation','Portrait');
print('-dpdf','compression_inital_saccade_ampl.pdf')
figure(5), plot(error')
figure(6), plot(est_posn')