Skip to content

init_params doesn't work since v0.30.0 #2150

@Batmaev

Description

@Batmaev

It seems that the sample function ignores specified initial parameters. I provide them as sample(model, ..., init_params=...).

How to reproduce:

@model function model(y)
    mu ~ Flat()
    y ~ Normal(mu, 0.0001)
end

m = model(-94)

sample(m, NUTS(), 1, init_params = [-94])
# in v0.29.3: correctly outputs single sample with mu = -94
# in v0.30.0: outputs something random e.g. mu = -177.713

This is important because sometimes we have very narrow distribution, and the sampler may get stuck in a region with very low probability. Providing good starting point is the only way to sample something.

P.S. I use macOS and Julia 1.10.0

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