Problem with learning DBN parameters with jSmile

The engine.
Post Reply
Dworpin
Posts: 2
Joined: Mon Apr 16, 2012 10:54 am

Problem with learning DBN parameters with jSmile

Post by Dworpin »

Hi.

It seems I can't perform even the basic learning of the DBN parameters with SMILE. (neither C++ SMILE, nor the jSmile).
The learning works fine with the non-dynamic bayesian networks, but when the temporal plate is added, it works no longer.

I found this tutorial on learning DBNs http://genie.sis.pitt.edu/wiki/SMILearn ... Dynamic_1).
I used the network and the data set and wrote a simple method to perform this learning in jSMILE (the source code, network and the dataset are attached to this post)
and i get this error:

Exception in thread "main" smile.SMILEException: SMILE error -1 in function Learn. Logged information: em: temporal plate node number of parents mismatch for t=0 and t>0

at smile.learning.EM.learn(Native Method)
at smile.learning.EM.learn(EM.java:11)
at smileApp.Main.main(Main.java:37)

I tried to figure out what's wrong with the code, but couldn't find a problem.
So i thought if the problem was in the jSMILE wrappers, i could use the C++ version of SMILE to learn the parameters, save the learned network into a xdsl file
and use it from java. But it seems the tutorial doesn't work in the C++ version either.
(Tried with the Visual C++ 2008 and Smile for the Visual Studio 2008 / VC 9.0 SP1 )

Could you please tell me what am I doing wrong?

Thanks

Dworpin
Attachments
Net_tut_6.xdsl
(1.59 KiB) Downloaded 286 times
ds_tut_6.txt
(409 Bytes) Downloaded 289 times
Main.java.txt
(1.14 KiB) Downloaded 298 times
mark
Posts: 179
Joined: Tue Nov 27, 2007 4:02 pm

Re: Problem with learning DBN parameters with jSmile

Post by mark »

It works in GeNIe and it should also work in SMILE and the wrappers. Are you using the latest version of SMILE? A while ago I fixed an issue related to the error message you are getting so maybe you are still using an older version.
Dworpin
Posts: 2
Joined: Mon Apr 16, 2012 10:54 am

Re: Problem with learning DBN parameters with jSmile

Post by Dworpin »

In Genie it works fine.
But I need to use the learning automatically using Smile, because I have network
with hundreds of slices and when I gather new data, I need to re-learn the parameters.

I tried downloading the current version of jSmile: Win32 binaries (JDK 1.5) [678 kB] (March 13, 2012)
and the problem persists. Even the tutorial network from Tutorial 6 can't be learned:

Network net = new Network();
net.readFile("Net_tut_6.xdsl");

DataSet ds = new DataSet();
ds.readFile("ds_tut_6.txt" );

int varA = 0;
int varB = 1;
int varC = 2;

DataMatch[] matching = new DataMatch[9];
matching[0] = new DataMatch(0, varA, 0);
matching[1] = new DataMatch(1, varA, 1);
matching[2] = new DataMatch(2, varA, 2);
matching[3] = new DataMatch(3, varB, 0);
matching[4] = new DataMatch(4, varB, 1);
matching[5] = new DataMatch(5, varB, 2);
matching[6] = new DataMatch(6, varC, 0);
matching[7] = new DataMatch(7, varC, 1);
matching[8] = new DataMatch(8, varC, 2);

final EM em = new EM();
em.learn(ds, net, matching);

And i get this exception:
Exception in thread "main" smile.SMILEException:
SMILE error -1 in function Learn. Logged information: em: temporal plate node number of parents mismatch for t=0 and t>0
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Problem with learning DBN parameters with jSmile

Post by shooltz[BayesFusion] »

Can you build jSMILE using April 24th release of C++ SMILE? We provide full jSMILE sources at our website.
Post Reply