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
Rustで強化学習アルゴリズムを実装する vol3
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
NearMeの技術発表資料です
PRO
May 09, 2025
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rustで強化学習アルゴリズムを実装する vol3
NearMeの技術発表資料です
PRO
May 09, 2025
More Decks by NearMeの技術発表資料です
See All by NearMeの技術発表資料です
PosthogのA/Bテスト機能の紹介
nearme_tech
PRO
0
9
AIフレンドリーなプロダクトに向けて
nearme_tech
PRO
1
32
初めてのLean言語
nearme_tech
PRO
0
64
Apache Airflow Workflow orchestration without turning cron into spaghetti
nearme_tech
PRO
1
19
実務で役立つ幾何学 ボロノイ図の基礎から グラフ・ネットワーク応用まで
nearme_tech
PRO
1
56
SQL/ID抽出タスクから考える 実践的なハルシネーション対策
nearme_tech
PRO
1
65
OpenCode & Local LLM
nearme_tech
PRO
0
180
OpenCode Introduction
nearme_tech
PRO
0
55
【Browser Automation × AI】 Stagehandを試してみよう
nearme_tech
PRO
0
150
Featured
See All Featured
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
480
What's in a price? How to price your products and services
michaelherold
247
13k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
330
Making Projects Easy
brettharned
120
6.7k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
370
Site-Speed That Sticks
csswizardry
13
1.2k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
2
280
Thoughts on Productivity
jonyablonski
76
5.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
450
The World Runs on Bad Software
bkeepers
PRO
72
12k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Transcript
0 2025-05-09 第121回NearMe技術勉強会 Takuma KAKINOUE Rustで強化学習アルゴリズムを実装する vol3
1 今回、実装するアルゴリズム • Proximal Policy Optimization (PPO) ◦ Actor-Critic系に分類される⼿法 ◦
効率的かつ安定した学習が可能で、オンポリシーな強化学習アルゴリズム ではデファクトスタンダード的な存在 ※論⽂(https://arxiv.org/abs/1707.06347) ※git (https://github.com/kakky-hacker/reinforcex) ※参考資料 →https://jp.mathworks.com/content/dam/mathworks/ebook/gated/jp-reinfor cement-learning-ebook-all-chapters.pdf
2 価値ベースと⽅策ベースの違い • 価値ベース ◦ ある状態において、ある⾏動を選択する価値を推定する ▪ 連続⾏動空間に対応できないという弱点がある • ⽅策ベース
← PPOはこっちに属する ◦ ある状態において、選択すべき⾏動の確率分布を推定する ▪ 連続⾏動空間に対応可能
3 ⽅策ベースの弱点 • 状態 → ⾏動の関数を直接モデル化するために選択する⾏動が⼤胆に変わりや すい ◦ → 学習が不安定
• PPOでは⾏動の選択確率が重みの更新前後で⼤きく変わらないようにclipする 仕組みを導⼊して上記の問題を解決している! ◦ 実装 https://github.com/kakky-hacker/reinforcex/blob/master/src/agents/p po.rs#L91
4 実装する上で詰まったところ • softmaxのlogitのスケールが⼤きすぎた ◦ logitのスケールが⼤きいほど決定論的な⾏動選択になり、探索が促進され にくくなる • logitを⼩さくするだけでは、逆に⾏動の確率分布の分散が中々⼩さくなら ず、学習の収束が遅い
◦ ⽬的関数に⾏動の確率分布のエントロピーも⼊れて、同時に最⼩化した ◦ https://github.com/kakky-hacker/reinforcex/blob/master/src/agents/p po.rs#L97
5 今後の展望 • 汎⽤的なよく使われるアルゴリズム(REINFORCE, DQN, PPO, SAC)は 実装できたので、並列化の実装を進める • 並列化は、Rustを使う⼀番のメリットが出てくるポイント
6 Thank you