海口市公司网站建设,网络营销理论基础有哪些,wordpress系统取消自动更新,wordpress注册插件概念#xff1a;
CNN感受野
在卷积神经网络中#xff0c;决定某一层输出结果中的一个元素所对应的输入层的区域大小#xff0c;被称作感受野#xff08;receptive field#xff09;。通俗的解释是#xff0c;输出feature map上的一个单元对应输入层上的区域大小。
VGG…概念
CNN感受野
在卷积神经网络中决定某一层输出结果中的一个元素所对应的输入层的区域大小被称作感受野receptive field。通俗的解释是输出feature map上的一个单元对应输入层上的区域大小。
VGG结构 代码
model.py
配置
cfgs {vgg11: [64, M, 128, M, 256, 256, M, 512, 512, M, 512, 512, M],vgg13: [64, 64, M, 128, 128, M, 256, 256, M, 512, 512, M, 512, 512, M],vgg16: [64, 64, M, 128, 128, M, 256, 256, 256, M, 512, 512, 512, M, 512, 512, 512, M],vgg19: [64, 64, M, 128, 128, M, 256, 256, 256, 256, M, 512, 512, 512, 512, M, 512, 512, 512, 512, M],
} 字典文件每一个key代表的是模型的配置文件 含义 比如说vgg1164表示卷积核个数‘M’表示池化层的结构(maxpooling 提取特征网络
def make_features(cfg: list):layers []in_channels 3for v in cfg:if v M:layers [nn.MaxPool2d(kernel_size2, stride2)]else:conv2d nn.Conv2d(in_channels, v, kernel_size3, padding1)layers [conv2d, nn.ReLU(True)]in_channels vreturn nn.Sequential(*layers) 传入的是配置变量cfg是一个list类型。 **kwargs
def vgg(model_namevgg16, **kwargs):assert model_name in cfgs, Warning: model number {} not in cfgs dict!.format(model_name)cfg cfgs[model_name]model VGG(make_features(cfg), **kwargs)return model**kwargs,是传入的字典变量字典变量可能包含了分类的个数以及是否初始化权重的布尔变量 训练时间长效果也不好所以训练细节忽略。