about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/SLP/misc/compute_bnet_nparams.m
blob: 3366375f23765f3ca0243937b7405adcb9336f7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
function [D,d]= compute_bnet_nparams(bnet)
% [D,d] = compute_bnet_nparams(bnet)
%
% D is the dimension of the network
% d is the vector containing the number of parameters for all nodes

N = length(bnet.dag);
d = zeros(1,N);
for i=1:N
   a = struct(bnet.CPD{i});
   d(i) = a.nparams;
end
D = sum(d);