Closed HRezaei closed 1 year ago
Hi @HRezaei. That is because you're using the same instance of Smokes
for both models. Defining an instance for each model will solve your problem. Let me know if you have any further questions.
To answer this question a bit more verbosely, a model is simply a collection of formulae - so the Smokes
predicate is in fact the same object added to different models. You effectively overwrote the fact of Anna
to be False
for both models, since there is only one predicate object. Creating two Smokes
objects for each model will solve your issue.
Thanks @KyleErwin and @NaweedAghmad,
Defining an instance for each model will solve your problem. Let me know if you have any further questions.
I guess you meant defining an instance for each Smokes
right? Because, in the above example, I have already defined a new instance for the model.
So, if my guess is correct, then the answer is, that's not always easily possible to define a new instance for each predicate/formula. To demonstrate it in simple scenario steps: 1- you create a model, 2- do some initial inference, 3- make different duplicates of the model, 4- on each model, add different data for some formula, 5- run inference for each.
In step 3, it is not easy to iterate over all formulas of the model, and redefine them, is it? Especially, if we want to keep their latest data which are produced as a result of inference in step 2.
Hi and thank you for your creative idea of LNN.
I'm trying to define two different models in which a predicate takes different values, but not sure how to check the state of the predicate in a specific model? Just running
.state()
returns the data of the last model.