-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplotmodel.m
71 lines (51 loc) · 1.36 KB
/
plotmodel.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
% make plot for cosyne
% Niru Maheswaranathan
% 09:40 PM Nov 18, 2013
load trueParams;
load estParams;
dt = 0.1;
time = 0:dt:dt*(size(data.n,1)-1);
% plot RFs
%neurons = [1 8 56 59 64 68 70 71 80 83 87];
neurons = [59 70 80 83];
% make firings matrix
spkmat = flipud(data.n');
spkmat = spkmat - 2;
firings = spikes2firings(spkmat, time);
ni = firings(:,2) > 80;
ne = firings(:,2) <= 80;
%fig(1); clf; hold on;
%plot(firings(ne,1), firings(ne,2), 'bo'); %, 'FillColor', [0.23 0.14 0.7], 'MarkerSize', 18);
%plot(firings(ni,1), firings(ni,2), 'ro'); %, 'Color', [0.8 0.1 0.14], 'MarkerSize', 18);
%xlim([90 210]); makepretty;
%set(gca,'XTick',90:20:210,'XTickLabel',0:20:120);
%xlabel('Time (s)');
%ylabel('Neuron Index');
%legend('Excitatory', 'Inhibitory', 'Location', 'EastOutside')
% correlation coefficients
%C = corrcoef([theta.w thetaEst.w]);
%C = C(101:end,1:100).^2;
%fig(2)
W0 = zeros(256,4);
W1 = zeros(256,4);
idx = 1;
for n = neurons
%subplot(121);
im0 = imsq(theta.w(:,n))';
%imgsc(im0);
%title('true')
%subplot(122);
W0(:,idx) = im0(:);
im = imsq(thetaEst.w(:,n))';
H = fspecial('gaussian', [10 10], 1);
imf = imfilter(im, H);
if im0(:)'*imf(:) < 0
imf = -imf;
end
W1(:,idx) = imf(:);
%imgsc(imf);
%title('est')
%mtit(['neuron ' num2str(n)]);
%waitforbuttonpress;
idx = idx +1;
end