-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
This is a summary issue of something floating around for quite some time.
We would like to be able to do this:
@model test(x) = begin
m1 ~ Normal()
@track m2 = f(m1) # some differentiable transformation
x ~ Normal(m2, 1.0)
endThe resulting chain should contain states for m1, m2 respectively.
Comments by @mohamed82008 how to approach this:
- Define a Deterministic distribution.
- Make sure getspace doesn't return any variable symbol whose dists field isa Vector{<:Deterministic}. This is the trickiest part.
- Define logpdf for Deterministic to return 0, rand to return the wrapped value and bijector to return Identity.
- Define assume for Deterministic such that it writes down the value wrapped in the RHS to vi[vn] calling ForwardDiff.value, ReverseDiff.value or Tracker.data on the wrapped value before writing it to vi[vn]. We should probably define DistributionsAD.value to unify these.
storopoli
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request