bayesiains / nflows

Normalizing flows in PyTorch
MIT License
845 stars 118 forks source link

add exp to transforms #63

Closed mdmould closed 1 year ago

mdmould commented 2 years ago

Implementation of exponential transform. Useful for, e.g., transforming from $\mathbb{R}$ to a one-side bounded domain $(a, \infty)$ or $(-\infty, a)$ via composition with an affine transform.

arturbekasov commented 2 years ago

Hey @mdmould,

Thanks for taking the time to open the PR.

The implementation LGTM. Could you also add Exp to NonlinearitiesTest?

Cheers,

Artur

mdmould commented 2 years ago

Hi @arturbekasov,

I've added Exp in the three lists of transforms in NonlinearitiesTest. It looks like the transforms are only called on numbers in $(0,1)$ so the test_inverse should be fine. I also added a domain test for the inverse, similar to TanhTest.

Cheers, Matt