typing.Guide

A NumPyro guide for a ForecastModel: a callable with the model’s signature.

Usage

Source

typing.Guide()

A guide is called with the same (covariates, data=None) arguments as the model it approximates, so this Protocol has the same shape as ForecastModel. Both an autoguide instance (numpyro.infer.autoguide.AutoGuide subclasses are callables) and a hand-written guide function satisfy it structurally; nothing needs to subclass it. backtest_vectorized() samples an autoguide through its sample_posterior and any other guide through numpyro.infer.Predictive(guide, params=...).

The same runtime caveat as ForecastModel applies: the beartype hook’s isinstance check on a runtime_checkable Protocol reduces to callable(guide) (Python never inspects signatures at runtime), while ty checks the signature structurally at the call site.

Methods

Name Description
__call__() Run the guide against covariates and optional data.

__call__()

Run the guide against covariates and optional data.

Usage

Source

__call__(covariates, data=None)