I've noticed that the prior object from task.get_prior() is not immediately usable with the sbi package since there are no .sample() or .log_prob() methods. Specifically attempting something like this fails:
Looking at the code, I imagine this could be implemented by having task.get_prior() return a class instead of a function. Then the class could have a __call__() method to maintain compatibility with the current API. Happy to give this a shot if you guys agree with the change.
I've noticed that the prior object from
task.get_prior()
is not immediately usable with thesbi
package since there are no.sample()
or.log_prob()
methods. Specifically attempting something like this fails:Looking at the code, I imagine this could be implemented by havingtask.get_prior()
return a class instead of a function. Then the class could have a__call__()
method to maintain compatibility with the current API. Happy to give this a shot if you guys agree with the change.Edit: it would actually just suffice to expose the
prior_dist
: https://github.com/sbi-benchmark/sbibm/blob/15f068a08a938383116ffd92b92de50c580810a3/sbibm/tasks/slcp/task.py#L60