Skip to content

Commit 40cb015

Browse files
committed
removed 1 hop experimental code. Will revisit
1 parent 792d07f commit 40cb015

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

graphtools/graphs.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,18 +1300,16 @@ def build_landmark_op(self):
13001300
# operation uses efficient sparse matrix multiplication.
13011301
# ============================================================
13021302

1303-
with _logger.log_task("extract landmark submatrices"):
1304-
# Extract kernel rows for landmarks directly (no aggregation)
1305-
# For random landmarking, each cluster = one sample, so no summing needed
1306-
pmn = self.kernel[L, :] # Shape: (n_landmark, n_samples)
1307-
1308-
with _logger.log_task("normalization"):
1309-
# Match exact normalization order from original working code
1310-
pnm = pmn.transpose() # Shape: (n_samples, n_landmark)
1311-
pmn = normalize(pmn, norm="l1", axis=1) # Row normalize: landmark→data transitions
1312-
pnm = normalize(pnm, norm="l1", axis=1) # Row normalize: data→landmark transitions
1313-
1314-
with _logger.log_task("landmark operator multiplication"):
1303+
# Extract kernel rows for landmarks directly (no aggregation)
1304+
# For random landmarking, each cluster = one sample, so no summing needed
1305+
pmn = self.kernel[L, :] # Shape: (n_landmark, n_samples)
1306+
1307+
# Match exact normalization order from original working code
1308+
pnm = pmn.transpose() # Shape: (n_samples, n_landmark)
1309+
pmn = normalize(pmn, norm="l1", axis=1) # Row normalize: landmark→data transitions
1310+
pnm = normalize(pnm, norm="l1", axis=1) # Row normalize: data→landmark transitions
1311+
1312+
with _logger.log_task("landmark to landmark operator"):
13151313
# Compute two-hop transitions: landmark → data → landmark
13161314
# Uses sparse matrix multiplication if kernel is sparse
13171315
landmark_op = pmn.dot(pnm)

0 commit comments

Comments
 (0)