We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cff3fc2 commit 2c1479cCopy full SHA for 2c1479c
src/pixelator/graph/node_metrics.py
@@ -51,10 +51,10 @@ def compute_transition_probabilities(
51
if remove_self_loops and k > 1:
52
# Set diagonal of W to 0 if k > 1 for gi to avoid self-loops
53
W_out.setdiag(values=0)
54
- # Renormalize transition probabilities to sum to 1
55
- row_sums = np.array(W_out.sum(axis=1)).flatten()
56
- inv_row_sums = np.reciprocal(row_sums, where=row_sums != 0)
57
- W_out = W_out.multiply(inv_row_sums[:, np.newaxis])
+ # Renormalize transition probabilities to sum to 1
+ row_sums = np.array(W_out.sum(axis=1)).flatten()
+ inv_row_sums = np.reciprocal(row_sums, where=row_sums != 0)
+ W_out = W_out.multiply(inv_row_sums[:, np.newaxis])
58
59
return W_out
60
0 commit comments