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.
Bu egzersiz
Introduction to Deep Learning with PyTorch
kursunun bir parçasıdırUygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# Model with Dropout
model = nn.Sequential(
nn.Linear(8, 6),
nn.Linear(6, 4),
____)
# Forward pass in training mode (Dropout active)
model.____
output_train = ____