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
It would be great if there was an easy interface to define a model without having to create a custom struct and wrap it in LogDensityModel. Its signature would be LogDensityModel(logpdf, D) and it would be something like
function LogDensityModel(logpdf, D)
struct LogTargetDensity
dim::Int
end
LogDensityProblems.logdensity(p::LogTargetDensity, θ) = logpdf(θ)
LogDensityProblems.dimension(p::LogTargetDensity) = p.dim
LogDensityProblems.capabilities(::Type{LogTargetDensity}) = LogDensityProblems.LogDensityOrder{0}()
model = AdvancedHMC.LogDensityModel(LogDensityProblemsAD.ADgradient(Val(:ForwardDiff), LogTargetDensity(D)))
end
With such interface the lengthy example from the README would become
But IMO this is not something we should put in AdvancedHMC.jl 😕 Probably would be better suited to go in LogDensityProblems.jl itself or maaaybe AbstractMCMC.jl or something like this. @devmotion thoughts?
It would be great if there was an easy interface to define a model without having to create a custom
struct
and wrap it inLogDensityModel
. Its signature would beLogDensityModel(logpdf, D)
and it would be something likeWith such interface the lengthy example from the README would become
The text was updated successfully, but these errors were encountered: