We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04bb15b commit c764e99Copy full SHA for c764e99
intermediate_source/parametrizations.py
@@ -307,7 +307,8 @@ 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)
+ eps = 1e-6
311
+ return torch.linalg.solve(A + self.Id + eps * self.Id, self.Id - A)
312
313
layer_orthogonal = nn.Linear(3, 3)
314
parametrize.register_parametrization(layer_orthogonal, "weight", Skew())
0 commit comments