locked
Breaking symmetry when using the CompiledAlgorithm object (Migrated from community.research.microsoft.com) RRS feed

  • Question

  • laura posted on 03-03-2009 8:52 AM

    Hi,

    I am using the CompiledAlgorithm object, instead of calling inferenceEngine.infer(). I want to initialize some variables to break symmetry. How does this work?

     

    I tried calling var.InitialiseTo(...) before ca.Reset(), between ca.Reset and ca.Initilise(), and after, but it seems to have no effect.

    Am I supposed to initialize it via ca.SetObservedValue()?

     

    Laura

     

    Friday, June 3, 2011 4:46 PM

Answers

  • jwinn replied on 03-03-2009 9:15 AM

    The symmetry breaking is compiled in to the generated code, so you need to call var.InitialiseTo() before you get the CompiledAlgorithm object.

    If you initialise with a variable using InitialiseTo(Variable<TDist>), rather than with a constant using InitialiseTo(TDist), you can change the initialisation after compilation by setting the observed value of the variable using SetObservedValue() on the CompiledAlgorithm.   Hence, you can change the initialisation without recompiling the algorithm.

    John W.

     

    Friday, June 3, 2011 4:46 PM