def computeEnvelope(self):
    """
    Compute an envelope for use in suppressing border cells.
    :return: A numpy array that can be elementwise-multiplied with activations
             for the given cell population to apply the envelope.
    """
    envelopeX = [1 if np.abs(p) < 1 - self.envelopeWidth else
                      np.exp(-1.*self.envelopeFactor *
                      ((np.abs(p) - 1 + self.envelopeWidth)/self.envelopeWidth)**2)
                      for p in np.linspace(-1, 1, self.dimensions[0])]

    envelopeY = [1 if np.abs(p) < 1 - self.envelopeWidth else
                      np.exp(-1.*self.envelopeFactor *
                      ((np.abs(p) - 1 + self.envelopeWidth)/self.envelopeWidth)**2)
                      for p in np.linspace(-1, 1, self.dimensions[1])]

    return np.asarray(np.outer(envelopeX, envelopeY).flatten())
Compute an envelope for use in suppressing border cells.
    :return: A numpy array that can be elementwise-multiplied with activations
             for the given cell population to apply the envelope.