-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvislay.m
More file actions
23 lines (20 loc) · 779 Bytes
/
Copy pathvislay.m
File metadata and controls
23 lines (20 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
% Visualization of weight layers
% by: Mahdi Vasighi
% -------------------------------------------------------------------------
function vislay(net,laynum)
set(gcf,'position',[50 50 640 640],'Color',[1 1 1])
set(gcf, 'name', ['Weight layer',num2str(laynum)])
set(gcf, 'NumberTitle', 'off')
maxsize=max(max(net.grd')-min(net.grd'));
gCord=net.grd;
maxbox=430/maxsize;
maxval=max(net.W(laynum,:));
hold on
% plot(gCord(1,:),gCord(2,:),'ws','markersize',maxbox,'markerfacecolor',[1 1 1],'MarkerEdgeColor',[0 0 0])
for i=1:size(net.grd,2)
plot(gCord(1,i),gCord(2,i),'ws','markersize',maxbox,'markerfacecolor',(net.W(laynum,i)/maxval).*[1 1 1],'MarkerEdgeColor',[0 0 0])
% text(gCord(1,i),gCord(2,i),num2str(net.hitcount(i)))
end
axis equal
axis off
hold off