深度学习(1)深度学习初见
生活随笔
收集整理的這篇文章主要介紹了
深度学习(1)深度学习初见
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
深度學習(1)深度學習初見
- 深度學習框架介紹
- 1. TensorFlow發展歷程
- 2. TensorFlow eco-system
- 3. 學習建議
- 4. 為什么要使用TensorFlow
深度學習框架介紹
1. TensorFlow發展歷程
(1) 2015
- Scikit-learn
- Machine Learning,No GPU
- Caffe
- 2013,第一個面向深度學習的框架
- No auto-grad,C++
- Keras
- wrapper
- Theano
- 開發難,調試難
- Torch
- Lua語言
(2) TensorFlow
- Caffe
- Facebook,Caffe →\to→ Torch
- Torch →\to→ PyTorch
- Theano
- Google,→\to→ TensorFlow
- TensorFlow →\to→ TensorFlow2
- Chainer
- MXNet
(3) 2017: TensorFlow1.0
- tf.contrib
- tf.layers,tf.metrics,tf.losses
- tfdbg
- PyTorch 0.1
(4) TensorFlow 1.X 缺點
- 調試困難
- API混亂
- 入門困難,入了門依舊困難
- 大批研究人員轉向PyTorch
(5) 2019
- TensorFlow 2.0 發布
- TF+Keras
- 更容易使用
去掉了一些概念,例如:
session.run
tf.comtrol_dependencies
tf.global_variables_initializer
tf.cond,tf.while_loop
2. TensorFlow eco-system
(1) TensorFlow 2.0
TensorFlow核心庫
- @tf.function
將動態圖的語言變為靜態圖,使計算加速。
(2) TensorFlow Lite
(3) TensorFlow.JS
(4) TensorFlow Extended
TensorFlow Lite、TensorFlow.JS、TensorFlow Extended構成了TensorFlow的生態系統,從這點上看,TensorFlow是領先于PyTorch的。
(5) TensorFlow Prob
(6) TPU Cloud
Google自己研發的加速硬件。
3. 學習建議
(1) 忘掉TensorFlow 1.X
(2) PyTorch和TensorFlow選一主修(二者都要掌握)
(3) Keras逐漸淡出(已經被Google收購了)
- TF+Keras
- PyTorch+Caffe2
4. 為什么要使用TensorFlow
- GPU加速
- 自動求導
- 神經網絡Layers
(1) GPU加速
GPU和CPU對比
運行結果:
可以看到,使用GPU運行要比使用CPU運行快(正常是快很多,我用的MacBook運行的)。
(2) 自動求導
例子:
y=a2?x+b?x+cy=a^2*x+b*x+cy=a2?x+b?x+c
其中: x=1;a=2;b=3;c=4x=1;a=2;b=3;c=4x=1;a=2;b=3;c=4
代碼如下:
運行結果:
(3) 神經網絡API
| tf.matmul | layers.Dense |
| tf.nn.conv2d | layers.Conv2D |
| tf.nn.relu | layers.SimpleRNN |
| tf.nn.max_pool2d | layers.LSTM |
| tf.nn.sigmoid | layers.ReLU |
| tf.nn.softmax | layers.MAxPool2D |
參考文獻:
[1] 龍良曲:《深度學習與TensorFlow2入門實戰》
總結
以上是生活随笔為你收集整理的深度学习(1)深度学习初见的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 深度学习导论(6)误差计算
- 下一篇: 我,一名记者,面对ChatGPT慌的一比