SlideShare a Scribd company logo
パターン認識と機械学習 上
高宮 昂輝
本日の内容
5.3 誤差逆伝播
・5.3.1 誤差関数微分の評価
・5.3.2 単純な例
・5.3.3 逆伝播の効率
・5.3.4 ヤコビ行列
アブストラクト
5.3
誤差逆伝播と呼ばれるネットワーク上を誤差を逆向きに伝播させ、誤差関数の勾配を効率よく
評価するテクニックを学ぶ。
5.3.1
誤差逆伝播のテクニックを利用した誤差関数の重みに対する微分の評価を見ていく。誤差伝播
では、誤差をネットワーク上で逆向きに伝播させていくことで微分を評価する。
5.3.2
単純な例を用いて、誤差逆伝播のテクニックを使ってみる。
5.3.3
誤差逆伝播を用いた場合の計算の効率の良さを見ていく。
5.3.4
誤差逆伝播のテクニックをヤコビ行列に応用する。
5.3 誤差逆伝播
ニューラルネットワークについて
2層ニューラルネットワーク ネットワークの重み の最適化
誤差関数 の最小化
解析的には求められない
数値的な反復手順に頼る
最急降下法
共役勾配法
ニュートン法 など
数値的な反復手順の計算量(5.2.3節)
勾配情報を利用しない・・・
勾配情報を利用・・・
本節の内容について
フィードフォワードニューラルネットワークについて、誤差関数
の勾配を効率良く評価するテクニックを見つける
誤差逆伝播(backprop)として知られる
本節の目標
① 誤差関数の重みに関する微分の評価
② ①の微分を用いて重みの調整量を計算
逆伝播のテクニック
勾配降下法など
誤差関数の最小化における反復手続き
5.3.1 誤差関数微分の評価
逆伝播アルゴリズムの導出
独立同分布のデータ集合など、
実用上興味のある多くの誤差関数は次の通り
・任意のフィードフォワード構造
・任意の微分可能な非線形活性化関数
・広いクラスの誤差関数を持つ
今回扱うネットワーク
の評価を考える
オンライン手法・・・そのまま用いる
バッチ手法・・・すべてのデータ点について勾配の和を取る
誤差関数の微分の評価(線形モデル)
出力 ・・・ 入力・・・
・次のような単純な線形モデルを考える
目的・・・誤差関数の微分の評価
誤差関数(入力パターン )
誤差関数の微分の評価(線形モデル)
重み に関する勾配
出力側の「誤差信号」 入力側の変数
「局所的な」計算
誤差関数(入力パターン )
順伝播
ネットワークでのそれぞれのユニットへの入力
(5.48)を非線形関数 によって変換
順伝播(forward propagation)
誤差関数の微分の評価(一般のNN)
の重み に関する勾配
誤差関数 はユニット への入力 を通してのみ に依存する
ニューラルネットワークの関係式の例
目的・・・誤差関数の微分の評価
誤差関数の微分の評価(一般のNN)
誤差関数の微分の評価(一般のNN)
誤差関数の微分の式
以上より
誤差関数の微分の評価(一般のNN)
ある重みの出力側のユニットの ある重みの入力側のユニットの
隠れユニット、出力ユニットの を計算し、
に当てはめる
微分の評価
出力ユニットの評価
・出力ユニットの を考える
出力ユニットの活性化関数・・・正準連結関数 一般化線形モデル について
正準連結関数
目的変数の条件付き分布・・・指数型分布族
活性化関数・・・正準連結関数
詳しくは4.3.6節
出力ユニットの活性
化関数
誤差関数 誤差関数の特
定のユニットに
おける微分
回帰 恒等写像 二乗和誤差関数
2クラス
分類問題
シグモイド関数 交差エントロピー
誤差関数
多クラス
分類問題
ソフトマックス関数 多クラス交差エン
トロピー誤差関数
隠れユニットの評価
・隠れユニットの を考える
偏微分の連鎖法則
隠れユニットの評価(逆伝播公式)
逆伝播公式
以上より
逆伝播公式の意味
逆伝播公式
上流のユニットから
逆向きに伝播
誤差逆伝播の手続き
誤差逆伝播
1.入力ベクトル をネットワークに入れ、順伝播させて、すべての隠れユニットと出力ユニットの
出力を求める
2.(5.54)を用いてすべての出力ユニットの を評価
3.(5.56)を用いて を逆伝播させ、すべての隠れユニットの を得る
4.(5.53)を用いて必要な微分を評価
5.3.2 単純な例
今回考えるニューラルネットワーク
線形活性化関数
シグモイド活性化関数
構造・・・2層ネットワーク
誤差関数・・・二乗和誤差関数
出力ユニット・・・線形活性化関数
隠れユニット・・・シグモイド活性化関数
の便利な性質
(再掲)誤差逆伝播の手続き
誤差逆伝播
1.入力ベクトル をネットワークに入れ、順伝播させて、すべての隠れユニットと出力ユニットの
出力を求める
2.(5.54)を用いてすべての出力ユニットの を評価
3.(5.56)を用いて を逆伝播させ、すべての隠れユニットの を得る
4.(5.53)を用いて必要な微分を評価
(再掲)誤差逆伝播の手続き
誤差逆伝播
1.入力ベクトル をネットワークに入れ、順伝播させて、すべての隠れユニットと出力ユニットの
出力を求める
逆伝播を用いた重みの計算
(再掲)誤差逆伝播の手続き
誤差逆伝播
2.(5.54)を用いてすべての出力ユニットの を評価
逆伝播を用いた重みの計算
出力ユニットの活性化関数・・・線形活性化関数
(再掲)誤差逆伝播の手続き
誤差逆伝播
3.(5.56)を用いて を逆伝播させ、すべての隠れユニットの を得る
4.(5.53)を用いて必要な微分を評価
逆伝播を用いた重みの計算
逆伝播公式
第1層と第2層の重みに関する微分
5.3.3 逆伝播の効率
逆伝播の計算効率
逆伝播の重要な側面・・・計算上の効率の良さ
重みとバイアスの総数・・・
誤差関数の微分の評価に必要な計算量はどれだけか?
誤差関数の計算量
与えられた入力パターンに対し、誤差関数を一度評価・・・
順伝播(forward propagation)
一般に、ユニット数<<重みの総数
計算量の大部分はこっち 小さなオーバーヘッド
とみなせる
誤差関数の微分の近似
誤差関数の微分を計算する代わりのアプローチ・・・有限幅の差分による近似
中心差分
倍ほどの計算ステップが必要
前進差分
数値計算と誤差逆伝播
数値計算の主要な問題・・・計算量が という望ましい結果が失われる
順伝播・・・
回
数値計算 誤差逆伝播
数値微分は、逆伝播の正しさをチェックするためツールとして使える
5.3.4 ヤコビ行列
ヤコビ行列への応用
① 誤差関数の重みに関する微分の評価
② ①の微分を用いて重みの調整量を計算
逆伝播のテクニック
勾配降下法など
誤差関数の最小化における反復手続き
ヤコビ行列への応用
① 誤差関数の重みに関する微分の評価
② ①の微分を用いて重みの調整量を計算
逆伝播のテクニック
勾配降下法など
誤差関数の最小化における反復手続き
誤差逆伝播のテクニックは、他の微分の計算にも応用可能
ヤコビ行列の評価
ヤコビ行列と誤差逆伝播
・ヤコビ行列の評価を考える
各要素が出力の入力に関する微分
ヤコビ行列
ヤコビ行列が便利な役割を果たすシステムの例
ヤコビ行列が便利な役割を果たす例
誤差関数の微分
ヤコビ行列が便利な役割を果たす例
誤差関数の微分
ヤコビ行列
左図の赤いモジュールのヤコビ行列が(5.71)右辺に現れている
ヤコビ行列
ヤコビ行列・・・各入力変数の変化に対する出力の局所的な感度の指標
入力に任意の既知の誤差
出力誤差への寄与
訓練済みのネットワーク上を伝播
が小さければ成立
訓練済みのネットワークのネットワーク写像・・・非線形
ヤコビ行列の各成分は入力ベクトルに依存
ヤコビ行列の評価
ヤコビ行列の要素 について
・逆伝播の手続きを用いてヤコビ行列の評価を行う
ヤコビ行列での逆伝播
シグモイド活性化関数の場合 ソフトマックス関数の場合
ヤコビ行列の評価のまとめ
1.ヤコビ行列を求めたい入力空間内の点に相当する入力ベクトルをネットワーク
に入れ、隠れユニットと出力ユニットの出力を求める
2.出力ユニット に対応するヤコビ行列の 番目の行のそれぞれについて、
(5.75)あるいは(5.76)から始めて、再帰的な関係式(5.74)を用いてネットワー
ク内のすべての隠れユニットを逆伝播させる
3.(5.73)を用いて入力への逆伝播を行う。
ヤコビ行列を評価する手続き
今までの誤差の代わりに, を伝播する
ヤコビ行列の評価と数値微分
の入力を持つネットワークに対して 回の順伝播が必要
ヤコビ行列の評価の手続きも数値微分を用いてチェック可能

More Related Content

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

PRML 5.3-5.3.4 誤差逆伝播