![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
深度学习相关
###
A1chemist
这个作者很懒,什么都没留下…
展开
-
model.state_dict()与model.named_parameters
pytorch中模型参数访问方法有三种:model.state_dict(), model.named_parameters, model.named_parameters.三种方式有细微的差别:model.state_dict():返回的是字典对象,包含可学习与不可学习的所有参数,所以常常用来保存模型或者加载模型。model.named_parameters:返回的是可迭代对象,生成器中只保存了可学习、可被优化器更新的参数的参数名和具体的参数,常常用来锁住某些层的参数,让其在训练的时候不更新参数原创 2021-09-26 20:47:28 · 560 阅读 · 0 评论 -
ResNet代码解析
ResNet模型代码解析import torch.nn as nnimport torchclass BasicBlock(nn.Module): expassion = 1 def _init_(self, in_channel, out_channel, stride=1, downsample=None): super(BasicBlock,self).__init__() self.conv1 = nn.Conv2d(in_chann原创 2021-02-01 12:17:51 · 415 阅读 · 1 评论 -
VGG模型
resnet模型VGGResNetVGGimport torch.nn as nnimport torchclass VGG(nn.Module): def __init__(self, features, num_classes=1000, init_weights=False): super(VGG, self).__init__() self.features = features #此处为初始化特征提取网络,即传入make_features函数中生成原创 2021-01-04 22:14:57 · 264 阅读 · 0 评论 -
2020-08-17
本地下载安装torch地址:[link](https://download.pytorch.org/whl/torch_stable.html)原创 2020-08-17 14:45:58 · 82 阅读 · 0 评论