none
Infer.NET 101 Chapter 7 - Model Comparison

    질문

  • So I have followed pretty much chapters 1 - 6 but I don't understand how a simple

    Evidence = Variable.Bernoulli(0.5);
    using (Variable.If(Evidence))
    {
    	base.CreateModel();
    }
    
    

    Is all that you need in the model to calculate evidence.  How does that C# capture my intension to calculate the evidence in such a simple statement.  Thanks. 

    2012년 1월 16일 월요일 오전 12:07

모든 응답

  • It works because the call to Variable.If sets a global flag so that when base.CreateModel executes, it knows that the model is inside of a Variable.If(Evidence) block.
    2012년 1월 16일 월요일 오후 2:20