Skip to content

Deprecate initval at the distribution level #7528

Open
@ricardoV94

Description

@ricardoV94

Description

initvals are not a real property of the model, but an aspect of the sampler. We already have a initvals kwarg in pm.sample that can be used to customize initial values when needed.

We can also allow extra kwargs to be passed from model.initial_point to make_initial_point_fn to allow the equivalent behavior of initval=x used in conjunction with model.initial_point()

Removing them would make our distribution and model objects simpler, and provide one consistent way of defining initvals.

On purpose, I did not make initvals part of the fgraph representation of models, which raises NotImplementedError when custom ones are set. This forces an error in utilities that make use of it: model.copy(), pm.observe, pm.do , etc...

If people really object to not removing them from the model, we have to go and make it part of the fgraph representation.
If we accept it, we should deprecate them for a while since they are an old API and used many times in conjunction with ordered transforms (which are mostly used because we don't have #7297 yet)

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenancemajorInclude in major changes release notes section

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions