maho3 / ltu-ili

Robust ML in Astro
https://ltu-ili.readthedocs.io/en/latest/
46 stars 9 forks source link

Fix prior configuration #109

Closed maho3 closed 12 months ago

maho3 commented 12 months ago

sbi v0.22 BoxUniform and torch.distributions require that all arguments be Tensors. This breaks our initialization of priors in the sbi backend, which was previously done with floats and tuples.

Now, we catch the prior arguments and convert them to Tensors on the right device before passing them to SBIRunner.

This will only break if the prior distribution accepts something other than a number (e.g. string). However, this isn't the case for any torch.distributions.