GithubHelp home page GithubHelp logo

pytorch_learn's Introduction

记录Pytorch的学习过程


Day 1(2017/10/25)

  • 了解Pytorch中的基本语法,以及常用的包
  • 实现的函数
    torch_numpy 实现numpy与torch中张量间数据的转换
    numpy --> torch torch_data.numpy()
    torch --> numpy torch.from_numpy(numpy_data)

Day 2(2017/10/26)

  1. Python转换成Torch数据
  2. Torch中的数学计算
  3. 激活函数
  4. 变量及自动求解梯度
  5. LR实现
  6. 分类问题
  • Python转换成Torch数据
torch_data = torch.FloatTensor(python_data)
torch_data = torch.IntTensor(data1)
  • Torch中的数学计算
      加(add),矩阵乘(mm)以及比较特殊的dot(对应位置上元素相乘后相加)

  • 激活函数
      主要是导入torch.nn中的functional来实现
      涉及到子图以及添加图例

  • 变量及自动求解梯度
      Pytorch在求解梯度的过程中,都是通过变量实现的(需要在设置变量时定义为可自动求解)

  • LR实现
      包括数据的定义,网络的搭建,损失函数的定义,训练方法以及结果的可视化

    • 数据的定义
      定义为变量形式。torch.unsqueeze()?

    • 网络的搭建
      搭建的是一个线性的网络,使用torch.nn.Module中的torch.nn.Linear(in_features, out_features, bias=True)  

      网络的输入: (N,∗,in_features) where * means any number of additional dimensions

      网络的输出: (N,∗,out_features) where all but the last dimension are the same shape as the input.

    • 损失函数的定义  

    • 训练方法

    • 结果的可视化

###解决/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.14' not found问题

check

strings /home/zxf/anaconda2/lib/python2.7/site-packages/torch/lib/../../../../libstdc++.so.6 | grep GLIBCXX 

install

conda install libgcc 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.