You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, just wanted to thank you for such an awesome package, we are using it for one of our projects. Specifically, we were using an SMC sampler that sampled a function we created that takes in a matrix as an input.
something like:
{code here that creates a matrix}
result = sample(OurFunction(matrix), SMC(), 5000);
We successfully ran these analyses before this #2007 update. I recently revisited this part of our analysis pipeline and the sampling code does not work anymore (keyword argument error). I tried other samplers, but unsuccessfully.
Is there a different way that we should now be feeding data (like a matrix) into a sampled function? How might we solve this issue?
At the moment, I think the best approach is unfortunately to implement OurFunction without keyword arguments, or alternatively provide a wrapper around it. For example if we have the following model
@modelfunctiondemo(arg1, arg2, kwargs::NamedTuple)
kwarg1 = kwargs.kwarg1
kwarg2 = kwargs.kwarg2
x ~Normal(kwarg1, kwarg2)
end
you can define another version by hand like this:
functiondemo(arg1, arg2; kwargs...)
returndemo(arg1, arg2, NamedTuple(kwargs))
end
Then you can continue using the method with keyword arguments, but it will all still work:)
After #2001 , sampling models with keyword argument using SMC samplers will no longer be supported.
This issue is a reminder + to keep track of the progress towards addressing this.
Related issues and PRs:
produce
Libtask.jl#163The text was updated successfully, but these errors were encountered: