Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ゼロつく2 輪読会 3.4-3.6
Search
keitaro2002
April 06, 2024
Programming
0
31
ゼロつく2 輪読会 3.4-3.6
keitaro2002
April 06, 2024
Tweet
Share
More Decks by keitaro2002
See All by keitaro2002
ゼロつく2 輪読会 3.1-3.3
keitaro2002
0
17
Other Decks in Programming
See All in Programming
CDKを使ったPagerDuty連携インフラのテンプレート化
shibuya_shogo
0
110
Jakarta EE meets AI
ivargrimstad
0
350
『テスト書いた方が開発が早いじゃん』を解き明かす #phpcon_nagoya
o0h
PRO
8
2.4k
CSS Linter による Baseline サポートの仕組み
ryo_manba
1
150
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
170
Introduction to kotlinx.rpc
arawn
0
760
color-scheme: light dark; を完全に理解する
uhyo
7
490
Ruby on cygwin 2025-02
fd0
0
180
Unity Android XR入門
sakutama_11
0
180
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
240
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
54
19k
Ça bouge du côté des animations CSS !
goetter
2
150
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
13k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
The World Runs on Bad Software
bkeepers
PRO
67
11k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
Transcript
ゼロつく2 輪読会 Part4 3.4~3.6 2024年 3⽉10⽇
‣ これ以降の図は以下より引⽤ 斎藤 康毅 「ゼロから作るDeep Learning ❷―⾃然⾔語処理編」 はじめに
‣ 前回の復習 ‣ CBOWモデルの実装 ‣ word2vecに関する補⾜ ⽬次
前回の復習
‣ カウントベース→推論ベース ‣ ミニバッチ学習 ‣ 周囲のコンテキストから出現確率を推測 ‣ one-hotベクトル処理 ‣ CBOW(Continuous
Bag-Of-Word) ‣ ⼊⼒層 = (B,N,L) (B: バッチサイズ,N: コンテキスト 数,L: コーパスの⻑さ) 前回の復習
CBOWの実装
学習 モデルアーキテクチャ 逆伝播の様⼦ optimizer : Adam
学習 loss推移 分散表現 コサイン類似度
word2vecの補⾜
‣ CBOWモデルを数式で考えてみる. ‣ 損失関数 ‣ 教師ラベル𝑡! は𝑤" に対応する箇所が1でその他は0 →𝑃(𝑤" |𝑤"#$
, 𝑤"%$ )のみが残る. ‣ コーパス全体 CBOWモデルと確率
‣ ターゲットからコンテキストを推測する. ‣ 損失関数 skip-gramモデル
‣ 推論ベース ‣ 語彙に新しい単語→学習済み重みを初期値として,パラ メータの再学習が可能 ‣ より複雑な単語間のパターンも捉えられる. ‣ 実際は単語の類似性に関する定量評価では優劣が つけられない
カウントベースvs推論ベース
Appendix
ソースコード 概要 ch3 simple_cbow.py train.py common layers.py optimizer.py trainer.py util.py
functions.py
‣ softmax ‣ cross_entropy_error functions.py
‣ MatMul ‣ init ‣params, grads ‣x (backwardで使⽤) ‣ forward
‣paramsとxを⾏列計算 ‣xを保持 ‣ backward ‣dx,dWを計算 ‣ SoftmaxWithLoss ‣ init ‣params, grads ‣y (softmaxの出⼒) ‣t (教師ラベル) ‣ forward ‣softmax ‣cross_entropy_error ‣ backward ‣dx layers.py
‣ Adam ‣ init ‣lr (学習率) optimizer.py
‣ init ‣ fit ‣ plot trainer.py
util.py