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
65
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
42
Other Decks in Programming
See All in Programming
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
120
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
310
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
250
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
730
AI Agent と正しく分析するための環境作り
yoshyum
3
630
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.8k
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
2
210
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
2.9k
net-httpのHTTP/2対応について
naruse
0
230
Oxcを導入して開発体験が向上した話
yug1224
4
230
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
6
1.3k
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
230
Featured
See All Featured
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
540
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
200
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
210
Abbi's Birthday
coloredviolet
2
7.8k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
The Spectacular Lies of Maps
axbom
PRO
1
770
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Amusing Abliteration
ianozsvald
1
180
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
820
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
710
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
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