Skip to content

Bug in permutation with new indices. #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions lib/coarsening.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,12 @@ def perm_data(x, indices):
Mnew = len(indices)
assert Mnew >= M
xnew = np.empty((N, Mnew))
for i,j in enumerate(indices):
# Existing vertex, i.e. real data.
if j < M:
xnew[:,i] = x[:,j]
# Fake vertex because of singeltons.
# They will stay 0 so that max pooling chooses the singelton.
# Or -infty ?
else:
xnew[:,i] = np.zeros(N)
for new_node_1, old_node_1 in enumerate(indices):
for new_node_2, old_node_2 in enumerate(indices):
if old_node_1 < N and old_node_2 < M :
xnew[new_node_1, new_node_2] = x[old_node_1, old_node_2]
else:
xnew[new_node_1, new_node_2] = 0
return xnew

def perm_adjacency(A, indices):
Expand Down