Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ゼロつく2 輪読会 3.4-3.6
Search
keitaro2002
April 06, 2024
Programming
74
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ゼロつく2 輪読会 3.4-3.6
keitaro2002
April 06, 2024
More Decks by keitaro2002
See All by keitaro2002
ゼロつく2 輪読会 3.1-3.3
keitaro2002
0
50
Other Decks in Programming
See All in Programming
不幸な GC
chencmd
0
900
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
140
フロントエンドUIフレームワークのこれまでとこれから
ssssota
4
2k
Security issues being discussed on Web Platforms
petamoriken
0
490
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
770
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
130
ALB ログから Trace を気合で繋げる技術
fohte
7
880
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
490
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
6
3.4k
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
160
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
140
Featured
See All Featured
Marketing to machines
jonoalderson
1
5.8k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
470
Bash Introduction
62gerente
615
220k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
WCS-LA-2024
lcolladotor
0
820
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
490
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Scaling GitHub
holman
464
140k
How to Talk to Developers About Accessibility
jct
2
540
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
320
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