locked
How to explain the result diference in contrains the same thing multiple time? RRS feed

  • Question

  • Hi, 

        I found that the below two codes giving diferent results, but logically they are the same, just imposing the same constrains more than one time.  So I am wondering how the internal mechanism of infer net to interpret this.

    Thank you very much

    code 1:

     Variable<double> x = Variable.GaussianFromMeanAndVariance(0, 1).Named("x");
                    {
                        Variable.ConstrainTrue(x > thresh);
                    } 

    code2: 

    Variable<double> x = Variable.GaussianFromMeanAndVariance(0, 1).Named("x");
                    {
                        Variable.ConstrainTrue(x > thresh);
                        Variable.ConstrainTrue(x > thresh);
                        Variable.ConstrainTrue(x > thresh);
                    } 

                   
    Monday, September 29, 2014 3:39 PM

All replies

  • This was explained in a previous thread.
    Monday, September 29, 2014 4:07 PM
    Owner
  • Great thanks, tom! Any way or trick to avoid this effect in the code ? I have to use EP algorithm, and I only put the constraint under certain conditions. Thanks agains.
    Monday, September 29, 2014 5:21 PM