-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_DisMat.m
39 lines (31 loc) · 993 Bytes
/
get_DisMat.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
function [M] = get_DisMat(network, laychoice)
addpath ./myFunctions/
addpath ./myFunctions/export_fig
stimchoice = 'regularIrregular';%'regularIrregularSmall2x';%
distType = 'euclidean';
layer = getLayersFromNetwork(network)';
load([network '_D_' stimchoice '_' distType '.mat']);
idx = find(~cellfun(@isempty,strfind(layer,laychoice)));
M = D{idx};
[~, vv] = sort(M(:));
[~, vv] = sort(vv);
[~, jj, kk] = unique(M(:), 'first');
M = reshape(vv(jj(kk)), size(M));
imagesc(M);
M_no0 = M(:); M_no0(M_no0==1) = [];
caxis([min(M_no0) max(M_no0)]);
title(laychoice);
set(gca,'XTick',[]);
set(gca,'XTickLabel',[]);
set(gca,'YTick',[]);
set(gca,'YTickLabel',[])
color = get(gcf,'Color');
set(gca,'XColor',color,'YColor',color,'TickDir','out');
set(gca,'Visible','off');
% export_fig test.eps -native
export_fig(['./Figures_Regireg/' network '_' laychoice '.eps'])
close
% saveas(gcf,['./Figures_Regireg/' network '_' laychoice '.svg'])
end
% M = get_DisMat('alexnet','fc8')
% ./Figures_Regireg