ocaml-torch
ocaml-torch copied to clipboard
Support for probability distributions
Hi,
It seems to me that ocaml-torch does not provide API for torch.distributions. Specifically, it does not implement various probability distributions with some common functions such as sample and log_prob. I think they are important enough and should be implemented here.
Best, Gwonsoo
Hi, Right I agree that it would be a nice thing to add. The modules from torch.distributions are mostly written in python so this would have to be re-implemented on the ocaml side, the required torch primitives should already be exposed.
Do you have any specific plans for implementing them?
Not currently, I can add it to my stack but I'm unsure when I'll get to it. Feel free to have a go at it if you want. Do you have some use cases for this? Also knowing which distributions are the most interesting ones could be helpful.
We only need normal distributions currently. Thanks for your response.
Hi Laurent,
I re-opened this issue, and I think it will be helpful for many users if ocaml-torch
supports at least normal distributions and multivariate normal distributions (sample and log_prob functions). Normal distributions are easy to implement, but multivariate normal distributions seem to need more care.
Thanks, Gwonsoo