nflows icon indicating copy to clipboard operation
nflows copied to clipboard

Checkerboard masking in RealNVP

Open Donglin-Wang2 opened this issue 4 years ago • 2 comments

Hi,

Since the CouplingTransform class in nflows.transforms.coupling module only supports a 1-d mask that splits data along the channel dimension, I am wondering how I would go about implementing the alternating checkerboard mask in the RealNVP paper? Should I used the MaskedAffineAutoregressiveTransform in the nflows.transforms.autoregressive instead? Or are there some other methods or classes that I am not aware of?

Also, thank you so much for providing such a clean implementation of flow models in PyTorch!

Sincerely, Donglin Wang

Donglin-Wang2 avatar Aug 04 '21 15:08 Donglin-Wang2

Hey Donglin. Nope, unfortunately the checkerboard masking isn't implemented. I'll keep this issue around in case you (or someone else) want to implement it. Cheers, Artur

arturbekasov avatar Sep 11 '22 15:09 arturbekasov

We do have a RealNVP implementation with 1D checkerboard masking, though: https://github.com/bayesiains/nflows/blob/master/nflows/flows/realnvp.py#L17

arturbekasov avatar Sep 11 '22 15:09 arturbekasov