sbi-dev / sbi

Simulation-based inference toolkit
https://sbi-dev.github.io/sbi/
Apache License 2.0
589 stars 151 forks source link

Port summarizer for Lotka-Volterra from numpy to PyTorch #15

Closed alvorithm closed 4 years ago

alvorithm commented 4 years ago

The modules lotka_volterra_pytorch and mg1_pytorch both import from a non-checked-in module, summarizers. By default they will try to summarize observations (https://github.com/mackelab/sbi/blob/7f62e3c23a1cc56ffd92f6355636e61934c80881/lfi/simulators/lotka_volterra_pytorch.py#L74, https://github.com/mackelab/sbi/blob/7f62e3c23a1cc56ffd92f6355636e61934c80881/lfi/simulators/mg1_pytorch.py#L23) and fail here.

These pytorch simulator varians do not seem to be in use at the moment.

janfb commented 4 years ago

Looking at the numpy implementation in lotka_volterra.py we see that there is a Stats() class acting as a summarizer.

I think Conor first made it possible to simulate with and without summary stats, therefore the argument summarize_observations=True, and the case

https://github.com/mackelab/sbi/blob/39a0dbf792f7864383290d8ead69b1a7bfe5cda5/sbi/simulators/lotka_volterra_pytorch.py#L73-L74

and then got rid of this feature to calculate summary stats by default.

If we need the pytorch implementation then we would have to write the Stats() class in PyTorch.

However, in all current examples and tests the numpy version is used.

jan-matthis commented 4 years ago

Would be good to port the summaries over to PyTorch, imo

alvorithm commented 4 years ago

If Lotka-Volterra is going to disappear from sbi, then we should close this? Alternatively, this issue will be dealt with in different form when adopting pytorch-lightning

jan-matthis commented 4 years ago

If Lotka-Volterra is going to disappear from sbi, then we should close this?

Yes, think this can be closed