Experimenting with dropout
Dropout helps prevent overfitting by randomly setting some output values to zero during training. In this exercise, you'll build a simple neural network with dropout and observe how it behaves in training and evaluation modes.
torch.nn package is preloaded as nn, and features is already defined for you.
Deze oefening maakt deel uit van de cursus
Introduction to Deep Learning with PyTorch
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Model with Dropout
model = nn.Sequential(
nn.Linear(8, 6),
nn.Linear(6, 4),
____)
# Forward pass in training mode (Dropout active)
model.____
output_train = ____