Skip to content

Support for Distributions.ProductNamedTupleDistribution #2659

@vboussange

Description

@vboussange

Hey there,
Would it be conceivable to have something like

using Turing
import Distributions: ProductNamedTupleDistribution, Uniform, InverseGamma

params_priors = ProductNamedTupleDistribution((m = Uniform(0, 1), s² = InverseGamma(2, 3)))

@model function gdemo(x)
    params ~ params_priors
    x ~ Normal(params.m, sqrt(params.s²))
end

chain = sample(gdemo(1.2), NUTS(), 1000, progress=false)

supported in Turing.jl at some point? This could be very helpful to handle e.g. Lux.jl models.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions