-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
The new VarInfo
#309 introduced many nice new features and significant performance improvements. However, it needs to be used with caution at the moment. For example, we can easily introduce spurious variables into SimpleVarInfo
which does not influence logdensity
evaluation, but would subtly change HMC behaviour (for good or bad). It is because the spurious variables (i.e. x[3:4]
) would introduce additional momentum variables. Since these variables do not have a prior on them, the sampling results would become slightly tricky to analyse.
julia> using DynamicPPL, StableRNGs, Distributions
julia> @model function demo()
m ~ Normal()
x = Vector{Float64}(undef, 2)
for i in eachindex(x)
x[i] ~ Normal()
end
return x
end
julia> _, vi = DynamicPPL.evaluate!!(m, SimpleVarInfo((x = ones(2), )), ctx);
julia> _, vi = DynamicPPL.evaluate!!(m, SimpleVarInfo((x = ones(4), )), ctx); # Note the spurious x variables x[3:4]
julia> vi
SimpleVarInfo((x = [-1.6438528680920432, 0.7944393211208289, 1.0, 1.0], m = 1.2973461452176338), -5.265062153308225)
Metadata
Metadata
Assignees
Labels
No labels