Inference with continuous variables

The engine.
Post Reply
Greg
Posts: 16
Joined: Mon Dec 17, 2007 8:03 pm
Location: University of Connecticut
Contact:

Inference with continuous variables

Post by Greg »

Are there any references for setting evidence and inference with networks composed of continuous variables? I haven't found anything in my search of the forum and reference documentation.

Thanks as always,
Greg Johnson
shooltz[BayesFusion]
Site Admin
Posts: 1457
Joined: Mon Nov 26, 2007 5:51 pm

Re: Inference with continuous variables

Post by shooltz[BayesFusion] »

There are no docs at the moment - see defequation.h and valequationevaluation.h for raw details.
Greg
Posts: 16
Joined: Mon Dec 17, 2007 8:03 pm
Location: University of Connecticut
Contact:

Post by Greg »

I seem to be able to set evidence with
node->Value()->SetEvidence(double)

I set the evidence for all but one variable, set that variable as the target
network->SetTarget(int nodeID)

and run inference on the network with UpdateBeliefs but it never returns after several minutes (half hour or more). I've even tried UpdateBeliefs after ClearAllTargets with no improvement.

Are there any notable differences in inference with continuous variables? Limitations on which inference algorithms can be used?

Thanks for the help,
Greg
shooltz[BayesFusion]
Site Admin
Posts: 1457
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

Can you post your code here so I can check with the debugger?
Greg
Posts: 16
Joined: Mon Dec 17, 2007 8:03 pm
Location: University of Connecticut
Contact:

Post by Greg »

Thanks, It's probably something I'm doing (or not doing).
Last edited by Greg on Tue Nov 17, 2009 1:31 am, edited 1 time in total.
shooltz[BayesFusion]
Site Admin
Posts: 1457
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

SMILE contains multiple algorithms for inference in continuous networks. The one which runs when evidence is entered assumes that at least some nodes are stochastic, while your network is completely deterministic. Try changing the code around SetEvidence call to this:

Code: Select all

cout << "\t Setting evidence. " << j << " - " << values[j] << endl;
DSL_equation *eq = static_cast<DSL_equation *>(node->Definition());
string newEq = node->GetId();
newEq += "=";
char buf[64];
sprintf(buf, "%f", values[j]);
newEq += buf;
eq->SetEquation(newEq);
cout << "Done setting evidence." << endl;
Note that information contained in .xdsl is destroyed; the original equations are not preserver. If you want to call UpdateBeliefs again, you need to copy the original network, unless the set of evidence nodes doesn't change.
Greg
Posts: 16
Joined: Mon Dec 17, 2007 8:03 pm
Location: University of Connecticut
Contact:

Post by Greg »

Thanks so much for your time!
Post Reply