Pytorch经典模型复现系列(一)分类网络:AlexNet
论文:ImageNet Classification with Deep Convolutional Neural Networks
复现代码:https://github.com/lvjian0706/CNN-repetition.git
网络简介
CNN的经典网络,发表于2012年,在ImageNet竞赛上以领先第二名10%的准确度夺得冠军。掀起了卷积神经网络在图像领域的热潮。
AlexNet共包含五个卷积层和三个全连接层;使用ReLu函数来增加模型的非线性能力;使用了Dropout来减小模型的过拟合。
模型中使用了局部响应归一化层(LRN)来提高精度(LRN在现在的网络中已经基本不用了);同时采用双GPU并行的方式提高训练速度。
网络结构
Pytorch复现代码
import torch
import torch.nn as nn
class AlexNet(nn.Module):
def __init__(self, num_classes=1000):
super(AlexNet, self).__init__(