8
$\begingroup$

When applying dropout in artificial neural networks, one needs to compensate for the fact that at training time a portion of the neurons were deactivated. To do so, there exist two common strategies:

  • scaling the activation at test time
  • inverting the dropout during the training phase

The two strategies are summarized in the slides below, taken from Standford CS231n: Convolutional Neural Networks for Visual Recognition.

Which strategy is preferable, and why?


Scaling the activation at test time:

enter image description here

Inverting the dropout during the training phase:

enter image description here

$\endgroup$
  • $\begingroup$ Why should we scale $\frac{1}{p}$ instead of $\frac{1}{1-p}$ ? My intuition is that the more the dropout, the more we should compensate, right? Look at the relation of dropout rate to rescale factor: $dropout-> \frac{1}{p} -> \frac{1}{1-p}$ <br><br> $0.2 -> 5 -> 1.25$ <br><br> $0.5 -> 2 -> 2$ <br><br> $0.8 -> 1.25 -> 5$ <br><br> $\endgroup$ – Ken Chan Apr 25 '17 at 5:41
5
$\begingroup$

"inverting the dropout during the training phase" should be preferable.

Theoretically if we see Bernoulli dropout as a method of adding noise to the network, it's better that the noise could have a zero mean. If we do the scaling at training time to cancel out the portion of deactivated units, the mean of the noise would be zero.

There are other types of dropout/noise methods came out later (e.g. Gaussian multiplicative dropout, Gaussian additive noise) that also possess a zero mean.

In terms of training and testing neural networks in practice, there a reason to prefer such implementation as well. Say I want to compare the performance of two models with the same architecture, one is trained by dropout and one is not.

If I "scale the activation at test time", then I'll need two different networks at test time. If I use the "inverted version" then I could just apply the same test network (code) to both sets of trained parameters.

$\endgroup$
  • $\begingroup$ Let me make sure I'm understanding correctly: the non-inverted dropout-trained model would actually have a different architecture, because it would need to implement the multiplication by p at each layer? So the computer sees it as topologically different? $\endgroup$ – Eric Auld Feb 18 '18 at 0:40
  • $\begingroup$ @EricAuld hi sorry for the late reply, yes that's basically what i meant, just by "apply the same test network" i meant you won't need to change the code. $\endgroup$ – dontloo Feb 23 '18 at 5:28
3
$\begingroup$

Another advantage of doing the inverted dropout (besides not having to change the code at test time) is that during training one can get fancy and change the dropout rate dynamically. This has been termed as "annealed" dropout. Essentially the logic is that adding dropout "noise" towards the beginning of training helps to keep the optimization from getting stuck in a local minimum, while letting it decay to zero in the end results in a finer tuned network with better performance.

ANNEALED DROPOUT TRAINING OF DEEP NETWORKS

Modified Dropout for Training Neural Network

$\endgroup$
1
$\begingroup$

Andrew made very good explanation in his Deep Learning course on this session Dropout Regularization:

  • Inverted dropout is more common because it makes the testing much easier
  • The purpose of the inverting is to assure that the Z value will not be impacted by the reduce of W.

Say a3 = a3 / keep_prob at the last step of implementation:

Z[4] = W[4] * a[3] + b[4] , the element size of a[3] has been reduced by keep_prob from D3(a percentage of elements have been dropped out by D3), thus the value of Z[4] is also gonna be reduced, so to compensate this roughly we shall invert the change by dividing keep_prob to make sure the value of Z[4] will not be impacted.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.