网站首页 站内搜索

搜索结果

查询Tags标签: tensor,共有 112条记录
  • torch.gather与torch.scatter

    前言 我觉得pytorch最难的两个api之一就是gather和scatter了,但是在项目中又经常出现,OMG… 还是想办法弄懂吧torch.gather input = torch.randn((2, 3, 4))tensor([[[ 0.1815, -0.7603, 0.3465, 0.2593],[ 0.5841, 1.2581, 0.1583, -0.7283],[-0.0093, 0.6214, -0…

    2022/1/23 6:07:52 人评论 次浏览
  • PyTorch数据操作

    导入torch import torch张量(Tensor)表示由一个数值组成的数组,这个数组可能具有多个维度,具有一个维度的数组是向量(vector),具有两个维度的数组是矩阵(matrix)… arange创建一个行向量x shape属性输出张量的形状 numel()张量中元素的个数 x = torch.arange(12) pri…

    2022/1/17 23:08:53 人评论 次浏览
  • PyTorch数据操作

    导入torch import torch张量(Tensor)表示由一个数值组成的数组,这个数组可能具有多个维度,具有一个维度的数组是向量(vector),具有两个维度的数组是矩阵(matrix)… arange创建一个行向量x shape属性输出张量的形状 numel()张量中元素的个数 x = torch.arange(12) pri…

    2022/1/17 23:08:53 人评论 次浏览
  • RNN-人名分类器算法

    RNN人名分类器算法 1.优化处理 1.使用teacherforcing算法优化。 2.超参数调节,学习率调节,numepoch=80000,1000000。 3.rnn,lstm,gru算法对比 2.rnn,lstm,gru算法对比可视化 numepoch=80000numepoch=10000003.代码段 from io import open import glob import os im…

    2022/1/16 20:04:51 人评论 次浏览
  • RNN-人名分类器算法

    RNN人名分类器算法 1.优化处理 1.使用teacherforcing算法优化。 2.超参数调节,学习率调节,numepoch=80000,1000000。 3.rnn,lstm,gru算法对比 2.rnn,lstm,gru算法对比可视化 numepoch=80000numepoch=10000003.代码段 from io import open import glob import os im…

    2022/1/16 20:04:51 人评论 次浏览
  • 鸿蒙培训第四阶段第三次任务

    1、张量(Tensor): a、各种数值数据可以为张量。 b、常数:scaler:0阶张量。 c、向量:vector:1阶张量。 d、矩阵:matrix:2阶张量。 2、张量的创建方式: a、torch.Tensor(list) b、torch.empty()/zeros()/ones() c、torch.rand()/randint()/randn() 3、 ten…

    2022/1/15 23:33:27 人评论 次浏览
  • 鸿蒙培训第四阶段第三次任务

    1、张量(Tensor): a、各种数值数据可以为张量。 b、常数:scaler:0阶张量。 c、向量:vector:1阶张量。 d、矩阵:matrix:2阶张量。 2、张量的创建方式: a、torch.Tensor(list) b、torch.empty()/zeros()/ones() c、torch.rand()/randint()/randn() 3、 ten…

    2022/1/15 23:33:27 人评论 次浏览
  • Part2 深度学习实践 --- AI框架使用(Pytorch)

    1 AI框架使用(Pytorch)每小节都有对应的可执行notebook文件。1.1 基本数据操作 由于本人能力有限,不可能将所有Pytorch的操作都进行讲解。因此强烈建议读者遇到问题时候查阅Pytorch的官方文档和参与一些论坛社区的讨论。 1.1.1 安装 对Pytorch的安装,这里也不做过多的展…

    2022/1/12 23:04:33 人评论 次浏览
  • Part2 深度学习实践 --- AI框架使用(Pytorch)

    1 AI框架使用(Pytorch)每小节都有对应的可执行notebook文件。1.1 基本数据操作 由于本人能力有限,不可能将所有Pytorch的操作都进行讲解。因此强烈建议读者遇到问题时候查阅Pytorch的官方文档和参与一些论坛社区的讨论。 1.1.1 安装 对Pytorch的安装,这里也不做过多的展…

    2022/1/12 23:04:33 人评论 次浏览
  • 【 百度 paddlepaddle 使用dropout 时】出现 :TypeError: ‘Tensor‘ object is not callable

    import paddle import numpy as npx = np.array([[1,2,3], [4,5,6]]).astype(float32) x = paddle.to_tensor(x)####################### p =paddle.nn.functional.dropout(x) y_train=p(x)# 这种方式报错! ###############################y_train = paddle.nn.functio…

    2022/1/9 23:05:12 人评论 次浏览
  • 【 百度 paddlepaddle 使用dropout 时】出现 :TypeError: ‘Tensor‘ object is not callable

    import paddle import numpy as npx = np.array([[1,2,3], [4,5,6]]).astype(float32) x = paddle.to_tensor(x)####################### p =paddle.nn.functional.dropout(x) y_train=p(x)# 这种方式报错! ###############################y_train = paddle.nn.functio…

    2022/1/9 23:05:12 人评论 次浏览
  • tf.summary使用过程中报错: tags and values not the same shape

    近来使用tensorflow中的tf.summary模块进行调试,用来主程序运行时打印想要看的张量的形状shape, 以及值value. 虽然使用的tensorflow版本1.15.5, 即使使用tf.enable_eager_execution()也无法看到张量的实际各维的长度。 涉及到tf.summary部分的代码: edges_0_shape = tf…

    2021/12/27 6:37:25 人评论 次浏览
  • tf.summary使用过程中报错: tags and values not the same shape

    近来使用tensorflow中的tf.summary模块进行调试,用来主程序运行时打印想要看的张量的形状shape, 以及值value. 虽然使用的tensorflow版本1.15.5, 即使使用tf.enable_eager_execution()也无法看到张量的实际各维的长度。 涉及到tf.summary部分的代码: edges_0_shape = tf…

    2021/12/27 6:37:25 人评论 次浏览
  • 深度学习报错集合(自用>>>持续更新)

    Tensorflow 1、IndentationError: unexpected indent代码缩进有问题2、TypeError: Fetch argument 5 has invalid type <class int>, must be a string or Tensor. (Can not convert a int into a Tensor or Operation.)把int32 换成float323、Tensor("Add:0&q…

    2021/12/26 23:37:31 人评论 次浏览
  • 深度学习报错集合(自用>>>持续更新)

    Tensorflow 1、IndentationError: unexpected indent代码缩进有问题2、TypeError: Fetch argument 5 has invalid type <class int>, must be a string or Tensor. (Can not convert a int into a Tensor or Operation.)把int32 换成float323、Tensor("Add:0&q…

    2021/12/26 23:37:31 人评论 次浏览
扫一扫关注最新编程教程