pyro-ppl / funsor

Functional tensors for probabilistic programming
https://funsor.pyro.ai
Apache License 2.0
236 stars 20 forks source link

Refactor ops to allow non-funsor parameters #491

Closed fritzo closed 3 years ago

fritzo commented 3 years ago

Addresses #489 partly pair coded with @eb8680

This major op refactoring aims to unblock @ordabayevy in #477 and #482 by allowing ops to have arbitrary *arg,**kwarg parameters. Changes include:

Tested

fritzo commented 3 years ago

@eb8680 finally got the tests to pass 😓

fehiepsi commented 3 years ago

For some reason, I am getting

E       AttributeError: 'DirichletMultinomial' object has no attribute 'data'

in NumPyro test/test_handlers.py::test_collapse_beta_binomial. The instance DirichletMultinomial has the value

DirichletMultinomial(concentration=[1.5 0.5], total_count=10.0, value=Finitary(stack, (Tensor(7.0, OrderedDict(), 'real'), Number(3.0))))
fritzo commented 3 years ago

@eb8680, @fehiepsi's issue with DirichletMultinomial sounds related to the lazy test we disabled. Do you think we should try to get that working again?

fehiepsi commented 3 years ago

Yeah, enabling it raises two errors

but it seems to me refactoring of stack is more relevant.