Skip to content
Discussion options

You must be logged in to vote

Hey @meditans , thanks for trying out RxInfer! For me, when I run your code, it does not emit a warning and then loop forever, but an error in the inference procedure is being thrown. This is because the Linearization only works with Normal in and outputs see docs Since you are passing data, this assumption is invalidated. A way to fix it is by wrapping y in a Normal with very small variance, like so:

using RxInfer

@model function example2(y)
    x1 ~ NormalMeanPrecision(0.4, 1)
    x2 ~ NormalMeanPrecision(0.7, 10)
    diff := x1 - x2
    y ~ NormalMeanVariance(abs(diff), 1e-6)
end

@meta function abs_meta()
    abs() -> Linearization()                 # NOTE I also made a change here!
end

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@meditans
Comment options

@bvdmitri
Comment options

Answer selected by meditans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants