Skip to content

No constraints on the parameters of a sum node #133

@AlexandreDubray

Description

@AlexandreDubray

Hi,

It seems that there are no constraints on the parameters (log probs for the children) of a sum node. It means that an input (adapted from the doc)

using ProbabilisticCircuits;

X1, X2, X3    = [InputNode(i, Indicator(true))  for i=1:3]
X1_, X2_, X3_ = [InputNode(i, Indicator(false)) for i=1:3]

pc = 1.3 * (X1_ *
             (0.2 * X2_ + 0.8 * X3)) +
     0.7 * (X1 *
             (0.4 * X2 + 0.6 * X3_));

data = Matrix{Union{Missing, Bool}}([missing missing true])
probs = loglikelihoods(pc, data; batch_size=3)
println(exp(first(probs)))

does not raise any error (or warning) and gives a probability of 1.58. Is it allowed by design ? Otherwise, a little check that the weights of the mixture sum up to 1.0 adds almost no overhead at creation time and avoid such situation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions