
torch与tf使用笔记
文章平均质量分 60
积累torch与TensorFlow的使用技巧
江汉似年
写代码造汽车
展开
-
pytorch矩阵相乘效率提升之路
矩阵相乘效率原创 2022-06-17 18:04:13 · 433 阅读 · 0 评论 -
torch中的retain graph、detach
torch中的retain graph、detach原创 2022-06-14 16:12:38 · 722 阅读 · 0 评论 -
torch中的NLLLoss与CrossEntropyLoss
nullhttps://blog.youkuaiyun.com/qq_22210253/article/details/852299881. 当label为hardlabel的时候CrossEntropyLoss(x, label) = log_softmax(x) + NLLLoss(x, label)2. 当label为softlabel的时候应该选用CrossEntropyLoss原创 2022-02-22 20:37:51 · 1266 阅读 · 0 评论 -
torch.ge()与nn.masked_select()使用
1.torch.ge(input,other,*,out=None)→TensorComputes input≥otherelement-wise. 返回的是bool tensor,shape与input相同Parameters input(Tensor) – the tensor to compare other(Tensororfloat) – the tensor or value to compare Keyword Argumentsout(...原创 2022-01-27 11:19:35 · 2109 阅读 · 0 评论 -
tensorflow基础学习笔记
1、tensorflow中几个关键抽象:(个人初步理解,可能有错误)节点:一个tensor代表一个节点计算图:定义的多个tensor之间的运算关系用graph的形式来表达,从而形成一张图占位符:顾名思义,提前占据计算位置的变量会话:给占位符传值需要一个人机交互界面,这个东西叫会话计算路径:提前设定好加减乘除运算规则,各个tensor按照这个路径来进行计算参考文章:https...原创 2019-04-20 18:08:08 · 111 阅读 · 0 评论 -
pytorch版本对应关系
https://blog.youkuaiyun.com/baidu_20163013/article/details/105470332转载 2021-01-21 19:03:15 · 2376 阅读 · 0 评论 -
torch与tf中的normalization
1、四种常用normalizationhttps://www.cnblogs.com/wanghui-garcia/p/10877700.html2、图神经网络原创 2021-06-11 10:09:45 · 2813 阅读 · 1 评论 -
torch中转置与reshape/view在内存操作上的区别
1、首先理解contiguous与non-contiguous数组的区别https://stackoverflow.com/questions/26998223/what-is-the-difference-between-contiguous-and-non-contiguous-arrays总结下来就是:(1)permute/transpose这种转置操作会带来内存拷贝。(2)view操作只作用在连续内存上,仅仅按照行重新排列下标,不改变数据的内存分布。(3)reshape操作可以作原创 2021-06-11 14:45:10 · 1060 阅读 · 1 评论 -
pytorch导入并固定部分参数进行训练
1、只导入部分参数https://blog.youkuaiyun.com/qq_34914551/article/details/878711342、固定指定的cans原创 2021-06-18 10:50:16 · 1104 阅读 · 0 评论 -
torch混合精度训练的NAN问题
pytorch混合精度训练_cdknight_happy的专栏-优快云博客_pytorch 混合精度训练torch混合精度训练可能会遇到NAN问题,原因是梯度计算导致的,通过梯度裁剪可以解决。原创 2021-12-04 15:17:01 · 1943 阅读 · 0 评论 -
Torch与TensorFlow卷积对比
一、一维卷积对比:一维卷积tensorflow2版本的Conv1D以及Pytroch的nn.Conv1d用法 - 知乎简单总结:torch的1d卷积核在最后一维上滑动,tf的1d卷积核在倒数第2维上滑动。二、二维卷积对比:原创 2021-12-08 17:07:11 · 3575 阅读 · 0 评论