Skip to content

Commit e96a8a9

Browse files
afrozenatorsvekars
andauthored
Fix CayleyMap's right_inverse, s/X/A (#2765)
This makes it correct. Co-authored-by: Svetlana Karslioglu <[email protected]>
1 parent 114320c commit e96a8a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

intermediate_source/parametrizations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ def forward(self, X):
306306
def right_inverse(self, A):
307307
# Assume A orthogonal
308308
# See https://en.wikipedia.org/wiki/Cayley_transform#Matrix_map
309-
# (X - I)(X + I)^{-1}
310-
return torch.linalg.solve(X + self.Id, self.Id - X)
309+
# (A - I)(A + I)^{-1}
310+
return torch.linalg.solve(A + self.Id, self.Id - A)
311311

312312
layer_orthogonal = nn.Linear(3, 3)
313313
parametrize.register_parametrization(layer_orthogonal, "weight", Skew())

0 commit comments

Comments
 (0)