深層学習ライブラリのプログラミングモデル

1,276
-1

Published on

深層学習ライブラリのプログラミングモデル @Chainer Meetup 2015-12-19

Published in: Software
0 Comments
12 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,276
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
12
Embeds 0
No embeds

No notes for slide

深層学習ライブラリのプログラミングモデル

  1. 1. 深層学習ライブラリの プログラミングモデル 1 2015-12-19 @Chainer Meetup
  2. 2. 今日の内容 • 自己紹介 • プログラミングモデル • ただ結局… 2
  3. 3. 自己紹介 3
  4. 4. 自己紹介 • バクフー株式会社 柏野 雄太 (かしの ゆうた) • Zope3の開発 • Python 13年 • いくつかの本 • バックグラウンドは宇宙物理学 • 深層学習ライブラリウオッチャー 4
  5. 5. 自己紹介 • バクフー株式会社 柏野 雄太 (かしの ゆうた) • 大規模リアルタイムデータのプラットフォーム 5
  6. 6. http://socio.bakfoo.com/ socio@bakfoo.com Closed Beta
  7. 7. プログラミングモデル 7
  8. 8. 汎用高機能DLライブラリ • Theano • Torch • Chainer • neon • TensorFlow+ / Cloud Vision API • MXNet
  9. 9. DL lib 機能差・競争優位 theano torch chainer neon TF MXNet single speed ○ ○ ○* multi gpu ○ ○ ○ ○ ○ ○ multi machine ○* ○ model zoo ○ ○ ○ ○ community ○ ○ ○
  10. 10. DLライブラリの共通点 • 神経回路網の数理表現をモデルとする • 有向非巡回グラフ(DAG): 計算グラフ … … … 1 1 1 b(3) b(2) b(1) W (1) W (2) W (3) x1 x2 xd a(1) (x) a(2) (x) a(3) (x) h(2) (x) h(1) (x) f(x) = h(3) (x) g g o b(1) W (1) b(3) b(2) W (2) W (3) x
  11. 11. 数理表現の実装に差がある • 手続き的: Torch, Chainer, neon • シンボル的: Theano, TensorFlow • 手続きかつシンボル: MXNet _ + _ A _ + _ _ **2 B 1 A2 + B + 1
  12. 12. モデル実装の差 _ + _ A _ + _ _ **2 B 1 A2 + B + 1
  13. 13. 手続き的モデリング • ノードにデータ(とgrad)が格納される _ + _ A _ + _ _ **2 B 1 A2 + B + 1
  14. 14. ノードに格納されるとは • Chainerのカスタム関数
  15. 15. 手続きは柔軟で動的 • 全ノードに値とgradが格納されているのでデ バグが容易 • forなどの制御が容易 • Chainerのように実行しながら,計算グラフを 組み替えることもできる
  16. 16. シンボル的モデリング • 変数ノードはシンボル • 計算グラフをコンパイ ル・実行して結果を得 る A2 + B + 1 _ + _ A _ + _ _ **2 B 1
  17. 17. シンボルはメモリを再利用する • 結果が欲しいだけなら入力と最後だけメモリ にあればいい:メモリの再利用 • A, B: 120byte • 手続き: 5*120 = 600 byte • シンボル:3*120 = 360 byte _ + _ A _ + _ _ **2 B 1
  18. 18. シンボルは計算グラフを効率化 • 計算グラフの畳みこみ _ + _ A _ + _ _ **2 B 1 A B 1 op op = A ⇤ ⇤2 + B + 1
  19. 19. シンボル:資源分散を体系化 • TFのデバイス間計算,マシン分散機能
  20. 20. 手続き vs シンボル • 手続きは柔軟で動的 • デバグが容易でモデリングの開発効率がいい • モデルに制御構文,計算グラフを動的にも • シンボルは効率的 • メモリの再利用 • 計算グラフの構造を畳みこみできる • 計算資源の分散に体系的に対応できる 参考:http://mxnet.readthedocs.org/en/latest/program_model.html
  21. 21. ただ結局…
  22. 22. TF開発エコシステム • TensorDebugger (TDB) https://github.com/ericjang/tdb
  23. 23. TF開発エコシステム • skflow https://github.com/google/skflow • Pretty Tensor https://github.com/google/prettytensor • Keras http://keras.io/backend/ • Deep Learning Robot https://www.autonomous.ai/deep-learning-robot
  24. 24. 結局,七難隠すのは… 開発エコシステムの大きさ
  25. 25. Chainerコミュニティはどこ? http://jrvis.com/red-dwarf/?user=pfnet&repo=chainer
  26. 26. Rubyの成功に学ぼう • まずは日本で開発エコシステムのコアを育てる • 本体コード外のコミュニティ開発者の養成 • 正式ドキュメントに日本語 • 日本語による頻繁なミートアップ・年一回の Chainerカンファレンス • 日本語のQAコミュニティ
  27. 27. ご質問・ご意見 kashino@bakfoo.com 27 @yutakashino
  28. 28. DL学習リソース 28
  29. 29. 動画講義 (全力でオススメ) • Deep Learning Summer School 2015 • Hugo Larochelle (Twitter/U of Sherbrooke) • Nando de Freitas (Oxford) • CS231n: CNN for Visual Recognition • CS224d: DL for Natural Language Processing http://videolectures.net/deeplearning2015_montreal/ http://cs231n.stanford.edu/ http://cs224d.stanford.edu/index.html https://www.cs.ox.ac.uk/people/nando.defreitas/machinelearning/ https://goo.gl/UWtRWT 29
  30. 30. 書籍 • 古典: Bengio et.al. 2015 DLBook • Theano Tutorial • Neural Networks and Deep Learning • 岡谷貴之著 深層学習 (機械学習プロ) • 神嶌敏弘編 深層学習: Deep Learning http://www.iro.umontreal.ca/~bengioy/dlbook/ http://neuralnetworksanddeeplearning.com/ http://deeplearning.net/tutorial/deeplearning.pdf 30
  31. 31. 例:手続きback prop • 手続きだと簡単実装
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×