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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
keitaro2002
April 06, 2024
Programming
56
0
Share
ゼロつく2 輪読会 3.4-3.6
keitaro2002
April 06, 2024
More Decks by keitaro2002
See All by keitaro2002
ゼロつく2 輪読会 3.1-3.3
keitaro2002
0
40
Other Decks in Programming
See All in Programming
CDK Deployのための ”反響定位”
watany
4
740
Coding as Prompting Since 2025
ragingwind
0
830
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
170
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
270
Vibe NLP for Applied NLP
inesmontani
PRO
0
400
Make GenAI Production-Ready with Kubernetes Patterns
bibryam
0
120
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
210
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
160
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
100
RSAが破られる前に知っておきたい 耐量子計算機暗号(PQC)入門 / Intro to PQC: Preparing for the Post-RSA Era
mackey0225
3
130
ファインチューニングせずメインコンペを解く方法
pokutuna
0
310
アーキテクチャモダナイゼーションとは何か
nwiizo
17
5k
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
270
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Fireside Chat
paigeccino
42
3.9k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
270
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
210
Designing for humans not robots
tammielis
254
26k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
490
Faster Mobile Websites
deanohume
310
31k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
A designer walks into a library…
pauljervisheath
211
24k
How to train your dragon (web standard)
notwaldorf
97
6.6k
For a Future-Friendly Web
brad_frost
183
10k
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