This is a PyTorch implementation of two ways of achieving differentiable reparameterization of matrices with orthogonal columns.
I developed this small side project while trying to implement Orthogonal and Householder Sylvester flows.
"DIOR" (cool name, right?) stands for "DIfferentiable ORthogonalization".
The iterative procedure:
where
Let
Here
Legend:
- Red: target orthogonal vectors
- Blue: fitted orthogonal vectors (always orthogonal!)
Here
The Householder reflection (also called the Householder transformation):
where
In the Sylvester flows paper, there was this quote: "It can be shown that any
@article{uhlig2001constructive,
title={Constructive ways for generating (generalized) real orthogonal matrices as products of (generalized) symmetries},
author={Uhlig, Frank},
journal={Linear Algebra and its Applications},
volume={332},
pages={459--467},
year={2001},
publisher={Elsevier}
}
This paper above contains a very important theorem on decomposing orthogonal matrices into Householder transformations.
Theorem 2. Every real orthogonal
Clearly,
Let's assume
Below are results from experiments in which I tried to "fit" a random orthogonal matrix (
Case 1 (
Case 2 (