예제 #1
0
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)))
예제 #2
0
 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)))
예제 #3
0
파일: alt_emd.py 프로젝트: daureg/illalla
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)))
예제 #4
0
 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)))