1 PyTorch implementation of the AlexNet architecture featuring 5 convolutional and 3 fully connected layers. The code provides the structural definition for the 2012 ImageNet-winning model within the torch.nn framework.
Use Cases
- Perform transfer learning by replacing the final nn.Linear layer of the classifier to adapt to new image categories.
- Analyze gradient flow through the ReLU activation layers to study the vanishing gradient problem in early deep networks.
- Validate PyTorch environment setups by executing a forward pass with a dummy torch.Tensor of shape (N, 3, 224, 224).
Strengths
- Defines the 8-layer architecture using nn.Sequential blocks for feature extraction and classification.
- Specifies exact kernel sizes (e.g., 11x11, 5x5, 3x3) and strides as per the original 2012 publication.
- Includes nn.Dropout layers with a 0.5 probability to prevent overfitting during training.