def _calculate_influence(self, neighborhood):
        """
        Pre-calculate the influence for a given value of sigma.

        The neighborhood has size num_neurons * num_neurons, so for a
        30 * 30 map, the neighborhood will be size (900, 900).

        Parameters
        ----------
        neighborhood : float
            The neighborhood value.

        Returns
        -------
        neighborhood : numpy array
            The influence from each neuron to each other neuron.

        """
        grid = np.exp(-self.distance_grid / (neighborhood ** 2))
        return grid.reshape(self.num_neurons, self.num_neurons)[:, :, None]
def _calculate_influence ( self , neighborhood ) : grid = np . exp ( - self . distance_grid / ( neighborhood ** 2 ) ) return grid . reshape ( self . num_neurons , self . num_neurons ) [ : , : , None ]
Pre-calculate the influence for a given value of sigma.

        The neighborhood has size num_neurons * num_neurons, so for a
        30 * 30 map, the neighborhood will be size (900, 900).

        Parameters
        ----------
        neighborhood : float
            The neighborhood value.

        Returns
        -------
        neighborhood : numpy array
            The influence from each neuron to each other neuron.