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.
66 lines
2.8 KiB
Matlab
66 lines
2.8 KiB
Matlab
function words_perceptual_advantage()
|
|
incFeedback=1;
|
|
close all
|
|
|
|
%define network
|
|
[W,alpha,mImage,nLetters]=words_weights(incFeedback);
|
|
|
|
%define input patterns
|
|
offset=40;
|
|
X=zeros(mImage,offset+1,5);%X is three-dimensional, to allow for time-varying stimulus
|
|
X([encode_letter('c'),encode_letter('a'),encode_letter('v'),encode_letter('e')],1:offset,1)=1;
|
|
X([encode_letter('m'),encode_letter('a'),encode_letter('v'),encode_letter('e')],1:offset,2)=1;
|
|
X([encode_letter('u'),encode_letter('a'),encode_letter('h'),encode_letter('b')],1:offset,3)=1;
|
|
X([encode_letter('3'),encode_letter('a'),encode_letter('3'),encode_letter('3')],1:offset,4)=1;
|
|
X([logical(zeros(1,14)),encode_letter('a'),logical(zeros(1,14)),logical(zeros(1,14))],1:offset,5)=1;
|
|
%X([encode_letter('c'),encode_letter('a'),encode_letter('v'),encode_letter('e')],1:offset,4)=0.1;%CAVE (dim)
|
|
%X([encode_letter('3'),encode_letter('a'),encode_letter('3'),encode_letter('3')],1:offset,5)=0.1;%+A++ (dim)
|
|
|
|
%present each input to the network in turn and record the results
|
|
for k=1:size(X,3)
|
|
x=X(:,:,k);
|
|
[y,e,r,yTrace]=dim_activation_hierarchical(W,x,incFeedback,offset+25);
|
|
resp(k,:)=yTrace{1}(nLetters+1,:); %record response of node selective for letter "a" in 2nd position
|
|
respMean(k)=mean(resp(k,:));
|
|
|
|
%plot results for this condition
|
|
yTrace{1}=mean(yTrace{1},2);
|
|
yTrace{2}=mean(yTrace{2},2);
|
|
figure(k),clf, words_plot_results(x,yTrace,r,alpha);
|
|
end
|
|
|
|
figure(6),clf
|
|
axes('Position',[0.2,0.2,0.6,0.4]),
|
|
plot(resp','LineWidth',2),axis([0,offset+15,0,4.5])
|
|
set(gca,'FontSize',12);
|
|
legend(['A in word ';
|
|
'A in pseudoword ';
|
|
'A in nonword ';
|
|
'A in non-letters';
|
|
'A in isolation '],'Location',[0.35,0.7,0.31,0.1])
|
|
xlabel('time'),ylabel('activation')
|
|
set(gcf,'PaperSize',[7 10],'PaperPosition',[0 0 8 10]);
|
|
print(gcf, '-dpdf', 'words_perceptual_advantage_trace.pdf')
|
|
|
|
human=[0.8,0.78,0.66;0.86,0.76,0.72].*100;
|
|
|
|
figure(7),clf
|
|
axes('Position',[0.2,0.2,0.6,0.6]),
|
|
cm='r';
|
|
ch=[0.5,0,0.5];
|
|
[hAx,hLine1,hLine2] = plotyy([1:3],respMean([1,2,5]),[1:3],human(1,:));
|
|
set(hLine1,'LineStyle','-','Color',cm,'Marker','o','LineWidth',2,'MarkerFaceColor',cm)
|
|
set(hLine2,'LineStyle','-','Color',ch,'Marker','s','LineWidth',2,'MarkerFaceColor',ch)
|
|
axis(hAx(1),[0.5,3.5,0.5,2]);
|
|
axis(hAx(2),[0.5,3.5,62+0.5,83+0.5]);
|
|
set(hAx(1),'FontSize',12);set(hAx(1),'XColor','k','YColor',cm)
|
|
set(hAx(2),'FontSize',12);set(hAx(2),'XColor','k','YColor',ch)
|
|
set(hAx(1),'XTick',[],'YTick',[0:0.5:4])
|
|
set(hAx(2),'XTick',[1:3],'XTickLabel',[' word ';' pseudo ';'isolated'],'YTick',[60:10:90]),
|
|
xlabel(hAx(2),'condition'),
|
|
ylabel(hAx(1),'mean activation','Color',cm,'FontSize',12),
|
|
ylabel(hAx(2),'% correct','Color',ch,'FontSize',12)
|
|
set(gcf,'PaperSize',[8 7],'PaperPosition',[0 0 8 8],'PaperOrientation','portrait');
|
|
print(gcf, '-dpdf', 'words_perceptual_advantage.pdf')
|
|
|