You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently use the following DynamicPPL syntax to support AutoDiff.
@modelfunctionf(N, ::Type{T}=Vector{Float64}) where {T}
a =T(undef, N)
a .~Normal()
m =sum(a)
o =T(undef, N)
o .~Normal(m, 1)
end
We still need the parametric type (..., ::Type{T}=Vector{Float64}) where {T} for operator-overloading approaches like ForwardDiff and ReverseDiff. However, this is no longer necessary for Mooncake, which is source-transformation-based.
There might be a way to work around such requirements for ForwardDiff and ReverseDiff by implementing a (simple) model (AST) expression transform similar to Mooncake's. Such an approach is a bit speculative at the moment, but it is worth considering to simplify the modelling syntax.
We currently use the following DynamicPPL syntax to support AutoDiff.
We still need the parametric type
(..., ::Type{T}=Vector{Float64}) where {T}
for operator-overloading approaches like ForwardDiff and ReverseDiff. However, this is no longer necessary for Mooncake, which is source-transformation-based.There might be a way to work around such requirements for ForwardDiff and ReverseDiff by implementing a (simple) model (AST) expression transform similar to Mooncake's. Such an approach is a bit speculative at the moment, but it is worth considering to simplify the modelling syntax.
cc @willtebbutt
The text was updated successfully, but these errors were encountered: