pyro-ppl / pyro

Deep universal probabilistic programming with Python and PyTorch
http://pyro.ai
Apache License 2.0
8.55k stars 987 forks source link

Use .entropy() methods in SVI #687

Open fritzo opened 6 years ago

fritzo commented 6 years ago

PyTorch distributions implements .entropy() methods for many distributions. The rejector branch sketches how to integrate these into Trace_ELBO. We should pull this out.

varenick commented 5 years ago

@fritzo I haven't found sketches of integrating .entropy() methods into Trace_ELBO here: https://github.com/pyro-ppl/pyro/blob/rejector-research/pyro/infer/trace_elbo.py ; is this issue still actual?

fritzo commented 5 years ago

@varenick This issue is still active, but I don't know where the .entropy() code was. I believe the best place to look is the more recent TraceMeanField_ELBO, but I believe the pure entropy term may be high variance. @martinjankowiak can you comment?

martinjankowiak commented 5 years ago

afaik we've already put most of the analytic entropy/KL logic we'd like into TraceMeanField_ELBO. however, this issue is still relevant insofar as certain combinations of things are not supported (e.g. analytic KLs + rao blackwellized score function gradients). on the other hand, if we were to really try to span a substantially larger space of interoperable SVI tricks, we'd probably want to rebase our entire implementation conceptually and introduce new abstractions, i.e. i suppose most of the lower hanging fruit in this direction is already implemented

varenick commented 5 years ago

@martinjankowiak Thanks for your reply! I'll probably look for another issue to contribute.

fritzo commented 5 years ago

Note the TODO for analytic entropy methods was refactored into Distribution.score_parts().