pymc-devs / nutpie

Python wrapper for nuts-rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Model compile fails with uniform RV

fonnesbeck opened this issue · comments

Running nutpie 0.4.0 on macOS, I get compile failures when trying to compile a model with a uniform RV (or presumably any interval-constrained RV):

with pm.Model() as mod:
    rho = pm.Uniform("rho", -1, 1)
compiled_model = nutpie.compile_pymc_model(mod)
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~/phillies/pie/research/projections/pitchers/pitcher_proj.py in <module>
----> 1 compiled_model = nutpie.compile_pymc_model(mod)

~/GitHub/nutpie/nutpie/compile_pymc.py in compile_pymc_model(model, **kwargs)
    119     """Compile necessary functions for sampling a pymc model."""
    120 
--> 121     n_dim, logp_fn_at, logp_fn, expand_fn, shared_expand, shape_info = _make_functions(
    122         model
    123     )

~/GitHub/nutpie/nutpie/compile_pymc.py in _make_functions(model)
    212 
    213         joined_names.append(value_var.name)
--> 214         shape = shapes[value_var.name]
    215         joined_shapes.append(shape)
    216         length = prod(shape)

KeyError: 'rho_interval__'

bumped into this too!

Is this using main pymc, before the pytensor switch? If so, I think this might be due to a small recent change in aesara.
If so, maybe we fix this on pytensor?

Should be fixed by #20, with dev version of pymc and pytensor.