上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 74 下一页
摘要: 变量.grad_fn表明该变量是怎么来的,用于指导反向传播。例如loss = a+b,则loss.gard_fn为<AddBackward0 at 0x7f2c90393748>,表明loss是由相加得来的,这个grad_fn可指导怎么求a和b的导数。 程序示例: import torch w1 = 阅读全文
posted @ 2020-10-01 10:40 Picassooo 阅读(16396) 评论(3) 推荐(2)
摘要: 把数据从CPU迁移到GPU时,可以用.cuda()方法,也可以用.to(device)方法。示例如下。 .cuda()方法 import torch import time t = time.time() b = torch.rand([1024, 1024, 10]) b = b.cuda() p 阅读全文
posted @ 2020-09-29 14:57 Picassooo 阅读(11579) 评论(7) 推荐(2)
摘要: 参考一 浅谈 PyTorch 中的 tensor 及使用 该博文分为以下6个部分: tensor.requires_grad torch.no_grad() 反向传播及网络的更新 tensor.detach() CPU and GPU tensor.item() torch.detach()和tor 阅读全文
posted @ 2020-09-29 11:04 Picassooo 阅读(2879) 评论(0) 推荐(1)
摘要: 一个关于显卡利用率的问题 阅读全文
posted @ 2020-09-27 17:25 Picassooo 阅读(223) 评论(0) 推荐(0)
摘要: 解决Python print end 一行输出不显示的问题 阅读全文
posted @ 2020-09-26 21:57 Picassooo 阅读(533) 评论(0) 推荐(0)
摘要: 模型和数据可以在CPU和GPU上来回迁移,怎么判断模型和数据在哪里呢? import torch import torch.nn as nn # 判断模型是在CPU还是GPU上 model = nn.LSTM(input_size=10, hidden_size=4, num_layers=1, b 阅读全文
posted @ 2020-09-26 21:25 Picassooo 阅读(34681) 评论(0) 推荐(2)
摘要: 标准正态分布的概率密度公式 正态分布概率密度公式 多元正态分布的概率密度公式 上式为 x 服从 k 元正态分布,x 为 k 维向量;|Σ| 代表协方差矩阵的行列式。 二维正态分布概率密度函数为钟形曲面,等高线是椭圆线族,并且二维正态分布的两个边缘分布都是一维正态分布,如图 numpy生成一个服从多元 阅读全文
posted @ 2020-09-26 16:20 Picassooo 阅读(7901) 评论(2) 推荐(1)
摘要: WAE-GAN和WAE-MMD的PyTorch实现 阅读全文
posted @ 2020-09-23 22:37 Picassooo 阅读(796) 评论(0) 推荐(0)
摘要: unpooling (摘自https://www.bilibili.com/video/av15889450/?p=33,第30分钟) unpooling有很多种方法,其中一种如下图: Deconvolution (摘自https://www.bilibili.com/video/av1588945 阅读全文
posted @ 2020-09-19 20:45 Picassooo 阅读(747) 评论(0) 推荐(0)
摘要: 李宏毅课程 classification 1,视频的19:47处开始有讲为什么叫生成模型,生成模型一般都需要先假设训练数据服从某种概率分布。 李宏毅课程 logistic regression, 视频的42:07处有讲判别模型和生成模型的区别,另外,视频的31:24处也有到,可参考视频前面的内容加以 阅读全文
posted @ 2020-09-19 16:56 Picassooo 阅读(436) 评论(0) 推荐(0)
上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 74 下一页