biaslab / ForneyLab.jl

Julia package for automatically generating Bayesian inference algorithms through message passing on Forney-style factor graphs.
MIT License
149 stars 33 forks source link

Outgoing message of multiplication node #125

Closed MagnusKoudahl closed 3 years ago

MagnusKoudahl commented 3 years ago

When trying to compute the outgoing message of the "gain" (multiplication) node, the following MWE fails

fg = FactorGraph()
@RV x ~ GaussianMeanVariance(1.0, 1.0)
@RV y = 4.0 * x

q = PosteriorFactorization(fg)
algo3 = messagePassingAlgorithm(y, id=:_y_fwd)

With the error and stacktrace

KeyError: key nothing not found

Stacktrace:
 [1] getindex at ./dict.jl:467 [inlined]
 [2] isDeterministic(::Interface, ::Dict{Interface,Bool}) at /home/mkoudahl/.config/julia/packages/ForneyLab/e83A8/src/factor_graph.jl:241
 [3] deterministicEdgeSet(::Edge) at /home/mkoudahl/.config/julia/packages/ForneyLab/e83A8/src/factor_graph.jl:203
 [4] deterministicEdges(::FactorGraph) at /home/mkoudahl/.config/julia/packages/ForneyLab/e83A8/src/factor_graph.jl:174
 [5] PosteriorFactorization(::FactorGraph) at /home/mkoudahl/.config/julia/packages/ForneyLab/e83A8/src/algorithms/posterior_factorization.jl:61
 [6] top-level scope at In[7]:6
 [7] include_string(::Function, ::Module, ::String, ::String) at ./loading.jl:1091
 [8] execute_code(::String, ::String) at /home/mkoudahl/.config/julia/packages/IJulia/rWZ9e/src/execute_request.jl:27
 [9] execute_request(::ZMQ.Socket, ::IJulia.Msg) at /home/mkoudahl/.config/julia/packages/IJulia/rWZ9e/src/execute_request.jl:86
 [10] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [11] invokelatest at ./essentials.jl:709 [inlined]
 [12] eventloop(::ZMQ.Socket) at /home/mkoudahl/.config/julia/packages/IJulia/rWZ9e/src/eventloop.jl:8
 [13] (::IJulia.var"#15#18")() at ./task.jl:356

ForneyLab is v 0.11.1. Usecase is for demonstration purposes in the BMLIP course ran by BIASlab