zuko icon indicating copy to clipboard operation
zuko copied to clipboard

Requested flow architectures

Open francois-rozet opened this issue 2 years ago • 4 comments

Description

This issue tracks the flow/transformation architectures that are requested and/or implemented. You are welcome to request new architectures. If you wish to contribute to Zuko, this list is the perfect place to start.

Typically, implementing a new flow architecture consists in adding a new transformation in zuko/transforms.py and a new class in the zuko/flows/ directory. NSF and SOSPF are great examples. Sometimes, a special LazyTransform needs to be implemented to take into account the specificities of the architecture. NAF and GF are such examples.

List of requested flows

francois-rozet avatar Nov 03 '23 19:11 francois-rozet

Hello François, thank you for developing, releasing and maintaining zuko, it's an incredible package. Two missing flows that could be added to the list are

bhvieira avatar Oct 08 '25 08:10 bhvieira

Hi @bhvieira, thank you for the kind words and suggestions! I have added the Sylvester flow to the list. I believe the idea of using LU-decomposition for invertible linear layers comes from Kingma et al. (2018) and later re-used by Durkan et al. (2019). LULinearTransform is already implemented in Zuko actually. However, it could likely be improved by using torch.linalg.lu_factor and torch.linalg.lu_solve.

francois-rozet avatar Oct 08 '25 14:10 francois-rozet

LU-Net does not actually solve the LU decomposition, it's just based on composing two linear layers: one lower triangular and the other upper triangular. The inverse is based on solving a system of linear equations.

bhvieira avatar Oct 09 '25 07:10 bhvieira

Kingma et al. (2018) and Durkan et al. (2019) do exactly what you describe: they parameterize a linear transformation with triangular matrices $L$ and $U$ (and permutation $P$). They can inverse these transformations efficiently because $L$ and $U$ are triangular. The only time the LU-decomposition is performed is at the initialization of the network.

francois-rozet avatar Oct 09 '25 16:10 francois-rozet