(self, A)
| 304 | return torch.linalg.solve(self.Id - X, self.Id + X) |
| 305 | |
| 306 | def right_inverse(self, A): |
| 307 | # Assume A orthogonal |
| 308 | # See https://en.wikipedia.org/wiki/Cayley_transform#Matrix_map |
| 309 | # (A - I)(A + I)^{-1} |
| 310 | return torch.linalg.solve(A + self.Id, self.Id - A) |
| 311 | |
| 312 | layer_orthogonal = nn.Linear(3, 3) |
| 313 | parametrize.register_parametrization(layer_orthogonal, "weight", Skew()) |
nothing calls this directly
no outgoing calls
no test coverage detected