0

I am working on a project on Automatic chord recognition which uses a 2-TBN dynamic bayesian network in which there are 4 discrete hidden nodes and 2 continuous observable nodes.

I created the model using the bayes net toolbox and there is no problem regarding that. The fifth and sixth nodes are observable nodes of 13 and 12 dimensions each. I am trying to use the inference part of the toolbox which I am unable to do. I wrote the following code which is not giving the correct output.

function [path,data] = mydecode(bnet,mean,sigma,dat)

dataaa=dat';
data=dataaa(1:12,:);
%chord dimension
chord=109;
%observed chroma dimension
obs=12;
evidence = cell(6,T);
for i=1:T
   evidence(6,i)={dat(i,1:12)} ;
end 
for i=1:T
   evidence(5,i)={dat(i,13:25)} ;
end

engine = {};
engine{end+1} = smoother_engine(jtree_2TBN_inf_engine(bnet));
disp(engine);

mpe = find_mpe(engine{1}, evidence);

end

Please tell me how to proceed with the inference.

marsei
  • 7,691
  • 3
  • 32
  • 41
sid0710
  • 11
  • 4

1 Answers1

0

Reference: http://www.cs.ubc.ca/~murphyk/Bayes/usage_dbn.may22.html

Code:

   engine = jtree_dbn_inf_engine(bnet);
   evidence = cell(N,T);
   [engine, ll] = enter_evidence(engine, evidence);
   evidence(4,1) = {2};
   marg = marginal_nodes(engine, 4, 2);  % This is like querying node 4 in time-slice 2
   marg.T
Ayush
  • 1