Ejemplo n.º 1
0
def max_dist(som):
    """calculate maximum distance between code vectors"""
    max_distance = 0
    for q in som.nodes:
        for i in som.nodes:
            d = SOM.vector_distance(q.weights, i.weights)
            if d > max_distance:
                max_distance = d
    return max_distance
Ejemplo n.º 2
0
def max_dist(som):
    """calculate maximum distance between code vectors"""
    max_distance = 0
    for q in som.nodes:
        for i in som.nodes:
            d = SOM.vector_distance(q.weights, i.weights)
            if d > max_distance:
                max_distance = d
    return max_distance
Ejemplo n.º 3
0
def normalized_distance(n1, n2, max_dist):
    return SOM.vector_distance(n1.weights, n2.weights) * MAX_NORMALIZED_DISTANCE / max_dist
Ejemplo n.º 4
0
def normalized_distance(n1, n2, max_dist):
    return SOM.vector_distance(n1.weights,
                               n2.weights) * MAX_NORMALIZED_DISTANCE / max_dist