Skip to content

computation of logp_elemwise is slower than before #2480

@aloctavodia

Description

@aloctavodia

When working on the compare() function I noticed that computation of WAIC is now super-slow (compared to the last time I tried).

The problem is with the computation of logp_elemwise. I just run the following minimal example

x_obs = np.random.normal(0, 1, size=100)
with pm.Model() as model:
    mu = pm.Normal('mu', 0, 1)
    x = pm.Normal('x', mu=mu, sd=1, observed=x_obs)

The following test takes around 80 ms (using current master) and less than 1 ms using the latest release (3.1 final)

%timeit x.logp_elemwise({'mu': 0.})

Metadata

Metadata

Assignees

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