Mini-Pyro Interface¶
This interface provides a backend for the Pyro probabilistic programming
language. This interface is intended to be used indirectly by writing standard
Pyro code and setting pyro_backend("funsor")
. See examples/minipyro.py for
example usage.
Mini Pyro¶
This file contains a minimal implementation of the Pyro Probabilistic
Programming Language. The API (method signatures, etc.) match that of
the full implementation as closely as possible. This file is independent
of the rest of Pyro, with the exception of the pyro.distributions
module.
An accompanying example that makes use of this implementation can be found at examples/minipyro.py.
-
class
trace
(fn=None)[source]¶ Bases:
funsor.minipyro.Messenger
-
class
replay
(fn, guide_trace)[source]¶ Bases:
funsor.minipyro.Messenger
-
class
block
(fn=None, hide_fn=<function block.<lambda>>)[source]¶ Bases:
funsor.minipyro.Messenger
-
class
seed
(fn=None, rng_seed=None)[source]¶ Bases:
funsor.minipyro.Messenger
-
class
CondIndepStackFrame
(name, size, dim)¶ Bases:
tuple
-
dim
¶ Alias for field number 2
-
name
¶ Alias for field number 0
-
size
¶ Alias for field number 1
-
-
class
PlateMessenger
(fn, name, size, dim)[source]¶ Bases:
funsor.minipyro.Messenger
-
class
log_joint
(fn=None)[source]¶ Bases:
funsor.minipyro.Messenger
-
class
Adam
(optim_args)[source]¶ Bases:
funsor.minipyro.PyroOptim
-
TorchOptimizer
¶ alias of
torch.optim.adam.Adam
-
-
class
ClippedAdam
(optim_args)[source]¶ Bases:
funsor.minipyro.PyroOptim
-
TorchOptimizer
¶ alias of
pyro.optim.clipped_adam.ClippedAdam
-
-
class
Trace_ELBO
(**kwargs)[source]¶ Bases:
funsor.minipyro.ELBO
-
class
TraceMeanField_ELBO
(**kwargs)[source]¶ Bases:
funsor.minipyro.ELBO
-
class
TraceEnum_ELBO
(**kwargs)[source]¶ Bases:
funsor.minipyro.ELBO
-
class
Jit_ELBO
(elbo, **kwargs)[source]¶ Bases:
funsor.minipyro.ELBO