利用Pytorch复现VGG-16网络
利用Pytorch复现VGG-16网络: 根据吴恩达老师在深度学习课程中的讲解,AlexNet网络的基本流程为: 代码如下: import math import torch import torchvision import torch . nn as nn import torch . nn . functional as F import torchvision . models as models from torch . autograd import Variable class VGG16 ( nn . Module ) : def __init__ ( self , num_classes ) : super ( VGG16 , self ) . __init__ ( ) self . feature = nn . Sequential ( nn . Conv2d ( in_channels = 3 , out_channels = 64 , kernel_size = 3 , stride = 1 , padding = 1 ) , nn . ReLU ( inplace = True ) , nn . Conv2d ( in_channels = 64 , out_channels = 64 , kernel_size = 3 , stride = 1 ,