Exemplo n.º 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)))
Exemplo n.º 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)))
Exemplo n.º 3
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)))
Exemplo n.º 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)))