'Parameters
input : tensor
output from the previous layer
deterministic : bool
If true, the arithmetic mean of lower and upper are used for the
leaky slope.'

def get_output_for(self, input, deterministic=False, **kwargs):

    if (deterministic or (self.upper == self.lower)):
        return theano.tensor.nnet.relu(input, ((self.upper + self.lower) / 2.0))
    else:
        shape = list(self.input_shape)
        if any(((s is None) for s in shape)):
            shape = list(input.shape)
        for ax in self.shared_axes:
            shape[ax] = 1
        rnd = self._srng.uniform(tuple(shape), low=self.lower, high=self.upper, dtype=theano.config.floatX)
        rnd = theano.tensor.addbroadcast(rnd, *self.shared_axes)
        return theano.tensor.nnet.relu(input, rnd)
