当前位置:网站首页>pytorch框架学习(2)使用GPU训练
pytorch框架学习(2)使用GPU训练
2022-08-10 05:29:00 【Time.Xu】
使用GPU进行训练&常见的Tensor&Hub模块
需要将数据和模型传入到CUDA里进行运算。
在代码上:
与传统的不同的是我们需要指定一个设备,这个设备就是设定为cuda:0
需要把模型放置到我们设定的设备中(CUDA中) .to(设备)
需要把数据放置到我呢设定的设备中(CUDA中) .to(设备)

常见的Tensor有哪些形式
| 形式 | 备注 | 代码&注释 |
|---|---|---|
| Scalar | 数值 | dim是0,标量 |
| Vector | 向量 | dim是1,在深度学习中通常指特征,例如词向量,某一个维度的特征等 |
| matrix | 矩阵 | dim是2,一行就是一个向量。可以认为每一行是每一个人,每一列是同一种特征。 矩阵能做乘法能做内积 |
| n-dimensal tensor | 高维张量 | Aijk… |
强大的Hub模块
Hub是为了方便开发者调用已有的代码,是一个model zoo
torch.hub.load()
学习一般不用这个
边栏推荐
- Shell编程三剑客之awk
- 基于Qiskit——《量子计算编程实战》读书笔记(三)
- oracle rac 11g安装执行root.sh时报错
- Guys, is it normal that the oracle archive log grows by 3G in 20 minutes after running cdc?
- MySQL simple tutorial
- conda创建虚拟环境方法和pqi使用国内镜像源安装第三方库的方法教程
- 基于Qiskit——《量子计算编程实战》读书笔记(六)
- strongest brain (1)
- When oracle cdc, set the parallelism to 2 and the number of slots to 1, and the final task has only one tm. Is it because oracle does not support concurrency
- Transforming into a product, is it reliable to take the NPDP test?
猜你喜欢

Advanced Feature Selection Techniques in Linear Models - Based on R

oracle rac 11g安装执行root.sh时报错

最强大脑(1)

awk of the Three Musketeers of Shell Programming

细数国产接口协作平台的六把武器!

线性代数(四)

聊聊 API 管理-开源版 到 SaaS 版

scikit-learn机器学习 读书笔记(二)

Interface documentation evolution illustration, some ancient interface documentation tools, you may not have used it

8.STM32F407之HAL库——PWM笔记
随机推荐
How to improve product quality from the code layer
咨询cdc 2.0 for mysql不执行flush with read lock.怎么保证bin
`id` bigint(20) unsigned NOT NULL COMMENT '数据库主键',
Abstract problem methodology
EasyGBS连接mysql数据库提示“can’t connect to mysql server”,该如何解决?
Pony语言学习(八):引用能力(Reference Capabilities)
Error when installing oracle rac 11g and executing root.sh
Attention candidates for the soft exam! The detailed registration process for the second half of 2022 is coming!
Interface documentation evolution illustration, some ancient interface documentation tools, you may not have used it
OAuth2的使用场景、常见误区、使用案例
pytorch learning
Qiskit官方文档选译之量子傅里叶变换(Quantum Fourier Transform, QFT)
【Static proxy】
Flutter开发:报错The following assertion was thrown resolving an image codec:Unable to…的解决方法
How cursors work in Pulsar
oracle rac 11g安装执行root.sh时报错
Interface debugging also can play this?
FPGA工程师面试试题集锦21~30
常用工具系列 - 常用正则表达式
`id` bigint(20) unsigned NOT NULL COMMENT 'Database primary key',