dotnet / infer

Infer.NET is a framework for running Bayesian inference in graphical models
https://dotnet.github.io/infer/
MIT License
1.56k stars 230 forks source link

`A is not a point mass` #403

Closed sir-deenicus closed 2 years ago

sir-deenicus commented 2 years ago

Hi, in the code below for multiplying a matrix with a vector:

let dim, dim2 = Range(10), Range(10)

let v = Variable.VectorGaussianFromMeanAndVariance(Vector.Zero(10) , PositiveDefiniteMatrix.Identity(10))

let W = Variable.Array<double>(dim,dim2)

W[dim, dim2] <- Variable.GaussianFromMeanAndPrecision(0.0, 1.0).ForEach(dim, dim2)

let r = Variable.MatrixTimesVector(Z, v)

engine.Infer r

I get an error A is not a point mass and I'm not sure how to interpret it. Is it required that Z be observed or a constant?

tminka commented 2 years ago

It is required that Z is a point mass, not necessarily observed or constant. You can use the PointEstimate attribute to infer Z.