locked
Overwriting a Variable RRS feed

  • Question

  • Hi,

    Is it possible to overwrite a variable? Can I clear the previous definition of a variable and set a new definition?

    For example, how can I make the following simplified code work?

    The use case I have in mind, is to run a von-neumann machine on random variables, which wouldn't be possible without overwriting.

    Variable<bool> evidence = Variable.BernoulliFromLogOdds(1);
    IfBlock block = Variable.If(evidence);
    Range r = new Range(10);
    VariableArray<double> a = Variable.Array<double>(r);
    a[0] = 1.0;
    a[0] = 2.0;
    Variable.ConstrainTrue(a[0] == 2.0);
    block.CloseBlock();
    InferenceEngine ie = new InferenceEngine();
    ie.Infer(evidence);

    Friday, October 11, 2013 6:06 PM

All replies

  • Could you specify your model - in pseudo-code or by describing the generative process? Then we can see how to implement it in Infer.NET.

    Thansk

    Wednesday, October 16, 2013 8:56 AM
    Owner