-
Notifications
You must be signed in to change notification settings - Fork 37
Closed as not planned
Labels
enhancementNew feature or requestNew feature or request
Description
#696 introduced several new abstractions for model composition in DynamicPPL.jl:
ReturnedModelWrapper
Wraps a model to treat it as a distribution over its return values instead of its parameters.
Example:
@model function demo()
x ~ Normal()
y = x + 1
return y
end
# ReturnedModelWrapper(demo()) represents distribution over yDistributional
Sampleable <: Distributional:- Can be sampled from
- May not support logpdf computation
Extensions (To be implemented)
latent: (vis-a-visreturned)- Would view model in terms of its parameters rather than returns
- Example: For above model, would give distribution over
x
- Another subtype of
Distributionalthat supports sampling and computing logp - A high level user facing interface
to_distributionthat would create proper probability distributions with models- Could potentially work with both
returnedandlatent
- Could potentially work with both
Integration with NamedTupleVariate
Supporting NamedTupleVariate (#801) would give us a natural interface for to_distribution:
- Allowing model to be viewed as distributions over model parameters and their values.
- Notice
ProductNamedTupleDistributionis not sufficient, because it assumes independence - Limitation is that not all DynamicPPL models can use this interface, as some require the more complex VarName to value mapping rather than simple NamedTuples
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request