当前位置:网站首页>PyTorch 9. 优化器
PyTorch 9. 优化器
2022-04-23 06:11:00 【DCGJ666】
PyTorch 9. 优化器
优化器
pytorch优化器:管理并更新模型中可学习参数的值,使得模型输出更接近真实标签
基本属性:
defaults: 优化器超参数
state: 参数的缓存,如momentum的缓存
param_groups: 管理的参数组
_step_count:记录更新次数,学习率调整中使用
操作:
zero_grad():清空所管理参数的梯度
step():执行一步更新
add_param_group():添加参数组
state_dict():获取优化器当前状态信息字典
load_state_dict():加载状态信息字典
- nn.optim.SGD
主要参数:
params:管理的参数组
lr:初始学习率
momentum:动量系数
weight_decay:L2正则化系数
nesterov:是否采用NAG,涅斯捷罗夫梯度优化方法 - nn.optim.Adagrad
自适应学习率梯度下降法 - nn.optim.RMSprop
Adagrad的改进 - nn.optim.Adam
RMSprop结合Momentum - nn.optim.AdamW
增加权重的adam
版权声明
本文为[DCGJ666]所创,转载请带上原文链接,感谢
https://blog.csdn.net/DCGJ666/article/details/121570643
边栏推荐
- 【点云系列】SG-GAN: Adversarial Self-Attention GCN for Point Cloud Topological Parts Generation
- PyTorch中的一些常见数据类型转换方法,与list和np.ndarray的转换方法
- PyMySQL连接数据库
- 第3章 Pytorch神经网络工具箱
- torch.mm() torch.sparse.mm() torch.bmm() torch.mul() torch.matmul()的区别
- Handlerthread principle and practical application
- 【点云系列】Neural Opacity Point Cloud(NOPC)
- DCMTK (dcm4che) works together with dicoogle
- 【2021年新书推荐】Practical Node-RED Programming
- 【2021年新书推荐】Professional Azure SQL Managed Database Administration
猜你喜欢
【点云系列】Pointfilter: Point Cloud Filtering via Encoder-Decoder Modeling
face_recognition人脸检测
[Point Cloud Series] SG - Gan: Adversarial Self - attachment GCN for Point Cloud Topological parts Generation
Machine learning III: classification prediction based on logistic regression
Gephi教程【1】安装
Use originpro express for free
Gephi tutorial [1] installation
机器学习 三: 基于逻辑回归的分类预测
【2021年新书推荐】Enterprise Application Development with C# 9 and .NET 5
Gee configuring local development environment
随机推荐
[3D shape reconstruction series] implicit functions in feature space for 3D shape reconstruction and completion
Pytorch模型保存与加载(示例)
ArcGIS License Server Administrator 无法启动解决方法
Binder mechanism principle
.net加载字体时遇到 Failed to decode downloaded font:
红外传感器控制开关
[point cloud series] a rotation invariant framework for deep point cloud analysis
1.2 初试PyTorch神经网络
Chapter 4 pytoch data processing toolbox
Minesweeping games
第2章 Pytorch基础1
Use originpro express for free
MySQL的安装与配置——详细教程
【指标】Precision、Recall
Pytorch best practices and coding style guide
5种方法获取Torch网络模型参数量计算量等信息
Pytoch model saving and loading (example)
MySQL5. 7 insert Chinese data and report an error: ` incorrect string value: '\ xb8 \ XDF \ AE \ xf9 \ X80 at row 1`
Markdown basic grammar notes
Chapter 1 numpy Foundation