How to call svi.run(data) when using mini batches?

I started without mini-batches and could do predictions with my pyro model by calling (after all steps)

svi.run(data)

to get the traces and by using TracePredictive and so on to get prediction samples. This worked out well.

Then i started to use mini-batched data which does not fit in memory anymore. Calling svi.step(batch) worked out but i can’t call svi.run(data) anymore because data does not fit in memory. Any ideas how this could work?

Hi @martin.hahn, when using mini batches, the data is changed per step, so it is best to use svi.step. If you want to use full data but let SVI do subsampling, then you can use the methods in SVI Part II: Conditional Independence, Subsampling, and Amortization — Pyro Tutorials 1.8.4 documentation.