TuringLang / Bijectors.jl

Implementation of normalising flows and constrained random variable transformations
https://turinglang.org/Bijectors.jl/
MIT License
200 stars 33 forks source link

Rewrite: removing dimensionality and allow non-bijective transformations #183

Closed torfjelde closed 1 year ago

torfjelde commented 3 years ago

This is a draft for a proper overhaul of Bijectors.jl

Goals with this PR are:

  1. [ ] Remove the annoying dimensionality by being explict about when we're working with a collection of inputs vs. single input.
    • Also removes the restriction that input and output of bijectors should be the same size, type, etc.
  2. [ ] Allow more than just bijectors (differentiable bijections with differentiable inverses).
    • Releated issues: #58
  3. [ ] Resolve some simpler but outstanding issues:
    • 41

    • 159

  4. [ ] We have a lot of hacks in this package to make AD work across the board. Some of these vanish due to (1), but I'm also taking this opportunity to try to check what we actually need and what we can get rid of due to improvements upstream.
  5. [ ] Add support for mutating methods, e.g. transform!, logabsdetjac!.
  6. [ ] Add a bunch of sane default implementations, e.g. mutating versions, batched versions, etc.

Also, this is likely to result end up including a lot of changes, so we might end up splitting this into multiple PRs once it becomes more than a draft. But for now it's all here.

yebai commented 2 years ago

Let's perhaps make a push to finish the work here. @torfjelde

yebai commented 1 year ago

@torfjelde do we still need this after #214?

torfjelde commented 1 year ago

No this can be closed:)