remove self loops in rag

This commit is contained in:
Vighnesh Birodkar
2014-08-18 18:42:23 +05:30
parent f7a7c1baa2
commit 12b1a91c70
3 changed files with 13 additions and 2 deletions
+2 -1
View File
@@ -115,7 +115,8 @@ def _add_edge_filter(values, graph):
values = values.astype(int)
current = values[0]
for value in values[1:]:
graph.add_edge(current, value)
if value != current:
graph.add_edge(current, value)
return 0