SlideShare uma empresa Scribd logo
1 de 63
Baixar para ler offline
深層学習 
ダヌシカ ボレガラ
深層学習 
Deep Learning
概要 
• 応用 
• 理論 
• 実践 
3
深層学習 
• 英語ではDeep Learning 
• 特徴の数段の組み合わせを考慮することでより複雑 
な現象を学習する仕組み 
• 神経網回路(ニューラル・ネットワーク)の層を重ねる 
ことで学習することが殆ど 
• 人間の脳の仕組みに似ている? 
• とにかく,様々な認識タスクで大幅に良い精度を示 
しており,Google, Facebook,Microsoft,…など多くの企 
業が研究開発をしている. 
4
イメージ図 
5 
ピクセル 
色特徴線認識形認識物体認識 
教師信号
6 
報道 
Deep Learning in the News 
13! 
Researcher Dreams Up Machines 
That Learn Without Humans 
06.27.13 
Scientists See Promise in 
Deep-Learning Programs 
John Markoff 
November 23, 2012 
Google!taps!U! 
of!T!professor! 
to!teach! 
context!to! 
computers! 
03.11.13! 
slide credit: Bengio KDD’14
ヒントン先生(Google) 
7 
報道 
Deep Learning in the News 
13! 
Researcher Dreams Up Machines 
That Learn Without Humans 
06.27.13 
Scientists See Promise in 
Deep-Learning Programs 
John Markoff 
November 23, 2012 
Google!taps!U! 
of!T!professor! 
to!teach! 
context!to! 
computers! 
03.11.13! 
slide credit: Bengio KDD’14
8 
報道 
Deep Learning in the News 
13! 
Researcher Dreams Up Machines 
That Learn Without Humans 
06.27.13 
Scientists See Promise in 
Deep-Learning Programs 
John Markoff 
November 23, 2012 
Google!taps!U! 
of!T!professor! 
to!teach! 
context!to! 
computers! 
03.11.13! 
ベンジオ先生 
Montreal大学 
slide credit: Bengio KDD’14
9 
報道 
Deep Learning in the News 
13! 
LeCun先生 (Facebook) 
Researcher Dreams Up Machines 
That Learn Without Humans 
06.27.13 
Scientists See Promise in 
Deep-Learning Programs 
John Markoff 
November 23, 2012 
Google!taps!U! 
of!T!professor! 
to!teach! 
context!to! 
computers! 
03.11.13! 
slide credit: Bengio KDD’14
応用
深層学習の実世界応用 
• 画像認識 
• 物体認識 
• 情報検索 
• 画像検索,機械翻訳,類似検索 
• 音声 
• 音声認識,話者同定 
• ロボット工学 
• 自動運転, ゲーム 
11
認識タスクの概要 
12 
How$is$computer$percep>on$done?$ 
How$is$computer$percep>on$done?$ 
How$is$computer$percep>on$done?$ 
How$is$computer$percep>on$done?$ 
入力低次元特徴学習アルゴリズム 
How$is$computer$percep>on$done?$ 
How$is$computer$percep>on$done?$ 
Image$ LowTlevel$ 
vision$features$ 
Recogni>on$ 
Object$ 
detec>on$ 
Input Data Learning 
Algorithm 
Low-level 
features 
Slide$Credit:$Honglak$Lee$ 
Audio$ 
classifica>on$ 
Audio$ LowTlevel$ 
audio$features$ 
Speaker$ 
iden>fica>on$ 
Image$ LowTlevel$ 
vision$features$ 
Recogni>on$ 
Object$ 
detec>on$ 
Input Data Learning 
Algorithm 
Low-level 
features 
Slide$Credit:$Honglak$Lee$ 
Audio$ 
classifica>on$ 
Audio$ LowTlevel$ 
audio$features$ 
Speaker$ 
iden>fica>on$ 
Image$ LowTlevel$ 
vision$features$ 
Recogni>on$ 
Object$ 
detec>on$ 
Input Data Learning 
Algorithm 
Low-level 
features 
Slide$Credit:$Honglak$Lee$ 
Audio$ 
classifica>on$ 
Audio$ LowTlevel$ 
audio$features$ 
Speaker$ 
iden>fica>on$ 
物体認識 
低次元画像特徴認識 
Image$ LowTlevel$ 
vision$features$ 
Recogni>on$ 
Object$ 
detec>on$ 
Input Data Learning 
Algorithm 
Low-level 
features 
Slide$Credit:$Honglak$Lee$ 
Audio$ 
classifica>on$ 
Audio$ LowTlevel$ 
audio$features$ 
Speaker$ 
iden>fica>on$ 
Image$ LowTlevel$ 
vision$features$ 
Recogni>on$ 
Object$ 
detec>on$ 
Input Data Learning 
Algorithm 
Low-level 
features 
Slide$Credit:$Honglak$Lee$ 
Audio$ 
classifica>on$ 
Audio$ LowTlevel$ 
audio$features$ 
Speaker$ 
iden>fica>on$ 
Image$ LowTlevel$ 
vision$features$ 
Recogni>on$ 
Object$ 
detec>on$ 
Input Data Learning 
Algorithm 
Low-level 
features 
Slide$Credit:$Honglak$Lee$ 
Audio$ 
classifica>on$ 
Audio$ LowTlevel$ 
audio$features$ 
Speaker$ 
iden>fica>on$ 
話者同定 
低次元音声特徴同定 
slide credit: Honglak Lee
画像特徴量 
13 
Computer$vision$features$ 
SIFT$ Spin$image$ 
HoG$ RIFT$ 
Textons$ GLOH$ 
Slide$Credit:$Honglak$Lee$
音声特徴量 
14 
Audio$features$ 
Spectrogram$ MFCC$ 
Flux$ ZCR$ 
Rolloff$
画像認識 
Krizhevsky+ NIPS’12 
• デモ:http://deeplearning.cs.toronto.edu/ 
Figure 4: (Left) Eight ILSVRC-2010 test images and the five labels considered The correct label is written under each image, and the probability assigned 15
類似画像検索 
16 
images and the five labels considered most probable by our model. 
and the probability assigned to the correct label is also shown 
Right) Five ILSVRC-2010 test images in the first column. The 
Krizhevsky+ NIPS’12 
今は20層の深層学習 by Google!
衛星写真から道の推定 
17 
Predic>ng$Roads$from$ 
Satellite$Images$ 
(Mnih$and$Hinton, ICML 2012)!
衛星写真から道の推定 
18 
Predic>ng$Roads$from$ 
Satellite$Images$ 
(Mnih$and$Hinton, ICML 2012)!
アナロジー問題 
• 単語の意味をどのように表すか 
• 他の単語との共起頻度を要素とするベクトルで表す 
• 分布説 
• 単語の意味はその周辺単語で決まる 
• 単語の意味表現学習する問題を「ある単語の周辺 
に出現する他の単語を推定する」問題として解釈す 
る. 
• v(king) - v(man) + v(woman) が v(queen)と似ている! 
19
理論
深層学習の歴史 
• ニューラル・ネットワークは1950年代から 
あった 
• 一層のニューラル・ネットワークでは線で分 
類できるものしか認識できない 
• ミンスキー 1960年ころ 
21
パーセプトロン 
• Perceptronは単一層からなるニューラル・ネットワークである 
22 
x1 x2 x3 xn 
+ 
… 
w1 
w2 wn wn
パーセプトロン 
• Perceptronは単一層からなるニューラル・ネットワークである 
23 
x1 x2 x3 xn 
+ 
… 
w1 
w2 wn wn 
s = x1w1 + x2w2 + … + xnwn 
if s > 0: 
return 1 
else: 
return 0 
ロジスティクス関数 
1.5 
1 
0.5 
-2.4 -2 -1.6 -1.2 -0.8 -0.4 0 0.4 0.8 1.2 1.6 2 2.4 
-0.5 
-1 
-1.5
線型分離可能性とは 
24 
+ 
+ 
+ + 
+ 
+ + 
- 
- 
- 
- 
- 
- 
- 
- 
- - 
- 
- 
2次元では線ですが,多次元だと平面となる. 
ax + by +c = 0
線型分離不可能な問題 
25 
XOR (排他的論理和) 
x=0 x=1 
y=0 0 1 
y=1 1 0 
x 
y 
- 
+ - 
+ + 
- - 
- - 
- 
- 
- 
+ 
+ + 
+ 
+ 
+
線型分離不可能な問題 
26 
XOR (排他的論理和) 
x=0 x=1 
y=0 0 1 
y=1 1 0 
x 
y 
- 
+ - 
+ + 
- - 
- - 
- 
- 
- 
+ 
+ + 
+ 
+ 
+
線型分離不可能な問題 
27 
XOR (排他的論理和) 
x=0 x=1 
y=0 0 1 
y=1 1 0 
x 
y 
- 
+ - 
+ + 
- - 
- - 
- 
- 
- 
+ 
+ + 
+ 
+ 
+
線型分離不可能な問題 
28 
XOR (排他的論理和) 
x=0 x=1 
y=0 0 1 
y=1 1 0 
x 
y 
- 
+ - 
+ + 
- - 
- - 
- 
- 
- 
+ 
+ + 
+ 
+ 
+ 
どう頑張っても線を引いて分離不可能!
そんな単純なこともできないの? 
• XORは至るところで現るロジック 
• そんな単純なものも表現できないなら何の約にも立たない 
• 複数の層にすれば扱えるが重みの学習をどうして良いか 
分からない 
• error backpropagation (誤差逆伝播法)が1980年代に考案 
され,使われる 
• しかし,複数層で学習すると「過学習になりやすい」し遅い. 
そんなに沢山のパラメータが学習できるほどデータがない. 
• ニューラル・ネットワークの暗黒時代 
29
過学習 (over-fitting) 
• 学習データに当てはめすぎて,汎化できなくなる現象 
• 学習時:高精度,テスト時:低精度 
• 原因 
• モデルの自由度が高すぎる 
• 学習データの量が少なすぎる 
30
過学習 
31 
Non-linearities: Why they’re needed 
同じ10個の点を多項式 
を使って説明する場合 
(多項式を当てはまる場合) 
できるだけ小さい次元の多項式 
を使った方が過学習になり難い. 
!問題は次元数よりも, 
特徴の値の変化である. 
!オッカムのカミソリ 
同じ現象を説明するならより 
簡単な仮説の方が望ましい 
For$logis>c$regression:$map$to$probabili>es$ 
Here:$func>on$approxima>on,$$ 
g.,$regression$or$classifica>on$ 
Without$non;lineari>es,$deep$neural$networks$ 
can’t$do$anything$more$than$a$linear$transform$ 
• Extra$layers$could$just$be$compiled$down$into$ 
a$single$linear$transform$ 
Probabilis>c$interpreta>on$unnecessary$except$in$ 
the$Boltzmann$machine/graphical$models$ 
• People$oen$use$other$non;lineari>es,$such$as$ 
tanh,$as$we’ll$discuss$in$part$3$
深層学習の長点 
• 特徴を自分で考えなくて良い,基本特徴量さえ 
作成しておけば,その有効な組み合わせが自動 
的に学習できる. 
• ラベル無しのデータからでもこの「有効な組 
み合わせ」が学習可能 
• 大域的な表現が可能 (distributed representations) 
• 深層学習(大域的な表現学習)vs. クラスタリ 
ング(局所的な表現学習) 
32
局所的 vs. 大域的表現 
33 
Local$vs.$Distributed$Representa>ons$ 
• $Clustering,$Nearest$ 
Neighbors,$RBF$SVM,$local$ 
density$es>mators$$$ 
Learned$ 
prototypes$ 
Local$regions$ 
• $RBMs,$Factor$models,$ 
PCA,$Sparse$Coding,$ 
Deep$models$ 
C1=1$ 
C1=0$ 
C2=1$ 
C1=1$ C2=1$ 
C2=0$ 
C1=0$ 
C2=0$ 
C1$ C2$ C3$ 
• $Parameters$for$each$region.$ 
• $#$of$regions$is$linear$with$$$$$$$ 
$$#$of$parameters.$ 
Bengio, 2009, Foundations and Trends in Machine Learning! 
slide credit: Salakhutdinov KDD’14
局所的 vs. 大域的表現 
Local$vs.$Distributed$Representa>ons$ 
• $Clustering,$Nearest$ 
Neighbors,$RBF$SVM,$local$ 
density$es>mators$$$ 
slide credit: Salakhutdinov KDD’14 34 
Learned$ 
prototypes$ 
Local$regions$ 
C1=1$ 
C3=0$ 
C1=0$ 
C3=0$ 
C3=0$ 
C2=1$ 
C1=1$ C2=1$ 
C2=0$ 
C1=0$ 
C2=0$ 
C3=0$ 
C1=1$ 
C2=1$ 
C3=1$ 
C1=0$ 
C2=1$ 
C3=1$ 
C1=0$ 
C2=0$ 
C3=1$ 
• $RBMs,$Factor$models,$ 
PCA,$Sparse$Coding,$ 
Deep$models$ 
• $Parameters$for$each$region.$ 
• $#$of$regions$is$linear$with$$$$$$$ 
$$#$of$parameters.$ 
C1$ C2$ C3$ 
Bengio, 2009, Foundations and Trends in Machine Learning!
深層学習の大発見! 
• 層を重ねることでより表現豊なニューラル・ 
ネットワークが学習できることが分かってい 
たが,いかに過学習を避けるかが課題だった 
• 貪欲法(greedy layer-wise training) 
• 2つの層だけで学習を行い,そのように学習 
させた2つずつの層を重ねるとよい! 
• A Fast Learning Algorithm for Deep Belief Nets, 
Hinton et al., Neural Computing, 2006. 
35
Layer-wise Unsupervised Learning 
input … 
40!
Layer-Wise Unsupervised Pre-training 
… 
… 
features 
input 
41!
Layer-Wise Unsupervised Pre-training 
… 
of input = 
… 
… 
reconstruction 
features 
input 
? 
… input 
42!
Layer-Wise Unsupervised Pre-training 
… 
… 
features 
input 
43!
Layer-Wise Unsupervised Pre-training 
More abstract … 
… 
… 
features 
features 
input 
44!
Layer-Wise Unsupervised Pre-training Layer-wise Unsupervised Learning 
reconstruction 
of features = 
More abstract … 
… 
… 
features 
features 
input 
? 
…… … 
45!
Layer-Wise Unsupervised Pre-training 
More abstract … 
… 
… 
features 
features 
input 
46!
教師なし事前学習 (unsupervised pre-training) 
Layer-wise Unsupervised Learning 
More abstract … 
… 
… 
features 
features 
input 
… 
Even more abstract 
features 
47!
教師有り事後学習(supervised post-training) 
Supervised Fine-Tuning 
More abstract … 
… 
… 
features 
features 
input 
… 
Even more abstract 
features 
Output 
f(X) six 
? 
Target 
= Y 
two! 
• AddiMonal!hypothesis:!features!good!for!P(x)!good!for!P(y|x)! 
48! 
slide credit: Bengio KDD 2014
深層学習手法 
• 大きく分けて2種類の有名な手法がある 
• 自己符号化器 (Autoencoders AE) 
• 数学が簡単 
• 実装が簡単 
• 理論的な解析がし難い 
• 制限ボルツマンマシン(Restricted Boltzman Machine RBM) 
• 確率モデルに基づく 
• 一部の条件ではAEと同じ最適化を行っている 
45
深層学習手法 
• 大きく分けて2種類の有名な手法がある 
• 自己符号化器 (Autoencoders AE) 
• 数学が簡単 
• 実装が簡単 
• 理論的な解析がし難い 
• 制限ボルツマンマシン(Restricted Boltzman Machine RBM) 
• 確率モデルに基づく 
• 一部の条件ではAEと同じ最適化を行っている 
46
自己符号化器 Autoencoder 
47 
特徴表現 
入力 
Encoder 
(符号化器) 
Decoder 
(復号化器)
自己符号化器 Autoencoder 
48 
特徴表現 
入力 
y = f(Wx + b) 
Encoder 
(符号化器) 
Decoder 
(復号化器) 
y 
x 
z = f(WTy+ b’) 
誤差=||x-z||2
自己符号化器 
49 
隠れ層 
y1 y2 y3 +1 
x1 x2 x3 +1 
入力層
自己符号化器 
50 
隠れ層 
y1 y2 y3 +1 
x1 x2 x3 +1 
入力層 
wij : xj —> yi 
b3 
W32 
符号化器の部分
詳細 
• 復号化器の行列W’は符号化器の行列Wの転置とすること 
で学習すべきパラメータ数を減らす 
• bとb’はバイヤス項と呼ばれており,入力の値がどの基 
本レベルを中心に変動しているかを表わしている. 
• 常にONとなっている(+1)特徴が存在すると仮定し,それ 
に対する重みとしてバイヤスを解釈することができる. 
• 関数fはそれぞれの次元毎に何らかの非線形な演算を 
行っている.これがなければ主成分分析(PCA)と同じ 
く,線形な関係しか扱うことができない! 
51
基本的な流れ 
1. 入力xを符号化器で符号化する. 
1. Wx + bを計算し,それをfに入力する 
2. (1)の出力yを復号化器に入力させて,入力を再現する. 
1. WTy+ b’を計算し,それをfに入力する 
3. (2)の結果zと元の入力xを比較する. 
1. 誤差関数を問題依存する.実数特徴ならば自乗誤差,バイナリな 
らば交差エントロピー誤差を使う. 
4. (3)の誤差を最小となるようにパラメータ(W, b, b’)を調整する. 
1. 誤差をパラメータで微分し,それをゼロとなるようなパラメータ 
値を求める.(確率的勾配法) 
52
確率的勾配法 
• 英語:Stochastic Gradient Descent (SGD) 
• 誤差が最小となる方向(勾配と逆向き)へ少しずつ移動する 
53 
x(t+1) = x(t)  ⌘ 
θ tan(θ)=∂y/∂x 
勾配 
@E(x, z) 
@x |t=t
確率的勾配法 
• 英語:Stochastic Gradient Descent (SGD) 
• 誤差が最小となる方向(勾配と逆向き)へ少しずつ移動する 
54 
x(t+1) = x(t)  ⌘ 
θ tan(θ)=∂y/∂x 
勾配 
@E(x, z) 
@x |t=t 
現代の多くの機械学習 
アルゴリズムの最適化に 
使われている
まずは手計算 
3つの入力ノードと3 つの隠れノードの場合 
y1 = f(x1W11 + x2W12 + x3W13 + b1) y2 = f(x1W21 + x2W22 + x3W23 + b2) y3 55 
= f(x1W31 + x2W32 + x3W33 + b3) 1 y1 y2 y3 +1 
b3 
W32 
x1 x2 x3 +1 
自己符号化器の導出 
ボレガラ ダヌシカ 
1 3つの入力ノードと3 つの隠れノードの場合 
y1 = f(x1W11 + x2W12 + x3W13 + b1) y2 = f(x1W21 + x2W22 + x3W23 + b2) y3 = f(x1W31 + x2W32 + x3W33 + b3) ここで 
f(t) = 
1 
1 + exp(−t)
行列の形で表すと 
56 
y3 1 + exp(−t) 
= f(x1W31 + x2W32 + x3W33 + b3) (3) 
f(t) = 
1 
1 + exp(−t) 
(4) 
, 
W= 
⎛ 
⎝ 
w11 w12 w13 
w21 w22 w23 
w31 w32 w33 
⎞ 
⎠ (5) 
ここで 
f(t) = 
1 
1 + exp(−t) 
(4) 
⎞ 
⎠ x = 
行列式として書くと, 
W= 
⎛ 
⎝ 
w11 w12 w13 
w21 w22 w23 
w31 w32 w33 
⎞ 
⎠ y = 
⎞ 
⎠ (5) 
b = 
⎛ 
⎝ 
b1 
b2 
b3 
⎞ 
⎠ z = 
⎞ 
⎠ (6) 
1 
w31 w32 w33 
b = 
⎛ 
⎝ 
b1 
b2 
b3 
⎛ 
⎝ 
x1 
x2 
x3 
⎛ 
⎝ 
y1 
y2 
y3 
⎛ 
⎞ 
z1 
⎝ 
z2 
⎠ z3 
b′ = 
⎛ 
⎞ 
b′⎝ 
1 
b′⎠ 2 
b′3 
1 
W= 
w21 w22 w23 
w31 w32 w33 
(5) 
b = 
⎛ 
⎝ 
b1 
b2 
b3 
⎞ 
⎠ (6) 
x = 
⎛ 
⎝ 
x1 
x2 
x3 
⎞ 
⎠ (7) 
y = 
⎛ 
⎝ 
y1 
y2 
y3 
⎞ 
⎠ (8) 
z = 
⎛ 
⎝ 
z1 
z2 
z3 
⎞ 
⎠ (9) 
b′ = 
⎛ 
⎝ 
b′1 
b′2 
b′3 
⎞ 
⎠ (10) 
1 
b = 
⎛ 
⎝ 
b1 
b2 
b3 
⎞ 
⎠ (6) 
x = 
⎛ 
⎝ 
x1 
x2 
x3 
⎞ 
⎠ (7) 
y = 
⎛ 
⎝ 
y1 
y2 
y3 
⎞ 
⎠ (8) 
z = 
⎛ 
⎝ 
z1 
z2 
z3 
⎞ 
⎠ (9) 
b′ = 
⎛ 
⎝ 
b′1 
b′2 
b′3 
⎞ 
⎠ (10) 
1 
(4) 
行列式として書くと, 
W= 
⎛ 
⎝ 
w11 w12 w13 
w21 w22 w23 
w31 w32 w33 
⎞ 
⎠ (5) 
b = 
⎛ 
⎝ 
b1 
b2 
b3 
⎞ 
⎠ (6) 
x = 
⎛ 
⎝ 
x1 
x2 
x3 
⎞ 
⎠ (7) 
y = 
⎛ 
⎝ 
y1 
y2 
y3 
⎞ 
⎠ (8) 
z = 
⎛ 
⎝ 
z1 
z2 
z3 
⎞ 
⎠ (9) 
b′ = 
⎛ 
⎝ 
b′1 
b′2 
b′3 
⎞ 
⎠ (10) 
1 
x = 
⎛ 
⎝ 
x1 
x2 
x3 
⎞ 
⎠ (7) 
y = 
⎛ 
⎝ 
y1 
y2 
y3 
⎞ 
⎠ (8) 
z = 
⎛ 
⎝ 
z1 
z2 
z3 
⎞ 
⎠ (9) 
b′ = 
⎛ 
⎝ 
b′1 
b′2 
b′3 
⎞ 
⎠ (10) 
y = f(Wx + b) (11) 
1
復号化の部分 
57 
復号化の部分は, 
z1 = f(y1W11 + y2W21 + y3W31 + b′1) (12) 
z2 = f(y1W12 + y2W22 + y3W32 + b′2) (13) 
z3 = f(y1W13 + y2W23 + y3W33 + b′3) (14) 
復号化の部分は, 
z1 = f(y1W11 + y2W21 + y3W31 + b′1) (12) 
z2 = f(y1W12 + y2W22 + y3W32 + b′2) (13) 
z3 = f(y1W13 + y2W23 + y3W33 + b′3) (14) 
行列式として書くと, 
z = f(W⊤y + b′) (15) 
復号化の部分は, 
z1 = f(y1W11 + y2W21 + y3W31 + b′1) (12) 
z2 = f(y1W12 + y2W22 + y3W32 + b′2) (13) 
z3 = f(y1W13 + y2W23 + y3W33 + b′3) (14) 
行列式として書くと, 
z = f(W⊤y + b′) (15) 
自乗誤差(squared loss) を考える 
||x − z||2 = 
!d 
k=1 
(xk − zk)2 (16) 
自乗誤差
パラメータ更新 
58 
行列式として書くと, 
z = f(W⊤y + b′) (15) 
自乗誤差(squared loss) を考える 
||x − z||2 = 
!d 
k=1 
(xk − zk)2 (16) 
例えば,w12 の値を更新するための更新式を導出する. 
∂ ||x − z||2 
∂w12 
= −2(x − z) 
∂z2 
∂w12 
∂z2 
∂wij 
= 
∂ 
∂wij 
f(w12jy1 + w22y2 + w32y3 + b′2) 
ここで 
t = w12jy1 + w22y2 + w32y3 + b′2 
とすると, 
∂f(t) 
∂w12 
= 
∂f(t) 
∂t 
∂t 
∂w12 
= 
exp(−t) 
(1 + exp(−t))2 y1 = σ(t)(1 − σ(t))y1 
z2 = f(y1W12 + y2W22 + y3W32 + b′2) (13) 
z3 = f(y1W13 + y2W23 + y3W33 + b′3) (14) 
行列式として書くと, 
z = f(W⊤y + b′) (15) 
自乗誤差(squared loss) を考える 
||x − z||2 = 
!d 
k=1 
(xk − zk)2 (16) 
例えば,w12 の値を更新するための更新式を導出する. 
∂ ||x − z||2 
∂w12 
= −2(x − z) 
∂z2 
∂w12 
∂z2 
∂wij 
= 
∂ 
∂wij 
f(w12jy1 + w22y2 + w32y3 + b′2) 
ここで 
t = w12jy1 + w22y2 + w32y3 + b′2 
とすると, 
∂f(t) 
∂w12 
= 
∂f(t) 
∂t 
∂t 
∂w12 
= 
exp(−t) 
(1 + exp(−t))2 y1 = σ(t)(1 − σ(t))y1 
よって, 
∂ ||x − z||2 
∂= −2(x − z)σ(t)(1 − σ(t))y1 
行列式として書くと, 
z = f(W⊤y + b′) (15) 
自乗誤差(squared loss) を考える 
||x − z||2 = 
!d 
k=1 
(xk − zk)2 (16) 
例えば,w12 の値を更新するための更新式を導出する. 
∂ ||x − z||2 
∂w12 
= −2(x − z) 
∂z2 
∂w12 
∂z2 
∂wij 
= 
∂ 
∂wij 
f(w12jy1 + w22y2 + w32y3 + b′2) 
ここで 
t = w12jy1 + w22y2 + w32y3 + b′2 
とすると, 
∂f(t) 
∂w12 
= 
∂f(t) 
∂t 
∂t 
∂w12 
= 
exp(−t) 
(1 + exp(−t))2 y1 = σ(t)(1 − σ(t))y1 
よって, 
∂ ||x − z||2 
∂w12 
= −2(x − z)σ(t)(1 − σ(t))y1 
w12 に関する更新式は, 
w(n+1) 
12 = w(n) 
12 + 2η(x − z)σ(t)(1 − σ(t))y1
結果を詳しく見てみる 
• 最後に得られた更新式の右辺ではx(入力)が分かればyが分かり,z 
が分かるので(x-z)が計算できる. 
• yが分かればtが計算できるのでシグモイド関数の値も計算できる 
• よってWの値が更新できる 
• 同様にしてbとb’に関する更新式も導入できる. 
• アルゴリズム 
• パラメータを全てのランダムに初期化をする 
• 更新式に従って更新する(決まった回数分,収束するまで,…) 
• 最終的なパラメータ値を返す.それが自己符号化器のパラメータとなる. 
59
実践
Theano 
• Pythonで書かれた汎用的な数値解析ライブラリ 
• 深層学習に向いている理由 
• 自動的にGPUへの最適化をしてくれる! 
• 自動微分ができる! 
• 自己符号化器,制限ボルツマンマシンなど深 
層学習でよく出てくるモジュールが既に含ま 
れている 
61
Theanoを使ったAEの実装 
• ソース(Deep Learning Tutorial) 
• http://deeplearning.net/tutorial/gettingstarted.html 
• git clone git://github.com/lisa-lab/DeepLearningTutorials.git 
• Theanoのインストール 
• http://deeplearning.net/software/theano/install.html 
• 必要なもの(Python = 2.6, g++, python-dev, NumPy, SciPy, 
BLAS) 
• 全てopen sourceソフトでDebian系だとsudo apt-get installで 
インストールできる.(Mac OSX: brew/macports) 
62
参考文献 
• http://deeplearning.net/ [深層学習ポータル] 
• 人工知能学会誌,深層学習特集がある![日本語] 
• まもなく本がでます←宣伝 
• http://www.iro.umontreal.ca/~bengioy/dlbook/ [教科書] 
• http://deeplearning.net/software/theano/tutorial/ [Theano tutotial 
英語] 
• http://www.chino-js.com/ja/tech/theano-rbm/ [Theano入門:日本 
語,RBM実装] 
• http://www.slideshare.net/tushuhei/121227deep-learning-iitsuka 
[Theanoを使ったRBM/AE実装] 
63

Mais conteúdo relacionado

Mais procurados

ベイズ統計学の概論的紹介
ベイズ統計学の概論的紹介ベイズ統計学の概論的紹介
ベイズ統計学の概論的紹介Naoki Hayashi
 
[DL輪読会]Deep Learning 第15章 表現学習
[DL輪読会]Deep Learning 第15章 表現学習[DL輪読会]Deep Learning 第15章 表現学習
[DL輪読会]Deep Learning 第15章 表現学習Deep Learning JP
 
SSII2021 [OS2-01] 転移学習の基礎:異なるタスクの知識を利用するための機械学習の方法
SSII2021 [OS2-01] 転移学習の基礎:異なるタスクの知識を利用するための機械学習の方法SSII2021 [OS2-01] 転移学習の基礎:異なるタスクの知識を利用するための機械学習の方法
SSII2021 [OS2-01] 転移学習の基礎:異なるタスクの知識を利用するための機械学習の方法SSII
 
Semi supervised, weakly-supervised, unsupervised, and active learning
Semi supervised, weakly-supervised, unsupervised, and active learningSemi supervised, weakly-supervised, unsupervised, and active learning
Semi supervised, weakly-supervised, unsupervised, and active learningYusuke Uchida
 
機械学習におけるオンライン確率的最適化の理論
機械学習におけるオンライン確率的最適化の理論機械学習におけるオンライン確率的最適化の理論
機械学習におけるオンライン確率的最適化の理論Taiji Suzuki
 
DEEP LEARNING、トレーニング・インファレンスのGPUによる高速化
DEEP LEARNING、トレーニング・インファレンスのGPUによる高速化DEEP LEARNING、トレーニング・インファレンスのGPUによる高速化
DEEP LEARNING、トレーニング・インファレンスのGPUによる高速化RCCSRENKEI
 
「統計的学習理論」第1章
「統計的学習理論」第1章「統計的学習理論」第1章
「統計的学習理論」第1章Kota Matsui
 
[DL輪読会]Understanding Black-box Predictions via Influence Functions
[DL輪読会]Understanding Black-box Predictions via Influence Functions [DL輪読会]Understanding Black-box Predictions via Influence Functions
[DL輪読会]Understanding Black-box Predictions via Influence Functions Deep Learning JP
 
【DL輪読会】時系列予測 Transfomers の精度向上手法
【DL輪読会】時系列予測 Transfomers の精度向上手法【DL輪読会】時系列予測 Transfomers の精度向上手法
【DL輪読会】時系列予測 Transfomers の精度向上手法Deep Learning JP
 
[DL輪読会]MetaFormer is Actually What You Need for Vision
[DL輪読会]MetaFormer is Actually What You Need for Vision[DL輪読会]MetaFormer is Actually What You Need for Vision
[DL輪読会]MetaFormer is Actually What You Need for VisionDeep Learning JP
 
深層学習 勉強会第5回 ボルツマンマシン
深層学習 勉強会第5回 ボルツマンマシン深層学習 勉強会第5回 ボルツマンマシン
深層学習 勉強会第5回 ボルツマンマシンYuta Sugii
 
[DL輪読会]Learning quadrupedal locomotion over challenging terrain
[DL輪読会]Learning quadrupedal locomotion over  challenging terrain[DL輪読会]Learning quadrupedal locomotion over  challenging terrain
[DL輪読会]Learning quadrupedal locomotion over challenging terrainDeep Learning JP
 
グラフィカルモデル入門
グラフィカルモデル入門グラフィカルモデル入門
グラフィカルモデル入門Kawamoto_Kazuhiko
 
SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向
SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向
SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向SSII
 
ICML 2021 Workshop 深層学習の不確実性について
ICML 2021 Workshop 深層学習の不確実性についてICML 2021 Workshop 深層学習の不確実性について
ICML 2021 Workshop 深層学習の不確実性についてtmtm otm
 
[DL輪読会]Energy-based generative adversarial networks
[DL輪読会]Energy-based generative adversarial networks[DL輪読会]Energy-based generative adversarial networks
[DL輪読会]Energy-based generative adversarial networksDeep Learning JP
 
Priorに基づく画像/テンソルの復元
Priorに基づく画像/テンソルの復元Priorに基づく画像/テンソルの復元
Priorに基づく画像/テンソルの復元Tatsuya Yokota
 
データサイエンス概論第一=8 パターン認識と深層学習
データサイエンス概論第一=8 パターン認識と深層学習データサイエンス概論第一=8 パターン認識と深層学習
データサイエンス概論第一=8 パターン認識と深層学習Seiichi Uchida
 

Mais procurados (20)

ベイズ統計学の概論的紹介
ベイズ統計学の概論的紹介ベイズ統計学の概論的紹介
ベイズ統計学の概論的紹介
 
[DL輪読会]Deep Learning 第15章 表現学習
[DL輪読会]Deep Learning 第15章 表現学習[DL輪読会]Deep Learning 第15章 表現学習
[DL輪読会]Deep Learning 第15章 表現学習
 
SSII2021 [OS2-01] 転移学習の基礎:異なるタスクの知識を利用するための機械学習の方法
SSII2021 [OS2-01] 転移学習の基礎:異なるタスクの知識を利用するための機械学習の方法SSII2021 [OS2-01] 転移学習の基礎:異なるタスクの知識を利用するための機械学習の方法
SSII2021 [OS2-01] 転移学習の基礎:異なるタスクの知識を利用するための機械学習の方法
 
Semi supervised, weakly-supervised, unsupervised, and active learning
Semi supervised, weakly-supervised, unsupervised, and active learningSemi supervised, weakly-supervised, unsupervised, and active learning
Semi supervised, weakly-supervised, unsupervised, and active learning
 
機械学習におけるオンライン確率的最適化の理論
機械学習におけるオンライン確率的最適化の理論機械学習におけるオンライン確率的最適化の理論
機械学習におけるオンライン確率的最適化の理論
 
Deep Learning
Deep LearningDeep Learning
Deep Learning
 
DEEP LEARNING、トレーニング・インファレンスのGPUによる高速化
DEEP LEARNING、トレーニング・インファレンスのGPUによる高速化DEEP LEARNING、トレーニング・インファレンスのGPUによる高速化
DEEP LEARNING、トレーニング・インファレンスのGPUによる高速化
 
「統計的学習理論」第1章
「統計的学習理論」第1章「統計的学習理論」第1章
「統計的学習理論」第1章
 
[DL輪読会]Understanding Black-box Predictions via Influence Functions
[DL輪読会]Understanding Black-box Predictions via Influence Functions [DL輪読会]Understanding Black-box Predictions via Influence Functions
[DL輪読会]Understanding Black-box Predictions via Influence Functions
 
【DL輪読会】時系列予測 Transfomers の精度向上手法
【DL輪読会】時系列予測 Transfomers の精度向上手法【DL輪読会】時系列予測 Transfomers の精度向上手法
【DL輪読会】時系列予測 Transfomers の精度向上手法
 
[DL輪読会]MetaFormer is Actually What You Need for Vision
[DL輪読会]MetaFormer is Actually What You Need for Vision[DL輪読会]MetaFormer is Actually What You Need for Vision
[DL輪読会]MetaFormer is Actually What You Need for Vision
 
深層学習 勉強会第5回 ボルツマンマシン
深層学習 勉強会第5回 ボルツマンマシン深層学習 勉強会第5回 ボルツマンマシン
深層学習 勉強会第5回 ボルツマンマシン
 
[DL輪読会]Learning quadrupedal locomotion over challenging terrain
[DL輪読会]Learning quadrupedal locomotion over  challenging terrain[DL輪読会]Learning quadrupedal locomotion over  challenging terrain
[DL輪読会]Learning quadrupedal locomotion over challenging terrain
 
最急降下法
最急降下法最急降下法
最急降下法
 
グラフィカルモデル入門
グラフィカルモデル入門グラフィカルモデル入門
グラフィカルモデル入門
 
SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向
SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向
SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向
 
ICML 2021 Workshop 深層学習の不確実性について
ICML 2021 Workshop 深層学習の不確実性についてICML 2021 Workshop 深層学習の不確実性について
ICML 2021 Workshop 深層学習の不確実性について
 
[DL輪読会]Energy-based generative adversarial networks
[DL輪読会]Energy-based generative adversarial networks[DL輪読会]Energy-based generative adversarial networks
[DL輪読会]Energy-based generative adversarial networks
 
Priorに基づく画像/テンソルの復元
Priorに基づく画像/テンソルの復元Priorに基づく画像/テンソルの復元
Priorに基づく画像/テンソルの復元
 
データサイエンス概論第一=8 パターン認識と深層学習
データサイエンス概論第一=8 パターン認識と深層学習データサイエンス概論第一=8 パターン認識と深層学習
データサイエンス概論第一=8 パターン認識と深層学習
 

Semelhante a 深層学習入門

ae-3. ディープラーニングの基礎
ae-3. ディープラーニングの基礎ae-3. ディープラーニングの基礎
ae-3. ディープラーニングの基礎kunihikokaneko1
 
Deep Learningの技術と未来
Deep Learningの技術と未来Deep Learningの技術と未来
Deep Learningの技術と未来Seiya Tokui
 
Image net classification with Deep Convolutional Neural Networks
Image net classification with Deep Convolutional Neural NetworksImage net classification with Deep Convolutional Neural Networks
Image net classification with Deep Convolutional Neural NetworksShingo Horiuchi
 
Cvim saisentan-6-4-tomoaki
Cvim saisentan-6-4-tomoakiCvim saisentan-6-4-tomoaki
Cvim saisentan-6-4-tomoakitomoaki0705
 
画像認識と深層学習
画像認識と深層学習画像認識と深層学習
画像認識と深層学習Yusuke Uchida
 
Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識Ken Morishita
 
深層学習 - 画像認識のための深層学習 ②
深層学習 - 画像認識のための深層学習 ②深層学習 - 画像認識のための深層学習 ②
深層学習 - 画像認識のための深層学習 ②Shohei Miyashita
 
ae-10. 中間まとめ(ディープラーニング)
ae-10. 中間まとめ(ディープラーニング)ae-10. 中間まとめ(ディープラーニング)
ae-10. 中間まとめ(ディープラーニング)kunihikokaneko1
 
Learning Deep Architectures for AI (第 3 回 Deep Learning 勉強会資料; 松尾)
Learning Deep Architectures for AI (第 3 回 Deep Learning 勉強会資料; 松尾)Learning Deep Architectures for AI (第 3 回 Deep Learning 勉強会資料; 松尾)
Learning Deep Architectures for AI (第 3 回 Deep Learning 勉強会資料; 松尾)Ohsawa Goodfellow
 
Deep learningの概要とドメインモデルの変遷
Deep learningの概要とドメインモデルの変遷Deep learningの概要とドメインモデルの変遷
Deep learningの概要とドメインモデルの変遷Taiga Nomi
 
DeNAにおける機械学習・深層学習活用
DeNAにおける機械学習・深層学習活用DeNAにおける機械学習・深層学習活用
DeNAにおける機械学習・深層学習活用Kazuki Fujikawa
 
Deeplearningとは?
Deeplearningとは?Deeplearningとは?
Deeplearningとは?Yuto Suzuki
 
深層学習(岡本孝之 著) - Deep Learning chap.1 and 2
深層学習(岡本孝之 著) - Deep Learning chap.1 and 2深層学習(岡本孝之 著) - Deep Learning chap.1 and 2
深層学習(岡本孝之 著) - Deep Learning chap.1 and 2Masayoshi Kondo
 
Deep learning勉強会20121214ochi
Deep learning勉強会20121214ochiDeep learning勉強会20121214ochi
Deep learning勉強会20121214ochiOhsawa Goodfellow
 
モジュールの凝集度・結合度・インタフェース
モジュールの凝集度・結合度・インタフェースモジュールの凝集度・結合度・インタフェース
モジュールの凝集度・結合度・インタフェースHajime Yanagawa
 
[DL輪読会]Learning to Act by Predicting the Future
[DL輪読会]Learning to Act by Predicting the Future[DL輪読会]Learning to Act by Predicting the Future
[DL輪読会]Learning to Act by Predicting the FutureDeep Learning JP
 
AIがAIを生み出す?
AIがAIを生み出す?AIがAIを生み出す?
AIがAIを生み出す?Daiki Tsuchiya
 

Semelhante a 深層学習入門 (20)

ae-3. ディープラーニングの基礎
ae-3. ディープラーニングの基礎ae-3. ディープラーニングの基礎
ae-3. ディープラーニングの基礎
 
MIRU2014 tutorial deeplearning
MIRU2014 tutorial deeplearningMIRU2014 tutorial deeplearning
MIRU2014 tutorial deeplearning
 
Deep Learningの技術と未来
Deep Learningの技術と未来Deep Learningの技術と未来
Deep Learningの技術と未来
 
Image net classification with Deep Convolutional Neural Networks
Image net classification with Deep Convolutional Neural NetworksImage net classification with Deep Convolutional Neural Networks
Image net classification with Deep Convolutional Neural Networks
 
Cvim saisentan-6-4-tomoaki
Cvim saisentan-6-4-tomoakiCvim saisentan-6-4-tomoaki
Cvim saisentan-6-4-tomoaki
 
20150930
2015093020150930
20150930
 
画像認識と深層学習
画像認識と深層学習画像認識と深層学習
画像認識と深層学習
 
Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識Pythonとdeep learningで手書き文字認識
Pythonとdeep learningで手書き文字認識
 
深層学習 - 画像認識のための深層学習 ②
深層学習 - 画像認識のための深層学習 ②深層学習 - 画像認識のための深層学習 ②
深層学習 - 画像認識のための深層学習 ②
 
ae-10. 中間まとめ(ディープラーニング)
ae-10. 中間まとめ(ディープラーニング)ae-10. 中間まとめ(ディープラーニング)
ae-10. 中間まとめ(ディープラーニング)
 
Learning Deep Architectures for AI (第 3 回 Deep Learning 勉強会資料; 松尾)
Learning Deep Architectures for AI (第 3 回 Deep Learning 勉強会資料; 松尾)Learning Deep Architectures for AI (第 3 回 Deep Learning 勉強会資料; 松尾)
Learning Deep Architectures for AI (第 3 回 Deep Learning 勉強会資料; 松尾)
 
Deep learningの概要とドメインモデルの変遷
Deep learningの概要とドメインモデルの変遷Deep learningの概要とドメインモデルの変遷
Deep learningの概要とドメインモデルの変遷
 
DeNAにおける機械学習・深層学習活用
DeNAにおける機械学習・深層学習活用DeNAにおける機械学習・深層学習活用
DeNAにおける機械学習・深層学習活用
 
Deeplearningとは?
Deeplearningとは?Deeplearningとは?
Deeplearningとは?
 
深層学習(岡本孝之 著) - Deep Learning chap.1 and 2
深層学習(岡本孝之 著) - Deep Learning chap.1 and 2深層学習(岡本孝之 著) - Deep Learning chap.1 and 2
深層学習(岡本孝之 著) - Deep Learning chap.1 and 2
 
Deep learning勉強会20121214ochi
Deep learning勉強会20121214ochiDeep learning勉強会20121214ochi
Deep learning勉強会20121214ochi
 
モジュールの凝集度・結合度・インタフェース
モジュールの凝集度・結合度・インタフェースモジュールの凝集度・結合度・インタフェース
モジュールの凝集度・結合度・インタフェース
 
[DL輪読会]Learning to Act by Predicting the Future
[DL輪読会]Learning to Act by Predicting the Future[DL輪読会]Learning to Act by Predicting the Future
[DL輪読会]Learning to Act by Predicting the Future
 
AIがAIを生み出す?
AIがAIを生み出す?AIがAIを生み出す?
AIがAIを生み出す?
 
Rainbow
RainbowRainbow
Rainbow
 

深層学習入門

  • 3. 概要 • 応用 • 理論 • 実践 3
  • 4. 深層学習 • 英語ではDeep Learning • 特徴の数段の組み合わせを考慮することでより複雑 な現象を学習する仕組み • 神経網回路(ニューラル・ネットワーク)の層を重ねる ことで学習することが殆ど • 人間の脳の仕組みに似ている? • とにかく,様々な認識タスクで大幅に良い精度を示 しており,Google, Facebook,Microsoft,…など多くの企 業が研究開発をしている. 4
  • 5. イメージ図 5 ピクセル 色特徴線認識形認識物体認識 教師信号
  • 6. 6 報道 Deep Learning in the News 13! Researcher Dreams Up Machines That Learn Without Humans 06.27.13 Scientists See Promise in Deep-Learning Programs John Markoff November 23, 2012 Google!taps!U! of!T!professor! to!teach! context!to! computers! 03.11.13! slide credit: Bengio KDD’14
  • 7. ヒントン先生(Google) 7 報道 Deep Learning in the News 13! Researcher Dreams Up Machines That Learn Without Humans 06.27.13 Scientists See Promise in Deep-Learning Programs John Markoff November 23, 2012 Google!taps!U! of!T!professor! to!teach! context!to! computers! 03.11.13! slide credit: Bengio KDD’14
  • 8. 8 報道 Deep Learning in the News 13! Researcher Dreams Up Machines That Learn Without Humans 06.27.13 Scientists See Promise in Deep-Learning Programs John Markoff November 23, 2012 Google!taps!U! of!T!professor! to!teach! context!to! computers! 03.11.13! ベンジオ先生 Montreal大学 slide credit: Bengio KDD’14
  • 9. 9 報道 Deep Learning in the News 13! LeCun先生 (Facebook) Researcher Dreams Up Machines That Learn Without Humans 06.27.13 Scientists See Promise in Deep-Learning Programs John Markoff November 23, 2012 Google!taps!U! of!T!professor! to!teach! context!to! computers! 03.11.13! slide credit: Bengio KDD’14
  • 11. 深層学習の実世界応用 • 画像認識 • 物体認識 • 情報検索 • 画像検索,機械翻訳,類似検索 • 音声 • 音声認識,話者同定 • ロボット工学 • 自動運転, ゲーム 11
  • 12. 認識タスクの概要 12 How$is$computer$percep>on$done?$ How$is$computer$percep>on$done?$ How$is$computer$percep>on$done?$ How$is$computer$percep>on$done?$ 入力低次元特徴学習アルゴリズム How$is$computer$percep>on$done?$ How$is$computer$percep>on$done?$ Image$ LowTlevel$ vision$features$ Recogni>on$ Object$ detec>on$ Input Data Learning Algorithm Low-level features Slide$Credit:$Honglak$Lee$ Audio$ classifica>on$ Audio$ LowTlevel$ audio$features$ Speaker$ iden>fica>on$ Image$ LowTlevel$ vision$features$ Recogni>on$ Object$ detec>on$ Input Data Learning Algorithm Low-level features Slide$Credit:$Honglak$Lee$ Audio$ classifica>on$ Audio$ LowTlevel$ audio$features$ Speaker$ iden>fica>on$ Image$ LowTlevel$ vision$features$ Recogni>on$ Object$ detec>on$ Input Data Learning Algorithm Low-level features Slide$Credit:$Honglak$Lee$ Audio$ classifica>on$ Audio$ LowTlevel$ audio$features$ Speaker$ iden>fica>on$ 物体認識 低次元画像特徴認識 Image$ LowTlevel$ vision$features$ Recogni>on$ Object$ detec>on$ Input Data Learning Algorithm Low-level features Slide$Credit:$Honglak$Lee$ Audio$ classifica>on$ Audio$ LowTlevel$ audio$features$ Speaker$ iden>fica>on$ Image$ LowTlevel$ vision$features$ Recogni>on$ Object$ detec>on$ Input Data Learning Algorithm Low-level features Slide$Credit:$Honglak$Lee$ Audio$ classifica>on$ Audio$ LowTlevel$ audio$features$ Speaker$ iden>fica>on$ Image$ LowTlevel$ vision$features$ Recogni>on$ Object$ detec>on$ Input Data Learning Algorithm Low-level features Slide$Credit:$Honglak$Lee$ Audio$ classifica>on$ Audio$ LowTlevel$ audio$features$ Speaker$ iden>fica>on$ 話者同定 低次元音声特徴同定 slide credit: Honglak Lee
  • 13. 画像特徴量 13 Computer$vision$features$ SIFT$ Spin$image$ HoG$ RIFT$ Textons$ GLOH$ Slide$Credit:$Honglak$Lee$
  • 14. 音声特徴量 14 Audio$features$ Spectrogram$ MFCC$ Flux$ ZCR$ Rolloff$
  • 15. 画像認識 Krizhevsky+ NIPS’12 • デモ:http://deeplearning.cs.toronto.edu/ Figure 4: (Left) Eight ILSVRC-2010 test images and the five labels considered The correct label is written under each image, and the probability assigned 15
  • 16. 類似画像検索 16 images and the five labels considered most probable by our model. and the probability assigned to the correct label is also shown Right) Five ILSVRC-2010 test images in the first column. The Krizhevsky+ NIPS’12 今は20層の深層学習 by Google!
  • 17. 衛星写真から道の推定 17 Predic>ng$Roads$from$ Satellite$Images$ (Mnih$and$Hinton, ICML 2012)!
  • 18. 衛星写真から道の推定 18 Predic>ng$Roads$from$ Satellite$Images$ (Mnih$and$Hinton, ICML 2012)!
  • 19. アナロジー問題 • 単語の意味をどのように表すか • 他の単語との共起頻度を要素とするベクトルで表す • 分布説 • 単語の意味はその周辺単語で決まる • 単語の意味表現学習する問題を「ある単語の周辺 に出現する他の単語を推定する」問題として解釈す る. • v(king) - v(man) + v(woman) が v(queen)と似ている! 19
  • 21. 深層学習の歴史 • ニューラル・ネットワークは1950年代から あった • 一層のニューラル・ネットワークでは線で分 類できるものしか認識できない • ミンスキー 1960年ころ 21
  • 23. パーセプトロン • Perceptronは単一層からなるニューラル・ネットワークである 23 x1 x2 x3 xn + … w1 w2 wn wn s = x1w1 + x2w2 + … + xnwn if s > 0: return 1 else: return 0 ロジスティクス関数 1.5 1 0.5 -2.4 -2 -1.6 -1.2 -0.8 -0.4 0 0.4 0.8 1.2 1.6 2 2.4 -0.5 -1 -1.5
  • 24. 線型分離可能性とは 24 + + + + + + + - - - - - - - - - - - - 2次元では線ですが,多次元だと平面となる. ax + by +c = 0
  • 25. 線型分離不可能な問題 25 XOR (排他的論理和) x=0 x=1 y=0 0 1 y=1 1 0 x y - + - + + - - - - - - - + + + + + +
  • 26. 線型分離不可能な問題 26 XOR (排他的論理和) x=0 x=1 y=0 0 1 y=1 1 0 x y - + - + + - - - - - - - + + + + + +
  • 27. 線型分離不可能な問題 27 XOR (排他的論理和) x=0 x=1 y=0 0 1 y=1 1 0 x y - + - + + - - - - - - - + + + + + +
  • 28. 線型分離不可能な問題 28 XOR (排他的論理和) x=0 x=1 y=0 0 1 y=1 1 0 x y - + - + + - - - - - - - + + + + + + どう頑張っても線を引いて分離不可能!
  • 29. そんな単純なこともできないの? • XORは至るところで現るロジック • そんな単純なものも表現できないなら何の約にも立たない • 複数の層にすれば扱えるが重みの学習をどうして良いか 分からない • error backpropagation (誤差逆伝播法)が1980年代に考案 され,使われる • しかし,複数層で学習すると「過学習になりやすい」し遅い. そんなに沢山のパラメータが学習できるほどデータがない. • ニューラル・ネットワークの暗黒時代 29
  • 30. 過学習 (over-fitting) • 学習データに当てはめすぎて,汎化できなくなる現象 • 学習時:高精度,テスト時:低精度 • 原因 • モデルの自由度が高すぎる • 学習データの量が少なすぎる 30
  • 31. 過学習 31 Non-linearities: Why they’re needed 同じ10個の点を多項式 を使って説明する場合 (多項式を当てはまる場合) できるだけ小さい次元の多項式 を使った方が過学習になり難い. !問題は次元数よりも, 特徴の値の変化である. !オッカムのカミソリ 同じ現象を説明するならより 簡単な仮説の方が望ましい For$logis>c$regression:$map$to$probabili>es$ Here:$func>on$approxima>on,$$ g.,$regression$or$classifica>on$ Without$non;lineari>es,$deep$neural$networks$ can’t$do$anything$more$than$a$linear$transform$ • Extra$layers$could$just$be$compiled$down$into$ a$single$linear$transform$ Probabilis>c$interpreta>on$unnecessary$except$in$ the$Boltzmann$machine/graphical$models$ • People$oen$use$other$non;lineari>es,$such$as$ tanh,$as$we’ll$discuss$in$part$3$
  • 32. 深層学習の長点 • 特徴を自分で考えなくて良い,基本特徴量さえ 作成しておけば,その有効な組み合わせが自動 的に学習できる. • ラベル無しのデータからでもこの「有効な組 み合わせ」が学習可能 • 大域的な表現が可能 (distributed representations) • 深層学習(大域的な表現学習)vs. クラスタリ ング(局所的な表現学習) 32
  • 33. 局所的 vs. 大域的表現 33 Local$vs.$Distributed$Representa>ons$ • $Clustering,$Nearest$ Neighbors,$RBF$SVM,$local$ density$es>mators$$$ Learned$ prototypes$ Local$regions$ • $RBMs,$Factor$models,$ PCA,$Sparse$Coding,$ Deep$models$ C1=1$ C1=0$ C2=1$ C1=1$ C2=1$ C2=0$ C1=0$ C2=0$ C1$ C2$ C3$ • $Parameters$for$each$region.$ • $#$of$regions$is$linear$with$$$$$$$ $$#$of$parameters.$ Bengio, 2009, Foundations and Trends in Machine Learning! slide credit: Salakhutdinov KDD’14
  • 34. 局所的 vs. 大域的表現 Local$vs.$Distributed$Representa>ons$ • $Clustering,$Nearest$ Neighbors,$RBF$SVM,$local$ density$es>mators$$$ slide credit: Salakhutdinov KDD’14 34 Learned$ prototypes$ Local$regions$ C1=1$ C3=0$ C1=0$ C3=0$ C3=0$ C2=1$ C1=1$ C2=1$ C2=0$ C1=0$ C2=0$ C3=0$ C1=1$ C2=1$ C3=1$ C1=0$ C2=1$ C3=1$ C1=0$ C2=0$ C3=1$ • $RBMs,$Factor$models,$ PCA,$Sparse$Coding,$ Deep$models$ • $Parameters$for$each$region.$ • $#$of$regions$is$linear$with$$$$$$$ $$#$of$parameters.$ C1$ C2$ C3$ Bengio, 2009, Foundations and Trends in Machine Learning!
  • 35. 深層学習の大発見! • 層を重ねることでより表現豊なニューラル・ ネットワークが学習できることが分かってい たが,いかに過学習を避けるかが課題だった • 貪欲法(greedy layer-wise training) • 2つの層だけで学習を行い,そのように学習 させた2つずつの層を重ねるとよい! • A Fast Learning Algorithm for Deep Belief Nets, Hinton et al., Neural Computing, 2006. 35
  • 37. Layer-Wise Unsupervised Pre-training … … features input 41!
  • 38. Layer-Wise Unsupervised Pre-training … of input = … … reconstruction features input ? … input 42!
  • 39. Layer-Wise Unsupervised Pre-training … … features input 43!
  • 40. Layer-Wise Unsupervised Pre-training More abstract … … … features features input 44!
  • 41. Layer-Wise Unsupervised Pre-training Layer-wise Unsupervised Learning reconstruction of features = More abstract … … … features features input ? …… … 45!
  • 42. Layer-Wise Unsupervised Pre-training More abstract … … … features features input 46!
  • 43. 教師なし事前学習 (unsupervised pre-training) Layer-wise Unsupervised Learning More abstract … … … features features input … Even more abstract features 47!
  • 44. 教師有り事後学習(supervised post-training) Supervised Fine-Tuning More abstract … … … features features input … Even more abstract features Output f(X) six ? Target = Y two! • AddiMonal!hypothesis:!features!good!for!P(x)!good!for!P(y|x)! 48! slide credit: Bengio KDD 2014
  • 45. 深層学習手法 • 大きく分けて2種類の有名な手法がある • 自己符号化器 (Autoencoders AE) • 数学が簡単 • 実装が簡単 • 理論的な解析がし難い • 制限ボルツマンマシン(Restricted Boltzman Machine RBM) • 確率モデルに基づく • 一部の条件ではAEと同じ最適化を行っている 45
  • 46. 深層学習手法 • 大きく分けて2種類の有名な手法がある • 自己符号化器 (Autoencoders AE) • 数学が簡単 • 実装が簡単 • 理論的な解析がし難い • 制限ボルツマンマシン(Restricted Boltzman Machine RBM) • 確率モデルに基づく • 一部の条件ではAEと同じ最適化を行っている 46
  • 47. 自己符号化器 Autoencoder 47 特徴表現 入力 Encoder (符号化器) Decoder (復号化器)
  • 48. 自己符号化器 Autoencoder 48 特徴表現 入力 y = f(Wx + b) Encoder (符号化器) Decoder (復号化器) y x z = f(WTy+ b’) 誤差=||x-z||2
  • 49. 自己符号化器 49 隠れ層 y1 y2 y3 +1 x1 x2 x3 +1 入力層
  • 50. 自己符号化器 50 隠れ層 y1 y2 y3 +1 x1 x2 x3 +1 入力層 wij : xj —> yi b3 W32 符号化器の部分
  • 51. 詳細 • 復号化器の行列W’は符号化器の行列Wの転置とすること で学習すべきパラメータ数を減らす • bとb’はバイヤス項と呼ばれており,入力の値がどの基 本レベルを中心に変動しているかを表わしている. • 常にONとなっている(+1)特徴が存在すると仮定し,それ に対する重みとしてバイヤスを解釈することができる. • 関数fはそれぞれの次元毎に何らかの非線形な演算を 行っている.これがなければ主成分分析(PCA)と同じ く,線形な関係しか扱うことができない! 51
  • 52. 基本的な流れ 1. 入力xを符号化器で符号化する. 1. Wx + bを計算し,それをfに入力する 2. (1)の出力yを復号化器に入力させて,入力を再現する. 1. WTy+ b’を計算し,それをfに入力する 3. (2)の結果zと元の入力xを比較する. 1. 誤差関数を問題依存する.実数特徴ならば自乗誤差,バイナリな らば交差エントロピー誤差を使う. 4. (3)の誤差を最小となるようにパラメータ(W, b, b’)を調整する. 1. 誤差をパラメータで微分し,それをゼロとなるようなパラメータ 値を求める.(確率的勾配法) 52
  • 53. 確率的勾配法 • 英語:Stochastic Gradient Descent (SGD) • 誤差が最小となる方向(勾配と逆向き)へ少しずつ移動する 53 x(t+1) = x(t) ⌘ θ tan(θ)=∂y/∂x 勾配 @E(x, z) @x |t=t
  • 54. 確率的勾配法 • 英語:Stochastic Gradient Descent (SGD) • 誤差が最小となる方向(勾配と逆向き)へ少しずつ移動する 54 x(t+1) = x(t) ⌘ θ tan(θ)=∂y/∂x 勾配 @E(x, z) @x |t=t 現代の多くの機械学習 アルゴリズムの最適化に 使われている
  • 55. まずは手計算 3つの入力ノードと3 つの隠れノードの場合 y1 = f(x1W11 + x2W12 + x3W13 + b1) y2 = f(x1W21 + x2W22 + x3W23 + b2) y3 55 = f(x1W31 + x2W32 + x3W33 + b3) 1 y1 y2 y3 +1 b3 W32 x1 x2 x3 +1 自己符号化器の導出 ボレガラ ダヌシカ 1 3つの入力ノードと3 つの隠れノードの場合 y1 = f(x1W11 + x2W12 + x3W13 + b1) y2 = f(x1W21 + x2W22 + x3W23 + b2) y3 = f(x1W31 + x2W32 + x3W33 + b3) ここで f(t) = 1 1 + exp(−t)
  • 56. 行列の形で表すと 56 y3 1 + exp(−t) = f(x1W31 + x2W32 + x3W33 + b3) (3) f(t) = 1 1 + exp(−t) (4) , W= ⎛ ⎝ w11 w12 w13 w21 w22 w23 w31 w32 w33 ⎞ ⎠ (5) ここで f(t) = 1 1 + exp(−t) (4) ⎞ ⎠ x = 行列式として書くと, W= ⎛ ⎝ w11 w12 w13 w21 w22 w23 w31 w32 w33 ⎞ ⎠ y = ⎞ ⎠ (5) b = ⎛ ⎝ b1 b2 b3 ⎞ ⎠ z = ⎞ ⎠ (6) 1 w31 w32 w33 b = ⎛ ⎝ b1 b2 b3 ⎛ ⎝ x1 x2 x3 ⎛ ⎝ y1 y2 y3 ⎛ ⎞ z1 ⎝ z2 ⎠ z3 b′ = ⎛ ⎞ b′⎝ 1 b′⎠ 2 b′3 1 W= w21 w22 w23 w31 w32 w33 (5) b = ⎛ ⎝ b1 b2 b3 ⎞ ⎠ (6) x = ⎛ ⎝ x1 x2 x3 ⎞ ⎠ (7) y = ⎛ ⎝ y1 y2 y3 ⎞ ⎠ (8) z = ⎛ ⎝ z1 z2 z3 ⎞ ⎠ (9) b′ = ⎛ ⎝ b′1 b′2 b′3 ⎞ ⎠ (10) 1 b = ⎛ ⎝ b1 b2 b3 ⎞ ⎠ (6) x = ⎛ ⎝ x1 x2 x3 ⎞ ⎠ (7) y = ⎛ ⎝ y1 y2 y3 ⎞ ⎠ (8) z = ⎛ ⎝ z1 z2 z3 ⎞ ⎠ (9) b′ = ⎛ ⎝ b′1 b′2 b′3 ⎞ ⎠ (10) 1 (4) 行列式として書くと, W= ⎛ ⎝ w11 w12 w13 w21 w22 w23 w31 w32 w33 ⎞ ⎠ (5) b = ⎛ ⎝ b1 b2 b3 ⎞ ⎠ (6) x = ⎛ ⎝ x1 x2 x3 ⎞ ⎠ (7) y = ⎛ ⎝ y1 y2 y3 ⎞ ⎠ (8) z = ⎛ ⎝ z1 z2 z3 ⎞ ⎠ (9) b′ = ⎛ ⎝ b′1 b′2 b′3 ⎞ ⎠ (10) 1 x = ⎛ ⎝ x1 x2 x3 ⎞ ⎠ (7) y = ⎛ ⎝ y1 y2 y3 ⎞ ⎠ (8) z = ⎛ ⎝ z1 z2 z3 ⎞ ⎠ (9) b′ = ⎛ ⎝ b′1 b′2 b′3 ⎞ ⎠ (10) y = f(Wx + b) (11) 1
  • 57. 復号化の部分 57 復号化の部分は, z1 = f(y1W11 + y2W21 + y3W31 + b′1) (12) z2 = f(y1W12 + y2W22 + y3W32 + b′2) (13) z3 = f(y1W13 + y2W23 + y3W33 + b′3) (14) 復号化の部分は, z1 = f(y1W11 + y2W21 + y3W31 + b′1) (12) z2 = f(y1W12 + y2W22 + y3W32 + b′2) (13) z3 = f(y1W13 + y2W23 + y3W33 + b′3) (14) 行列式として書くと, z = f(W⊤y + b′) (15) 復号化の部分は, z1 = f(y1W11 + y2W21 + y3W31 + b′1) (12) z2 = f(y1W12 + y2W22 + y3W32 + b′2) (13) z3 = f(y1W13 + y2W23 + y3W33 + b′3) (14) 行列式として書くと, z = f(W⊤y + b′) (15) 自乗誤差(squared loss) を考える ||x − z||2 = !d k=1 (xk − zk)2 (16) 自乗誤差
  • 58. パラメータ更新 58 行列式として書くと, z = f(W⊤y + b′) (15) 自乗誤差(squared loss) を考える ||x − z||2 = !d k=1 (xk − zk)2 (16) 例えば,w12 の値を更新するための更新式を導出する. ∂ ||x − z||2 ∂w12 = −2(x − z) ∂z2 ∂w12 ∂z2 ∂wij = ∂ ∂wij f(w12jy1 + w22y2 + w32y3 + b′2) ここで t = w12jy1 + w22y2 + w32y3 + b′2 とすると, ∂f(t) ∂w12 = ∂f(t) ∂t ∂t ∂w12 = exp(−t) (1 + exp(−t))2 y1 = σ(t)(1 − σ(t))y1 z2 = f(y1W12 + y2W22 + y3W32 + b′2) (13) z3 = f(y1W13 + y2W23 + y3W33 + b′3) (14) 行列式として書くと, z = f(W⊤y + b′) (15) 自乗誤差(squared loss) を考える ||x − z||2 = !d k=1 (xk − zk)2 (16) 例えば,w12 の値を更新するための更新式を導出する. ∂ ||x − z||2 ∂w12 = −2(x − z) ∂z2 ∂w12 ∂z2 ∂wij = ∂ ∂wij f(w12jy1 + w22y2 + w32y3 + b′2) ここで t = w12jy1 + w22y2 + w32y3 + b′2 とすると, ∂f(t) ∂w12 = ∂f(t) ∂t ∂t ∂w12 = exp(−t) (1 + exp(−t))2 y1 = σ(t)(1 − σ(t))y1 よって, ∂ ||x − z||2 ∂= −2(x − z)σ(t)(1 − σ(t))y1 行列式として書くと, z = f(W⊤y + b′) (15) 自乗誤差(squared loss) を考える ||x − z||2 = !d k=1 (xk − zk)2 (16) 例えば,w12 の値を更新するための更新式を導出する. ∂ ||x − z||2 ∂w12 = −2(x − z) ∂z2 ∂w12 ∂z2 ∂wij = ∂ ∂wij f(w12jy1 + w22y2 + w32y3 + b′2) ここで t = w12jy1 + w22y2 + w32y3 + b′2 とすると, ∂f(t) ∂w12 = ∂f(t) ∂t ∂t ∂w12 = exp(−t) (1 + exp(−t))2 y1 = σ(t)(1 − σ(t))y1 よって, ∂ ||x − z||2 ∂w12 = −2(x − z)σ(t)(1 − σ(t))y1 w12 に関する更新式は, w(n+1) 12 = w(n) 12 + 2η(x − z)σ(t)(1 − σ(t))y1
  • 59. 結果を詳しく見てみる • 最後に得られた更新式の右辺ではx(入力)が分かればyが分かり,z が分かるので(x-z)が計算できる. • yが分かればtが計算できるのでシグモイド関数の値も計算できる • よってWの値が更新できる • 同様にしてbとb’に関する更新式も導入できる. • アルゴリズム • パラメータを全てのランダムに初期化をする • 更新式に従って更新する(決まった回数分,収束するまで,…) • 最終的なパラメータ値を返す.それが自己符号化器のパラメータとなる. 59
  • 61. Theano • Pythonで書かれた汎用的な数値解析ライブラリ • 深層学習に向いている理由 • 自動的にGPUへの最適化をしてくれる! • 自動微分ができる! • 自己符号化器,制限ボルツマンマシンなど深 層学習でよく出てくるモジュールが既に含ま れている 61
  • 62. Theanoを使ったAEの実装 • ソース(Deep Learning Tutorial) • http://deeplearning.net/tutorial/gettingstarted.html • git clone git://github.com/lisa-lab/DeepLearningTutorials.git • Theanoのインストール • http://deeplearning.net/software/theano/install.html • 必要なもの(Python = 2.6, g++, python-dev, NumPy, SciPy, BLAS) • 全てopen sourceソフトでDebian系だとsudo apt-get installで インストールできる.(Mac OSX: brew/macports) 62
  • 63. 参考文献 • http://deeplearning.net/ [深層学習ポータル] • 人工知能学会誌,深層学習特集がある![日本語] • まもなく本がでます←宣伝 • http://www.iro.umontreal.ca/~bengioy/dlbook/ [教科書] • http://deeplearning.net/software/theano/tutorial/ [Theano tutotial 英語] • http://www.chino-js.com/ja/tech/theano-rbm/ [Theano入門:日本 語,RBM実装] • http://www.slideshare.net/tushuhei/121227deep-learning-iitsuka [Theanoを使ったRBM/AE実装] 63