Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix factorization bijectors #274

Open
sethaxen opened this issue Jun 20, 2023 · 4 comments
Open

Matrix factorization bijectors #274

sethaxen opened this issue Jun 20, 2023 · 4 comments

Comments

@sethaxen
Copy link
Member

There are a number of bijective matrix factorizations that it might make sense to include here, e.g.

  • unique QR (usual QR but constraining the diagonal of R to be positive)
  • unique SVD: usual SVD but constraining the first row of U to be positive
  • polar decomposition (QP)
  • LU factorization (if matrix is square with linearly independent columns)
  • eigendecomposition (after fixing an eigenvalue sorting convention and eigenvector sign convention).
  • symmetric eigendecomposition

For each of these, the logdetjacs are known and can be efficiently computed. The factorizations are especially common in random matrix theory. e.g. applying the unique QR polar decomposition to a matrix of IID std normal parameters gives a Q that is uniform on the Stiefel manifold; for the polar decomposition sqrt(P) is Wishart-distributed.

@sethaxen
Copy link
Member Author

It probably makes sense for these bijectors to return a Factorization object but for their inverses to accept not only a Factorization but also an iterable of the factors. e.g. for unique QR, one needs to implement a new QR Factorization as well as an AbstractQ to enforce the sign convention. Since these might be of general interest, maybe it makes sense to make a UniqueFactorizations.jl package that only depends on LinearAlgebra, which could then be used in these bijectors.

@sethaxen
Copy link
Member Author

Or does it make more sense to in an extension to a UniqueFactorizations.jl package, overload the Bijectors interface for functions like UniqueFactorizations.qr? Is there anything in Bijectors expecting all bijectors are a Bijectors.Bijector subtype?

@sethaxen
Copy link
Member Author

@torfjelde @devmotion what do you think?

@torfjelde
Copy link
Member

Is there anything in Bijectors expecting all bijectors are a Bijectors.Bijector subtype?

Not really:) It really only lets you have a default implementation for stuff like inverse (which returns the lazy Bijectors.Inverse bijector).

You probably don't even need an extension (unless you want to hook it up to Distributions.jl using stuff like bijector); implementation of ChangesOfVariables.with_logabsdet_jacobian and InverseFunctions.inverse is sufficient to make it possible to use it with Bijectors.jl (but, as mentioned, for hooking into Distributions.jl, an extension might be the way to go).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants