pytorch最新版本_pytorch linear
PyTorch 版本 最新 linear
2023-06-13 09:13:30 时间
大家好,又见面了,我是你们的朋友全栈君。
1.应用
import torch
import torch.nn as nn
loss = nn.MSELoss()
input = torch.tensor([1.0,1.0], requires_grad=True)
target = torch.tensor([7.0,9.0])
output = loss(input, target) # 50
output.backward()
2.概念
API
类
mean squared error (squared L2 norm)
CLASS torch.nn.MSELoss(size_average=None, reduce=None, reduction: str = 'mean')
参数 | 描述 |
---|---|
reduction (string, optional) | 默认为’mean’。‘mean’:求和取平均;‘sum’:只求和。 |
实例
参数 | 描述 |
---|---|
Input: (N, *) | where *∗ means, any number of additional dimensions |
Target: (N, *) | same shape as the input |
参考: https://pytorch.org/docs/stable/generated/torch.nn.MSELoss.html?highlight=mseloss#torch.nn.MSELoss
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/193067.html原文链接:https://javaforall.cn
相关文章
- 从零开始学Pytorch(十一)之ModernRNN
- PyTorch 中的数据类型 torch.utils.data.DataLoader
- OpenMMLAB系列框架解读(基于PyTorch)
- CNN实战(二):pytorch搭建CNN对猫狗图片进行分类
- pytorch tensorboard使用_铅球是什么体育X项目
- resnet18 pytorch_如何搭建服务器
- PyTorch 实现 ResNet34 分类(数据cifar10)「建议收藏」
- PyTorch-数据处理流程
- vggnet pytorch_Javaweb项目
- 登峰造极,师出造化,Pytorch人工智能AI图像增强框架ControlNet绘画实践,基于Python3.10
- PyTorch常用5个抽样函数
- 分离硬件和代码、稳定 API,PyTorch Lightning 1.0.0 版本正式发布
- 深度学习战争:Facebook 支持的 PyTorch 与 Google 的 TensorFlow