wolffd@0
|
1 % TEST_LAYOUT_DBN Script to test some DBN layouts
|
wolffd@0
|
2 %
|
wolffd@0
|
3
|
wolffd@0
|
4 % Change History :
|
wolffd@0
|
5 % Date Time Prog Note
|
wolffd@0
|
6 % 17-Apr-2000 2:40 PM ATC Created under MATLAB 5.3.1.29215a (R11.1)
|
wolffd@0
|
7
|
wolffd@0
|
8 % ATC = Ali Taylan Cemgil,
|
wolffd@0
|
9 % SNN - University of Nijmegen, Department of Medical Physics and Biophysics
|
wolffd@0
|
10 % e-mail : cemgil@mbfys.kun.nl
|
wolffd@0
|
11
|
wolffd@0
|
12 disp('draw mhmm1')
|
wolffd@0
|
13 clf
|
wolffd@0
|
14 set(gcf, 'pos', [0 0 1024 600]);
|
wolffd@0
|
15
|
wolffd@0
|
16 intra = zeros(3);
|
wolffd@0
|
17 intra(1,[2 3]) = 1;
|
wolffd@0
|
18 intra(2,3) = 1;
|
wolffd@0
|
19 inter = zeros(3);
|
wolffd@0
|
20 inter(1,1) = 1;
|
wolffd@0
|
21 n = 3;
|
wolffd@0
|
22 dnodes = [1 2];
|
wolffd@0
|
23 isbox = zeros(n,1); isbox(dnodes) = 1;
|
wolffd@0
|
24 unfold = 4;
|
wolffd@0
|
25 draw_dbn(intra, inter, 0, unfold, {'Q', 'M', 'Y'}, isbox);
|
wolffd@0
|
26
|
wolffd@0
|
27
|
wolffd@0
|
28 pause
|
wolffd@0
|
29 clf
|
wolffd@0
|
30 disp('draw water1')
|
wolffd@0
|
31 bnet = mk_water_dbn;
|
wolffd@0
|
32 unfold = 3;
|
wolffd@0
|
33 flip = 1;
|
wolffd@0
|
34 [dummyx, dummyy, h] = draw_dbn(bnet.intra, bnet.inter, flip, unfold);
|
wolffd@0
|
35
|
wolffd@0
|
36 col = rand(size(h,1),3);
|
wolffd@0
|
37 for i=1:length(h),
|
wolffd@0
|
38 col = rand(1,3);
|
wolffd@0
|
39 % patches
|
wolffd@0
|
40 set(h(i,2),'facecolor', col); drawnow;
|
wolffd@0
|
41 % text
|
wolffd@0
|
42 set(h(i,1),'color', 1-col); drawnow;
|
wolffd@0
|
43 end;
|
wolffd@0
|
44
|
wolffd@0
|
45
|
wolffd@0
|
46 pause
|
wolffd@0
|
47 clf
|
wolffd@0
|
48 disp('draw BAT static')
|
wolffd@0
|
49 % This requires BNT
|
wolffd@0
|
50
|
wolffd@0
|
51 %sz = get(0, 'ScreenSize');
|
wolffd@0
|
52 %sv = get(gcf, 'pos');
|
wolffd@0
|
53 %set(gcf, 'units','pix','pos', sz);
|
wolffd@0
|
54 [bnet, names] = mk_bat_dbn;
|
wolffd@0
|
55 N = size(bnet.intra,1);
|
wolffd@0
|
56 G = [bnet.intra bnet.inter;
|
wolffd@0
|
57 zeros(N,N) bnet.intra];
|
wolffd@0
|
58 names2 = names;
|
wolffd@0
|
59 for i=1:N
|
wolffd@0
|
60 names2{i} = sprintf('%s(1)', names{i});
|
wolffd@0
|
61 names2{i+N} = sprintf('%s(2)', names{i});
|
wolffd@0
|
62 end
|
wolffd@0
|
63 draw_graph(G, names2);
|
wolffd@0
|
64
|
wolffd@0
|
65 pause
|
wolffd@0
|
66 disp('draw bat dbn')
|
wolffd@0
|
67 clf
|
wolffd@0
|
68 draw_dbn(bnet.intra, bnet.inter, 0, 2, names2);
|