Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
TensorFlowの基礎
Search
Norihiro Shimoda
March 20, 2017
Technology
4.5k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TensorFlowの基礎
TensorFlowの概要と技術的な基本だけをまとめました
Norihiro Shimoda
March 20, 2017
More Decks by Norihiro Shimoda
See All by Norihiro Shimoda
ぼくのかんがえたさいきょうの機械学習プロジェクト進行法(PoC/デモ編)
rindai87
10
21k
FindYourCandyでの転移学習の話
rindai87
4
16k
Google I/O 報告会(ML)担当
rindai87
3
9.8k
最近のTensorFlowの話
rindai87
1
1.6k
TensorFlowとGCPの簡単な紹介
rindai87
3
4.8k
TFv1.0の概要+HighLevelAPI/Keras
rindai87
4
2.2k
How should engineers survive during AI era
rindai87
5
28k
Let's stand up against "Do Artificial Intelligence" with proper knowledge
rindai87
6
1.9k
Talk about ML and DL for happy engineer's life
rindai87
40
15k
Other Decks in Technology
See All in Technology
Cognition AI Japan - ウェビナー2_テストQA_運用監視
cogakira
0
130
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
480
転んだ話が背中を預ける理由になる / A_story_about_falling_down_gives_you_a_reason_to_watch_each_other_s_backs.pdf
pauli
3
350
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
780
Incremental HTTP
kazuho
5
2.1k
OSC2026on_the-world-is-waiting-for-your-voice.pdf
naruoga
0
370
ファミコンでPHPを動かす / PHP on the Famicom side b
tomzoh
0
140
V8のArray.prototype.flatを最大約20倍速くするまでと、巨大OSSへの大規模コミットの道のり
riyaamemiya
0
200
AI 時代の Azure エンジニアリング ~ 私たちは何を磨き、何を任せるのか ~
chack411
1
580
Essential architectural thinking (revised edition)
ufried
0
110
オブザーバビリティを高める AI エージェント体験を考える / Designing AI Agent Experiences That Enhance Observability
aoto
PRO
2
330
Claude Code本は、どのように執筆チームで書かれたか
oikon48
1
360
Featured
See All Featured
Exploring anti-patterns in Rails
aemeredith
4
530
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
540
The untapped power of vector embeddings
frankvandijk
2
1.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
840
Done Done
chrislema
187
17k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
540
Product Roadmaps are Hard
iamctodd
55
13k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
550
Transcript
TensorFlowの基礎
⾃自⼰己紹介 • 下⽥田倫倫⼤大(@rindai87) • TensorFlow User Group(TFUG)主催者 • 最近GDE(Google Developer
Expert)の ML Expertになりました
TensorFlowの概要 TensorFlowとはそもそも 何かについて説明します
TensorFlowとは? • Googleがオープンソース化した機械学習 のライブラリ • 2015年年11⽉月に公開 • Google社内でも実際に使われている(と ⾔言われている)
TensorFlowのモデル 1. 学習モデルをグラフと して定義する 2. 学習を実際にどう⾏行行う かも定義する – 学習の評価⽅方法 –
最適化の⽅方法 – CPU or GPU – スタンドアロン or 分散 3. 定義に従って計算処理理 をデバイス上で実⾏行行さ せる
TensorFlowの歴史
TensorBoardなどのツール
その他のTensorFlow情報 1. Google内でのTensorFlow 2. TensorFlowの事例例 3. TensorFlowコミュニティ 4. 企業でのTensorFlow https://goo.gl/kiU4qd
TensorFlowの基本 TensorFlowを利利⽤用する上での 基本について説明します
TensorFlowにありがちな勘違い TensorFlowは深層学習に 特化したツールである 10
TensorFlowの超基本 OP Input Output OP OP Input グラフを意識識しながら処理理を記述して 最後にどびゃっと実⾏行行する 11
TensorFlowのパラダイム • はじめにテンソルの演算グラフを作る • グラフの実⾏行行単位をセッションという • 定数、変数、プレースホルダーを宣⾔言できる • 作ったグラフはデバイス(CPUやGPU)に展 開して実⾏行行する
• 分散処理理も可能である 12
TensorFlowのパラダイム • はじめにテンソルの演算グラフを作る • グラフの実⾏行行単位をセッションという • 定数、変数、プレースホルダーを宣⾔言できる • 作ったグラフはデバイス(CPUやGPU)に展 開して実⾏行行する
• 分散処理理も可能である ということを、Pythonをインターフェースとして ⾏行行っているフレームワーク 機械学習に関する便便利利なヘルパー関数がいっぱい あるのがポイント 13
ここだけ押さえればTensorFlowが 分かる簡単な例例 • 例例1:⾜足し算 – 演算(operation) • 例例2:カウントアップ – 変数(Variable)
• 例例3:⼊入⼒力力値をいろいろと変える – プレースホルダー(Placeholder) • 例例4:セッションを使う – セッション(Session) • 例例5:⾼高ランクなテンソルの演算 – テンソル(Tensor) 14
ここだけ押さえればTensorFlowが 分かる簡単な例例 • 例例1:⾜足し算 – 演算(operation) • 例例2:カウントアップ – 変数(Variable)
• 例例3:⼊入⼒力力値をいろいろと変える – プレースホルダー(Placeholder) • 例例4:セッションを使う – セッション(Session) • 例例5:⾼高ランクなテンソルの演算 – テンソル(Tensor) 15
1+2 = 3の⾜足し算 16
演算(Operation) x(定数) y(定数) + 演算がグラフのノードとなる(この場合は加算の演算) tf.add() tf.constant() tf.constant() 17
演算(Operation) x(定数) y(定数) + 演算がグラフのノードとなる(この場合は加算の演算) tf.add() tf.constant() tf.constant() 1 2
3 18
ここだけ押さえればTensorFlowが 分かる簡単な例例 • 例例1:⾜足し算 – 演算(operation) • 例例2:カウントアップ – 変数(Variable)
• 例例3:⼊入⼒力力値をいろいろと変える – プレースホルダー(Placeholder) • 例例4:セッションを使う – セッション(Session) • 例例5:⾼高ランクなテンソルの演算 – テンソル(Tensor) 19
カウントアップ 20
変数(Variable) inc(定数) + cnt(変数) 通常のプログラミング⾔言語の変数などと同じように 代⼊入可能な箱として変数がある tf.assign() tf.Variable() tf.constant() tf.add()
1 0 21
変数(Variable) inc(定数) + cnt(変数) tf.assign() tf.Variable() tf.constant() tf.add() 1 0
1 通常のプログラミング⾔言語の変数などと同じように 代⼊入可能な箱として変数がある 22
変数(Variable) inc(定数) + cnt(変数) tf.assign() tf.Variable() tf.constant() tf.add() 1 1
2 通常のプログラミング⾔言語の変数などと同じように 代⼊入可能な箱として変数がある 23
変数(Variable) inc(定数) + cnt(変数) tf.assign() tf.Variable() tf.constant() tf.add() 1 2
3 通常のプログラミング⾔言語の変数などと同じように 代⼊入可能な箱として変数がある 24
ここだけ押さえればTensorFlowが 分かる簡単な例例 • 例例1:⾜足し算 – 演算(operation) • 例例2:カウントアップ – 変数(Variable)
• 例例3:⼊入⼒力力値をいろいろと変える – プレースホルダー(Placeholder) • 例例4:セッションを使う – セッション(Session) • 例例5:⾼高ランクなテンソルの演算 – テンソル(Tensor) 25
いろんな値を⼊入⼒力力する 26
プレースホルダー(Placeholder) y (プレースホルダ) x(定数) + tf.constant() tf.add() tf.placeholder() あらかじめ箱を作っておいて 実⾏行行時に好きな値を⼊入⼒力力させる
1 27
プレースホルダー(Placeholder) y (プレースホルダ) x(定数) + tf.constant() tf.add() tf.placeholder() feed_̲dict 1
1 2 あらかじめ箱を作っておいて 実⾏行行時に好きな値を⼊入⼒力力させる 28
プレースホルダー(Placeholder) y (プレースホルダ) x(定数) + tf.constant() tf.add() tf.placeholder() feed_̲dict 3
1 4 あらかじめ箱を作っておいて 実⾏行行時に好きな値を⼊入⼒力力させる 29
ここだけ押さえればTensorFlowが 分かる簡単な例例 • 例例1:⾜足し算 – 演算(operation) • 例例2:カウントアップ – 変数(Variable)
• 例例3:⼊入⼒力力値をいろいろと変える – プレースホルダー(Placeholder) • 例例4:セッションを使う – セッション(Session) • 例例5:⾼高ランクなテンソルの演算 – テンソル(Tensor) 30
実⾏行行環境を分ける 31
セッション 1(定数) + cnt(変数) tf.assign() tf.Variable() tf.constant() tf.add() 1(定数) +
cnt(変数) tf.assign() tf.Variable() tf.constant() tf.add() セッションにより グラフの実⾏行行環境が まるっと独⽴立立する 名前空間のようなもの tf.Session() tf.Session() 32
ここだけ押さえればTensorFlowが 分かる簡単な例例 • 例例1:⾜足し算 – 演算(operation) • 例例2:カウントアップ – 変数(Variable)
• 例例3:⼊入⼒力力値をいろいろと変える – プレースホルダー(Placeholder) • 例例4:セッションを使う – セッション(Session) • 例例5:⾼高ランクなテンソルの演算 – テンソル(Tensor) 33
テンソル(Tensor) のランクを⼤大きくする ここまでの話を 多次元の値に拡張 34
テンソル ランク どうなる 0 スカラ(要はただの数値) 1 ベクトル(配列列) 2 ⾏行行列列(2次元配列列) 3
3次元配列列(⾏行行列列に厚みがある感じ) n n次元配列列(イメージできない世界) 要は取り扱うデータ構造のことだと思ってください 今までの話はここ 35
多次元版の⾜足し算 36
⼊入⼒力力となるテンソルが違うだけ x(定数) y(定数) + 演算がグラフのノードとなる(この場合は加算の演算) tf.add() tf.constant() tf.constant() [[1,2], [1,2]]
[[3,4], [3,4]] [[4,6], [4,6]] 37
この先は? • ここまででTensorFlowの基礎中の基礎は 完了了となります • 残念念がら、機械学習や深層学習について は⾝身についたわけではありません • TensorFlow本家のチュートリアルなどで TensorFlow⾃自体、また深層学習の知識識を
深める必要があります
Thank You !! 39