annotate toolboxes/FullBNT-1.0.7/GraphViz/draw_dbn_test.m @ 0:cc4b1211e677 tip

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