Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/general/Old/bnet_to_gdl_graph.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function gdl = bnet_to_gdl_graph(bnet) | |
2 % BNET_TO_GDL_GRAPH Convert a Bayesian network to a GDL graph | |
3 % gdl = bnet_to_gdl_graph(bnet) | |
4 % | |
5 % Each node in the BN gets converted to a single node in the GDL graph, | |
6 % representing its family; its kernel function is the corresponding CPD. | |
7 | |
8 N = length(bnet.dag); | |
9 doms = cell(1,N); | |
10 for i=1:N | |
11 doms{i} = family(bnet.dag, i); | |
12 end | |
13 | |
14 U = mk_undirected(bnet.dag); | |
15 gdl = mk_gdl_graph(U, doms, bnet.node_sizes, bnet.CPD, 'equiv_class', bnet.equiv_class, ... | |
16 'discrete', bnet.dnodes, 'chance', bnet.chance_nodes, ... | |
17 'decision', bnet.decision_nodes, 'utility', bnet.utility_nodes); | |
18 |