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
Inference with continuous variables
-
- Site Admin
- Posts: 1457
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Inference with continuous variables
There are no docs at the moment - see defequation.h and valequationevaluation.h for raw details.
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
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
-
- Site Admin
- Posts: 1457
- Joined: Mon Nov 26, 2007 5:51 pm
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.
-
- Site Admin
- Posts: 1457
- Joined: Mon Nov 26, 2007 5:51 pm
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:
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.
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;