zoukankan      html  css  js  c++  java
  • 搭建神经网络

    PyTorch是使用GPU和CPU优化的深度学习张量库。这篇博客记录如何使用pyTorch初步搭建神经网络。

    一、搭建神经网络

    1.1 基本概念

    • 基于pyTorch的NN:用张量表示数据,用计算图搭建神经网络,用会话执
      行计算图,优化线上的权重(参数),得到模型。

    • 张量:张量就是多维数组(列表),用“阶”表示张量的维度。

    • 数据类型

      python pytorch
      Int IntTensor of size()
      float FloatTensor of size()
      Int array IntTensor of size [d1,d2,…]
      Float array FloatTensor of size [d1,d2,…]
      string ont-hot or Embedding(Word2Vec,glove)

      pyTorch内建的数据类型

    Data tyoe dtype CPU tensor GPU tensor
    32-bit floating point torch.float32 or torch.float torch.FloatTensor torch.cuda.FloatTensor
    64-bit floating point torch.float64 or torch.double torch.DoubleTensor torch.cuda.DoubleTensor
    16-bit floating point torch.float16 or torch.half N/A torch.cuda.HalfTensor
    8-bit integer (unsigned) torch.uint8 torch.ByteTensor torch.cuda.ByteTensor
    8-bit integer (signed) torch.int8 torch.CharTensor torch.cuda.CharTensor
    16-bit integer (signed) torch.int16 or torch.short torch.ShortTensor torch.cuda.ShortTensor
    32-bit integer (signed) torch.int32 or torch.int torch.IntTensor torch.cuda.IntTensor
    64-bit integer (signed) torch.int64 or torch.long torch.LongTensor torch.cuda.LongTensor
  • 相关阅读:
    CAN
    snip_opencv环境配置和测试程序
    snip_进制转换代码段
    代码高亮的调试过程
    test3
    test2
    dsBlog_杂类
    js秒数转换为时分秒
    Linux 添加硬盘挂着到指定目录
    上海居住证积分续办
  • 原文地址:https://www.cnblogs.com/lyszyl/p/12116710.html
Copyright © 2011-2022 走看看