ReactiveMP.jl
ReactiveMP.jl copied to clipboard
Keyword arguments not supported in non-linear node
The non-linear node does not support keyword arguments, e.g.
function foo(x1, x2; b=0)
return x1 + x2 + b
end
@model function model_test(b)
z1 ~ NormalMeanVariance(0.0, 1.0)
z2 ~ NormalMeanVariance(0.0, 1.0)
x ~ foo(z1, z2; b=b)
y = datavar(Float64)
y ~ NormalMeanVariance(x, 1.0)
end
fails with LoadError: Unknown option '$(Expr(:kw, :b, :b))' for 'foo' node.
Hey @wouterwln! I believe this error is on ~GraphPPL side. Is it something difficult to fix? Otherwise I would just throw an error like:
error("Keyword arguments are not supported for Delta node creation. Consider wrapping your function with keyword arguments into a keyword-free function.")
I am not sure how to fix it without touching ReactiveMP.jl. @bvdmitri is it something we want to support anyway?
@albertpod this is fixed in GraphPPL 4.0 ;)
@wouterwln awesome. Let's close once new GraphPPL is merged