Skip to content

Commit

Permalink
double check manifold operations against Douik paper
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Zocca committed Jan 6, 2025
1 parent 62772fe commit aed67ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions doublystochastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,17 @@ def proj(self, x, z):
:param z: point to be projected
:return: point on the tangent
"""
# # solve A x = b in the least squares sense
# torch.linalg.lstsq(A, b).solution == A.pinv() @ b

# # Eqn B.9
alpha = lstsq(self.idm - x @ x.mT, (z - (x @ z.mT)) @ self.onesm).solution
a = (self.idm - x @ x.mT)
b = (z - (x @ z.mT)) @ self.onesm
alpha = a.mT @ b
# alpha = lstsq(self.idm - x @ x.mT, (z - (x @ z.mT)) @ self.onesm).solution
# # Eqn B.10
beta = z.mT @ self.onesm - x.mT @ alpha

return z - kron(alpha @ self.onesm + self.onesm @ beta, x)
prj = z - (alpha @ self.onesm + self.onesm @ beta) * x

return prj


def retr(self, x, v):
Expand Down
2 changes: 1 addition & 1 deletion mctorch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
learnRate = 2 * 1e-2
wStdev = 1e1 # weight std dev
adjKLargest = 3 # how many edges with largest weight to reconstruct
make_gif = True
make_gif = False
png_dpi = 120

# # cost matrix
Expand Down

0 comments on commit aed67ed

Please sign in to comment.