Long Long Ago


笔记: 深度学习与PyTorch入门

Yarco

  • Administrator
  • Full Member
  • *****
    • Posts: 115
    • View Profile
on: July 22, 2019, 09:16:38 pm
课程见附件微信扫描.

1. 深度学习初见
1.1 深度学习框架简介.
PyTorch历史.

现状:
Google: Theano -> TensorFlow1 -> TensorFlow2 -> Keras API
Facebook: Torch / Caffe -> Caffe2 -> PyTorch
Amazon: MXNet

TensorFlow 与 PyTorch的区别.

PyTorch生态:
NLP:  PyTorch NLP, AllenNLP
Vision: TorchVision
图: PyTorch geometric, Fast.ai
部署: ONNX

1.2 PyTorch功能演示
* GPU加速
* 自动求导
Code: [Select]
import torch
import torch.nn as nn

a = torch.tensor(1.0, requires_grad=True)
b = torch.tensor(2.0, requires_grad=True)
c = torch.tensor(3.0, requires_grad=True)

x = 1.0
y = a**2 * x + b * x + c
y.backward()
print(f'a={a.grad}, b={b.grad}, c={c.grad}')

结果是: 2 1 1

* 常用网络层
nn.Linear
nn.Conv2d
nn.LSTM

nn.ReLU
nn.Sigmoid
nn.Softmax

nn.CrossEntropyLoss
nn.MSE

2. 开发环境安装(略)
« Last Edit: August 14, 2019, 02:55:28 pm by Yarco »