You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cross-comp converted edges, then GGs, GGGs, etc, interlaced with exemplar selection: '''
27
27
iN_= []
28
28
forNinframe.subG_:
29
-
iN_+= [N] ifN.derH.Et[0] <ave*N.derH.Et[2] elseN.subG_# eval to unpack top N
29
+
iN_+= [N] ifN.derH.Et[0] <ave*N.derH.Et[2] elseN.subG_# eval to unpack top N (if we unpack N.subG_, their rim may not empty and will be used again in der+ fork later )
30
30
31
31
N_,L_,(m,d,mr,dr) =comp_node_(iN_) # cross-comp exemplars, extrapolate to exemplar.Rim?
32
32
ifm>ave*mr:
@@ -156,15 +156,16 @@ def prune_overlap(N_): # select Ns with M > ave * Mr
156
156
N.M-=_m# Rim is exclusive, vs N.Mr+=1?
157
157
for_refincopy(_N.Rim):
158
158
if_ref[0] isN: # reciprocal to ref
159
-
_N.Rim.remove(ref); N.M-=_m; break
159
+
_N.Rim.remove(_ref); _N.M-=_m; break# should be removing _ref here because ref is in N.rim instead of _N.rim
160
160
ifN.M>ave:
161
161
ifN.M>ave*10:
162
-
centroid_cluster(N) # refine N.Rim
163
-
exemplar_+= [N]
162
+
centroid_cluster(N, N_) # refine N.Rim
163
+
ifN.Rim: # N.Rim might be empty after the pruning
164
+
exemplar_+= [N]
164
165
165
166
returnexemplar_
166
167
167
-
defcentroid_cluster(N):
168
+
defcentroid_cluster(N, N_):
168
169
_Rim,_perim,_M=N.Rim, N.perim, N.M
169
170
170
171
dM=ave+1# refine Rim to convergence:
@@ -186,9 +187,16 @@ def centroid_cluster(N):
186
187
fRim=1; break
187
188
iffRim: # not in exclusive stronger _N.Rim
188
189
Rim.add(ref); M+=m
189
-
dM=M-_M
190
-
_node_,_peri_,_M=Rim, perim, M
190
+
# remove ref with _N in all other Ns
191
+
for__NinN_:
192
+
if__Nnotin [N, _N]:
193
+
for__refincopy(__N.Rim):
194
+
if__ref[0] is_N:
195
+
__N.Rim.remove(__ref)
196
+
__N.M-=__ref[1]
191
197
198
+
dM=M-_M
199
+
_node_,_perim,_M=Rim, perim, M
192
200
N.Rim, N.perim, N.M=list(Rim),list(perim), M# final cluster
193
201
194
202
N_=frame.subG_# should be complemented graphs: m-type core + d-type contour
0 commit comments