Skip to content

NUTS initialized with ADVI is not reproducible across multiple calls #5784

Closed
@ricardoV94

Description

@ricardoV94

This happens because ADVI compiles a function from the model RandomVariables which depend on shared RandomState/Generator variables that are updated in place and not reset.

There is currently no easy way to reseed these shared variables. There used to be something like this at some point in the V4 refactor, but it's gone. Probably it will be reintroduced by whatever fixes #5733.

This is also a limitation in prior and posterior predictive, as those functions can only be resampled with the same results if a whole Model is recreated with the original rng_seeder. This is "less of a problem" because those functions explicitly raise if a user tries to pass seeds, whereas these are still supported in sampling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    VIVariational Inferencebug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions