pymc.variational.Trainer.fit#

Trainer.fit(n=10000, **kwargs)[source]#

Fit for n steps, streaming minibatches into the model’s placeholder.

Exactly n minibatches are fed to the model: the first seeds the placeholder before step 0, and the advance after the final step is skipped. The accounting stream reads one batch ahead so the pass-size check can fire at a pass boundary, so a re-readable source (the only kind the loader accepts) may be read one batch past the n the model uses. Keyword arguments are forwarded to pymc.fit() on top of the constructor’s fit_kwargs (per-call wins); progressbar defaults to False unless either sets it.

Returns:
Approximation

The fitted approximation, as returned by pymc.fit().