Dropout deletes a random slice of a layer's activations on every training step, so the network can't lean on any one unit. At test time nothing is dropped — which creates a problem: the layer downstream suddenly sees a much larger sum than it did during training.
Inverted dropout solves it during training instead of after. Surviving activations are scaled up by 1 / (1 - drop_prob), so the expected total stays the same and inference needs no adjustment at all.
Task: write apply_dropout(activations, mask, drop_prob), where mask holds 1 for a unit that survives and 0 for one that's dropped. Return the resulting activations, rounded to 4 decimal places.
drop_prob = 0.0 scales by 1 and changes nothing.drop_prob = 1.0 drops everything; return all zeros rather than dividing by zero.Because the scaling lives in the training path, the deployed model is just the plain network. That's the entire reason inverted dropout won over the original formulation, which rescaled at test time and made inference depend on a training hyperparameter.