-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of arbitrary distributions from Distributions.jl
#79
Comments
Note to self: GraphPPL.NodeBehaviour(::Type{<:Distributions.Distribution}) = GraphPPL.Stochastic()
GraphPPL.rhs_to_named_tuple(::GraphPPL.Atomic, t::Type{<:Distributions.Distribution}, interface_values) = NamedTuple{fieldnames(t)}(interface_values)
GraphPPL.interfaces(t::Type{<:Distributions.Distribution}, ::Val{3}) = (:out, fieldnames(t)...) These lines implement whatever is necessary in order to create arbitrary nodes from |
We definitely put this either in RxInfer or in an extension (if Distributions is loaded by a user, then we could define extra functions, this is new in 1.9) |
I merged a PR that should implement the extension. @bvdmitri are you aware of any way in which I can test this or should we leave it be? |
There are slight issues with this, as not all distributions from julia> GraphPPL.interfaces(Dirichlet, 1)
(:out, :alpha, :alpha0, :lmnB) We can implement these "special" cases in the extension as well, but that kind of defies the point of this extension. Any suggestions? |
@wouterwln I think you can load With the second issue about differences in the struct fields and desired interfaces it will happen more often I believe. You should look into the |
This is as fixed as it's going to be. I'm going to close this to clean up the overview of open issues |
As discussed, it should be possible for users to use arbitrary distributions from
Distributions.jl
, without them needing to be defined inRxInfer.jl
. Here just a reminder: As shown, this will require some lines of code, once the newGraphPPL
version gets integrated inRxInfer
. Would be great if the interface names get automatically adopted from the fieldnames inDistributions.jl
.The text was updated successfully, but these errors were encountered: