37
$\begingroup$

What is the difference between dropout and drop connect?

AFAIK, dropout randomly drops hidden nodes during training but keeps them in testing, and drop connect drops connections.

But isn't dropping connections equivalent to dropping the hidden nodes? Aren't the nodes (or connections) just a set of weights?

$\endgroup$
0

3 Answers 3

41
$\begingroup$

DropOut and DropConnect are both methods intended to prevent "co-adaptation" of units in a neural network. In other words, we want units to independently extract features from their inputs instead of relying on other neurons to do so.

Suppose we have a multilayered feedforward network like this one (the topology doesn't really matter). We're worried about the yellow hidden units in the middle layer co-adapting.

sample 5-4-3 network

DropOut

To apply DropOut, we randomly select a subset of the units and clamp their output to zero, regardless of the input; this effectively removes those units from the model. A different subset of units is randomly selected every time we present a training example.

Below are two possible network configurations. On the first presentation (left), the 1st and 3rd units are disabled, but the 2nd and 3rd units have been randomly selected on a subsequent presentation. At test time, we use the complete network but rescale the weights to compensate for the fact that all of them can now become active (e.g., if you drop half of the nodes, the weights should also be halved).

DropOut examples

DropConnect

DropConnect works similarly, except that we disable individual weights (i.e., set them to zero), instead of nodes, so a node can remain partially active. Schematically, it looks like this:

DropConnect

Comparison

These methods both work because they effectively let you train several models at the same time, then average across them for testing. For example, the yellow layer has four nodes, and thus 16 possible DropOut states (all enabled, #1 disabled, #1 and #2 disabled, etc).

DropConnect is a generalization of DropOut because it produces even more possible models, since there are almost always more connections than units. However, you can get similar outcomes on an individual trial. For example, the DropConnect network on the right has effectively dropped Unit #2 since all of the incoming connections have been removed.

Further Reading

The original papers are pretty accessible and contain more details and empirical results.

$\endgroup$
3
  • $\begingroup$ Might a naive question, but how a network differentiates between a neuron with output 0 and a dropped-out neuron (this neuron might output non-zero value but due to dropout it outputs 0). Imaging you are a neuron and you are receiving the output from the previous layer. Whether it was dropped out to 0 or 0 (without dropout) it doesn't make any difference at all. $\endgroup$
    – ado sar
    Commented Jun 25 at 19:57
  • $\begingroup$ It doesn't! The idea is that you're sort of training a superposition of networks where that connection is sometimes a "true" zero and sometimes it's dropped out. Either way, it forces the neuron to not depend exclusively on the maybe-dropped unit/connection. The only catch is that you need to rescale the weights at test time because you now have many more contributions to each unit. $\endgroup$ Commented Jul 3 at 16:07
  • $\begingroup$ I think there is a small difference during backprop with a dropped out neuron and a neuron that outputs 0. The former, doesn't backprop since dropout acts like a "switch" for the gradients. The latter, can still backprop (assuming that not all $x_i$'s of the input vector $\mathbf{x}$ are 0). $\endgroup$
    – ado sar
    Commented Jul 4 at 11:41
11
$\begingroup$

Yes, but they are slightly different in terms of how the weights are dropped.

These are the formulas of DropConnect (left) and dropout (right).

enter image description here enter image description here

So dropout applies a mask to the activations, while DropConnect applies a mask to the weights.

The DropConnect paper says that it is a generalization of dropout in the sense that

DropConnect is the generalization of Dropout in which each connection, instead of each output unit as in Dropout, can be dropped with probability p.

$\endgroup$
0
$\begingroup$

Based on what I saw on Tensorflow 2.5. From the workflow tf.keras.layer.Dropout to tf.python.ops.nn_ops.py function dropout and dropout_v2 (Line 5059 -> 5241), The code does not adjust the shape of the input layer but to mask and do matmul instead with a mask of 0 and 1 to gain speed of continuous vector/matrix/tensor, which is compatible as DropConnect. In another word, although not completely guarantee, the real implementation of Dropout is to fit with the real-world problem (training speed). By the way, the idea of Dropout is just a general scheme (removing neuron unit of a FC layer). Matt Krause has already well explained it

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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