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
  • 相关阅读:
    Centos7安装部署openstack--Keystone认证服务
    Centos7安装部署openstack----基础服务安装
    Centos7 k8s dns
    集中式存储3apr
    Centos7 k8s部署dahsboard
    Centos7 k8s tomcat-app项目持久化
    Centos7 k8s 容器的网络访问service
    Centos 7 k8s Deployment新副本控制器
    模型层中模型的基本了解
    程序员必知必会Git的小知识
  • 原文地址:https://www.cnblogs.com/lyszyl/p/12116710.html
Copyright © 2011-2022 走看看