Auto-differentiable numerical inverse & efficient materialization of BNAF masks#234
Conversation
…o turn off custom jvp warning preventing autodiff of inverter
… inverse (numerical) transformation
|
Nice! Cheers. I'm a bit busy at the moment but will try to check it out before the end of the week. |
danielward27
left a comment
There was a problem hiding this comment.
Thank you so much again for the contribution! It looks good to me, I've just left some comments with some minor suggestions, let me know what you think.
| bijection: AbstractBijection, | ||
| inverter: Callable[[AbstractBijection, Array, Array | None], Array], | ||
| diffable_inverter: bool = False, | ||
| raise_old_error: bool = False, |
There was a problem hiding this comment.
I think we can remove the raise_old_error. If we don't bother using the legacy behavior for a deprecation cycle then we should probably just not bother including it to simplify the code a bit.
There was a problem hiding this comment.
This make sense; I've removed this flag. Should we also remove the staticmethod that replicates the old wrapper? (_wrap_inverter_with_error_on_grad)
There was a problem hiding this comment.
Nice thanks! I'll merge this and remove _wrap_inverter_with_error_on_grad in a separate commit. I don't think it should be needed.
…fferentation flag; remove unused make_layer in BlockAutoregressiveNetwork __init__
…r `raise_old_error` flag
|
Just wanted to follow-up here and record for future reference; the publication for which I developed this feature is now on the arXiv! |
Here, we make two updates which are particularly relevant for block-neural autoregressive flows:
NumericalInversetransforms.lineaxas a dependency for memory-efficient computation of the JVP.block_neural_autoregressive_flowand the default greedy bisection search (in a publication to be on the arxiv in the next week or two).nn_block_dim.block_diag_maskandblock_tril_mask, and reimplemented these with kronecker products.test_masks.pyLet me know what you think, happy to answer any questions and take any feedback!