当前位置:网站首页>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
边栏推荐
- 免费使用OriginPro学习版
- [dynamic programming] triangle minimum path sum
- Pymysql connection database
- MySQL notes 1_ database
- 【点云系列】SG-GAN: Adversarial Self-Attention GCN for Point Cloud Topological Parts Generation
- Component based learning (1) idea and Implementation
- Mysql database installation and configuration details
- Miscellaneous learning
- 1.1 pytorch and neural network
- Viewpager2 realizes Gallery effect. After notifydatasetchanged, pagetransformer displays abnormal interface deformation
猜你喜欢
Gephi tutorial [1] installation
MySQL installation and configuration - detailed tutorial
[2021 book recommendation] Red Hat Certified Engineer (RHCE) Study Guide
【点云系列】Neural Opacity Point Cloud(NOPC)
WebView displays a blank due to a certificate problem
MySQL数据库安装与配置详解
Raspberry Pie: two color LED lamp experiment
【2021年新书推荐】Learn WinUI 3.0
Machine learning III: classification prediction based on logistic regression
Machine learning II: logistic regression classification based on Iris data set
随机推荐
Viewpager2 realizes Gallery effect. After notifydatasetchanged, pagetransformer displays abnormal interface deformation
【点云系列】Learning Representations and Generative Models for 3D pointclouds
Chapter 2 pytoch foundation 2
Gephi tutorial [1] installation
Thanos.sh灭霸脚本,轻松随机删除系统一半的文件
GEE配置本地开发环境
最简单完整的libwebsockets的例子
torch.mm() torch.sparse.mm() torch.bmm() torch.mul() torch.matmul()的区别
Gee configuring local development environment
【点云系列】DeepMapping: Unsupervised Map Estimation From Multiple Point Clouds
第4章 Pytorch数据处理工具箱
【动态规划】不同的二叉搜索树
Migrating your native/mobile application to Unified Plan/WebRTC 1.0 API
常见的正则表达式
PaddleOCR 图片文字提取
How keras saves and loads the keras model
Gobang games
树莓派:双色LED灯实验
Visual Studio 2019安装与使用
c语言编写一个猜数字游戏编写