Skip to content

Submodel regression with pointwise_logdensities #752

@penelopeysm

Description

@penelopeysm
using DynamicPPL, Distributions

ctx = DynamicPPL.PointwiseLogdensityContext(OrderedDict{VarName,Vector{Float64}}(), PriorContext())

@model inner() = x ~ Normal()

@model function outer()
    _s ~ to_submodel(inner())
end
model = outer()
model(VarInfo(model), ctx)

# ERROR: MethodError: no method matching assume(::DynamicPPL.Sampleable{…}, ::VarName{…}, ::TypedVarInfo{…})
# The function `assume` exists, but no method is defined for this combination of argument types.

This doesn't happen with other contexts e.g. DefaultContext, PriorContext or SamplingContext.

This is a regression:

@model function outer_old()
    @submodel _s = inner()
end
model_old = outer_old()
model_old(VarInfo(model_old), ctx)

# 0.9991940907841761

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions