Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Fix for invalid numpy float indexing #6144

Merged
merged 1 commit into from
May 8, 2017
Merged
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
2 changes: 1 addition & 1 deletion example/dec/dec.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def cluster_acc(Y_pred, Y):
D = max(Y_pred.max(), Y.max())+1
w = np.zeros((D,D), dtype=np.int64)
for i in range(Y_pred.size):
w[Y_pred[i], Y[i]] += 1
w[Y_pred[i], int(Y[i])] += 1
ind = linear_assignment(w.max() - w)
return sum([w[i,j] for i,j in ind])*1.0/Y_pred.size, w

Expand Down