def solve_by_emd(): """Solve the problem where the whole mass must be moved.""" ltheta = DIM * [ 1, ] return emd((lP, fw1), (lQ, fw2), lambda a, b: float(dist_for_emd(a, b, ltheta)))
def regions_distance(r_features, r_weigths): if len(r_features) >= MAX_EMD_POINTS: return 1e20 return emd((query_num, map(float, weights)), (r_features, map(float, r_weigths)), lambda a, b: float(dist_for_emd(a, b, ltheta)))
def solve_by_emd(): """Solve the problem where the whole mass must be moved.""" ltheta = DIM*[1, ] return emd((lP, fw1), (lQ, fw2), lambda a, b: float(dist_for_emd(a, b, ltheta)))