The Same Activation, Two Different Outputs

Statistics for Deep LearningHard+30 XP+30

The Same Activation, Two Different Outputs

One neuron in a deep network is followed by a Batch Normalization layer whose learned parameters are

γ=3.0,β=−0.5\gamma = 3.0, \qquad \beta = -0.5γ=3.0,β=−0.5

Entering this training step, the layer is carrying the running estimates

μrun=6.0,σrun2=13.0\mu_{\text{run}} = 6.0, \qquad \sigma^{2}_{\text{run}} = 13.0μrun​=6.0,σrun2​=13.0

1. The training step. A mini-batch of m=4m = 4m=4 examples reaches this neuron with pre-normalization activations

x=[ 1.0,  7.0,  9.0,  15.0 ]\mathbf{x} = [\,1.0,\; 7.0,\; 9.0,\; 15.0\,]x=[1.0,7.0,9.0,15.0]

In training mode the layer standardizes with the mini-batch's own statistics:

μB=1m∑i=1mxi,σB2=1m∑i=1m(xi−μB)2\mu_B = \frac{1}{m}\sum_{i=1}^{m} x_i, \qquad \sigma_B^{2} = \frac{1}{m}\sum_{i=1}^{m}\left(x_i - \mu_B\right)^{2}μB​=m1​∑i=1m​xi​,σB2​=m1​∑i=1m​(xi​−μB​)2

x^=x−μBσB2+ϵ,y=γ x^+β\hat{x} = \frac{x - \mu_B}{\sqrt{\sigma_B^{2} + \epsilon}}, \qquad y = \gamma\,\hat{x} + \betax^=σB2​+ϵ​x−μB​​,y=γx^+β

Take ϵ=0\epsilon = 0ϵ=0 throughout.

2. The running-statistics update. Once the batch statistics are computed, the layer refreshes both running estimates with momentum α=0.25\alpha = 0.25α=0.25:

μrun←(1−α) μrun+α μB,σrun2←(1−α) σrun2+α σB2\mu_{\text{run}} \leftarrow (1-\alpha)\,\mu_{\text{run}} + \alpha\,\mu_B, \qquad \sigma^{2}_{\text{run}} \leftarrow (1-\alpha)\,\sigma^{2}_{\text{run}} + \alpha\,\sigma_B^{2}μrun​←(1−α)μrun​+αμB​,σrun2​←(1−α)σrun2​+ασB2​

3. The evaluation step. Training then stops and the model is switched to evaluation mode. An input arrives that produces the same pre-normalization activation at this neuron, x=15.0x = 15.0x=15.0. In evaluation mode the layer substitutes its running estimates for the batch statistics; γ\gammaγ and β\betaβ are unchanged.

Let ytrainy_{\text{train}}ytrain​ be this layer's output for x=15.0x = 15.0x=15.0 during the training step, and yevaly_{\text{eval}}yeval​ its output for x=15.0x = 15.0x=15.0 in evaluation mode.

What is yeval−ytrainy_{\text{eval}} - y_{\text{train}}yeval​−ytrain​?

Round your answer to 3 decimal places.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.