Forecaster module in Pyro


for x,y in dataloader:
forecaster = Forecaster(model, y, x, **forecaster_options)

if I train the model like this, inside a for loop, like above, does it train for every batch of data anew? Or is the forecaster trained in the first batch, and then it trains for the second batch, and goes on?
And how do I specify batch size here?
or Do I have to change the model so that It works for batch data? In the case of batch 1, it works fine though.

Hi @mxnyy, I’m not sure the above model will work. Generally to train a Forecaster object on minibatches you’ll need to pass the entire data in and let the Forecaster do subsampling internally. We discuss how to do this in a tutorial, but the basic idea is to define a custom little create_plates() function and pass this to the Forecaster object.

1 Like