def _updateLateralConnections(self, epsilon, avgActivityPairs):
    """
    Sets the weights of the lateral connections based on 
    average pairwise activity of the SP's columns. Intuitively: The more 
    two columns fire together on average the stronger the inhibitory
    connection gets. 
    """
    oldL = self.lateralConnections
    newL = avgActivityPairs.copy()
    np.fill_diagonal(newL, 0.0)
    newL = newL/np.sum(newL, axis=1, keepdims=True)

    self.lateralConnections[:,:] = (1 - epsilon)*oldL + epsilon*newL