Skip to Content
ゼロから作るDeep Learning ―Pythonで学ぶディープラーニングの理論と実装
book

ゼロから作るDeep Learning ―Pythonで学ぶディープラーニングの理論と実装

by 斎藤 康毅
September 2016
Intermediate to advanced
320 pages
4h 31m
Japanese
O'Reilly Japan, Inc.
Content preview from ゼロから作るDeep Learning ―Pythonで学ぶディープラーニングの理論と実装

5章誤差逆伝播法

前章では、ニューラルネットワークの学習について説明しました。その際、ニューラルネットワークの重みパラメータの勾配——正確には、重みパラメータに関する損失関数の勾配——は、数値微分によって求めました。数値微分はシンプルで、実装は簡単でしたが、計算に時間がかかるという難点があります。本章では、重みパラメータの勾配の計算を効率良く行う手法である「誤差逆伝播法」について学びます。

誤差逆伝播法を正しく理解するには、2つの方法があると、筆者は(個人的に)考えています。ひとつは「数式」によって、もうひとつは「計算グラフ(computational graph)」によって理解するというものです。前者のほうが一般的な方法で、特に、機械学習に関する書籍の多くでは、数式を中心に話を展開していきます。確かに、数式による説明は、厳密で簡潔になるのでもっともな方法なのですが、いきなり数式を中心に考えようとしたら、本質的なことを見逃してしまったり、数式の羅列にとまどったりすることがあります。そこで本章では、計算グラフによって“視覚的”に誤差逆伝播法を理解してもらおうと思います。実際にコードに書くことでさらに理解が深まり「なるほど!」と納得できると思います。

なお、誤差逆伝播法を計算グラフによって説明するアイデアは、Andrej Karpathyのブログ[4]、また、彼とFei-Fei Li教授らによって行われたスタンフォード大学のディープラーニングの授業「CS231n」[5]を参考にしています。

5.1 計算グラフ

計算グラフとは、計算の過程をグラフによって表したものです。ここで言うグラフとは、データ構造としてのグラフであり、複数のノードとエッジによって表現されます(ノード間を結ぶ直線を「エッジ」と言います)。本節では、計算グラフに慣れ親しむため、簡単な問題を解いていきます。簡単な問題から始め、ステップ・バイ・ステップで進みながら、最後には誤差逆伝播法にたどり着く予定です。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

ゼロから作るDeep Learning ❻ ―LLM編

ゼロから作るDeep Learning ❻ ―LLM編

斎藤 康毅

Publisher Resources

ISBN: 9784873117584Other