

def get_output_for(self, input, deterministic=False, **kwargs):
    input_mean = input.mean(self.axes)
    input_std = TT.sqrt((input.var(self.axes) + self.epsilon))
    use_averages = kwargs.get('batch_norm_use_averages', deterministic)
    if use_averages:
        mean = self.mean
        std = self.std
    else:
        mean = input_mean
        std = std
    update_averages = kwargs.get('batch_norm_update_averages', (not deterministic))
    if update_averages:
        running_mean = theano.clone(self.mean, share_inputs=False)
        running_std = theano.clone(self.std, share_inputs=False)
        running_mean.default_update = (((1 - self.alpha) * running_mean) + (self.alpha * input_mean))
        running_std.default_update = (((1 - self.alpha) * running_std) + (self.alpha * input_std))
        mean += (0 * running_mean)
        std += (0 * running_std)
    param_axes = iter(range((input.ndim - len(self.axes))))
    pattern = [('x' if (input_axis in self.axes) else next(param_axes)) for input_axis in range(input.ndim)]
    beta = (0 if (self.beta is None) else self.beta.dimshuffle(pattern))
    gamma = (1 if (self.gamma is None) else self.gamma.dimshuffle(pattern))
    mean = mean.dimshuffle(pattern)
    std = std.dimshuffle(pattern)
    normalized = (((input - mean) * (gamma * TT.inv(std))) + beta)
    return normalized

dataset/ETHPy150Open rllab/rllab/rllab/core/lasagne_layers.py BatchNormLayer.get_output_for/VarMisuse@91/120 `input_std`->`std`