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
8
ゼロつく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
9
Other Decks in Programming
See All in Programming
Apache Hive 4 on Treasure Data
ryukobayashi
1
410
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
140
Fast JSX: Don't clone props object #28768
yossydev
1
160
Git Lint
bkuhlmann
4
760
"config" ってなんだ? / What is "config"?
okashoi
0
250
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
2
120
雑に思考を整理する技術と効能
konifar
62
30k
新宿ダンジョンを可視化してみた
satoshi7190
3
350
Milestoner
bkuhlmann
1
410
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
200
Goのエラースタックトレースの歴史と今後
sonatard
10
1.7k
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
890
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
44
6.8k
Designing the Hi-DPI Web
ddemaree
276
33k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
38
2.5k
The MySQL Ecosystem @ GitHub 2015
samlambert
244
12k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
11
1k
Gamification - CAS2011
davidbonilla
77
4.6k
Debugging Ruby Performance
tmm1
70
11k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
22
1.6k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
21
1.9k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
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