Conditioning¶
Conditioning on observations and evidence in probabilistic programs.
conditioning
¶
Conditioning: pair a program with observed data.
The condition function wraps a MonadicProgram with a dict of
observations, producing a Conditioned object that threads those
observations through tracing and log-joint evaluation. This is the
primary interface for specifying observed data in inference.
Conditioned
¶
Conditioned(model: MonadicProgram, data: dict[str, Tensor])
A monadic program paired with observed data.
| PARAMETER | DESCRIPTION |
|---|---|
model
|
The generative model.
TYPE:
|
data
|
Observed variable names mapped to their observed values.
TYPE:
|
Source code in src/quivers/inference/conditioning.py
condition
¶
condition(model: MonadicProgram, data: dict[str, Tensor]) -> Conditioned
Condition a model on observed data.
| PARAMETER | DESCRIPTION |
|---|---|
model
|
The generative model.
TYPE:
|
data
|
Observed variable names mapped to their observed values.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Conditioned
|
Wrapped model with observations. |