Skip to content

Issue with recent initval changes #4737

Closed
@ricardoV94

Description

@ricardoV94

I found some issues with the recent initval changes in #4729, as it doesn't respect the parents initvals.

This snippet often leads to a ValueError:

with pm.Model() as model:
    mu = pm.Normal('mu', initval=100)
    alpha = pm.HalfNormal('alpha', initval=100, transform=None)
    value = pm.NegativeBinomial('value', mu=mu, alpha=alpha)

model.initial_values
# {mu: array(100., dtype=float32),
#  alpha: array(100., dtype=float32),
#  value: array(1)}

When it doesn't fail, initval is still far from the expected ~ 100:

pm.NegativeBinomial.dist(mu=100, alpha=100).eval()
# array(98)

Originally posted by @ricardoV94 in #4734 (comment)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions