def __initialize_distances(self, size, location):
sqrt_distances = [ [ [] for i in range(size) ] for j in range(size) ]<EOL>for i in range(size):<EOL><INDENT>for j in range(i, size, <NUM_LIT:1>):<EOL><INDENT>dist = euclidean_distance_square(location[i], location[j])<EOL>sqrt_distances[i][j] = dist<EOL>sqrt_distances[j][i] = dist<EOL><DEDENT><DEDENT>return sqrt_distances<EOL>
!
        @brief Initialize distance matrix in SOM grid.

        @param[in] size (uint): Amount of neurons in the network.
        @param[in] location (list): List of coordinates of each neuron in the network.

        @return (list) Distance matrix between neurons in the network.