9. Deep Q-Learning
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves,
Ioannis Antonoglou, Daan Wierstra, Martin Riedmiller (DeepMind Technologies)
Playing Atari with Deep Reinforcement Learning
http://www.cs.toronto.edu/~vmnih/docs/dqn.pdf
画面を入力
操作はあらかじめ教える
スコアによる強化学習
12. 学習過程解析
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves,
Ioannis Antonoglou, Daan Wierstra, Martin Riedmiller (DeepMind Technologies)
Playing Atari with Deep Reinforcement Learning
http://www.cs.toronto.edu/~vmnih/docs/dqn.pdf
13. • Pπ ロールアウトポリシー(ロールアウトで討つ手を決める。
Pπ(a|s) sという状態でaを討つ確率)
• Pσ Supervised Learning Network プロの討つ手からその
手を討つ確率を決める。Pσ(a|s)sという状態でaを討つ確
率。
• Pρ 強化学習ネットワーク。Pρ(学習済み)に初期化。
• Vθ(s’) 局面の状態 S’ を見たときに、勝敗の確率を予測
する関数。つまり、勝つか、負けるかを返します。
Mastering the game of Go with deep neural networks and tree search
http://www.nature.com/nature/journal/v529/n7587/full/nature16961.html
https://deepmind.com/research/alphago/
14. Mastering the game of Go with deep neural networks and tree search
http://www.nature.com/nature/journal/v529/n7587/full/nature16961.html
https://deepmind.com/research/alphago/
21. Procedural Generation in WarFrame
• Warframe ではダンジョンが自動生成される。
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
22. Black Combination in WarFrame
• ブロックを組み合わる
• 完全に零からの生成
ではない。
このような生成のことを
Semi-procedural と言う。
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
25. スタートポイント、出口、目的地の
自動生成
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
26. ヒートマップ(影響マップ)を用いて
ゲーム中にプレイヤーの周囲を自動解析
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
ヒートマップ(影響マップ)とは、対象(ここではプレイヤー)を中心に、位置に温度(影響度)を
与える方法です。距離に応じて減衰します。また時間が経つと、周囲に熱が拡散します。
28. アクティブ・エリアセット(Active Are Set)
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
アクティブ・エリアセットは、プレイヤーの周囲の領域で、
リアルタイムにメタAIがゲームを調整する領域
30. メタAI (AI Director,)による
動的ペース調整
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
31. メタAI(自動適応ペーシング)
メタAI (AI Director,)による
動的ペース調整
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
32. メタAIによる出会うモンスターの数の
大域調整
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
プレイヤーのスタート地点から出口までの道のりで、
コンスタントにモンスターと出会うようにする。
105. Neural Networks in Supreme Commander 2 (GDC 2012)
Michael Robbins (Gas Powered Games)
http://www.gdcvault.com/play/1015406/Off-the-Beaten-Path-Non
http://www.gdcvault.com/play/1015667/Off-the-Beaten-Path-Non
ニューラルネットワークの応用
106. Neural Networks in Supreme Commander 2 (GDC 2012)
Michael Robbins (Gas Powered Games)
http://www.gdcvault.com/play/1015406/Off-the-Beaten-Path-Non
http://www.gdcvault.com/play/1015667/Off-the-Beaten-Path-Non
ニューラルネットワークの応用
107. Neural Networks in Supreme Commander 2 (GDC 2012)
Michael Robbins (Gas Powered Games)
http://www.gdcvault.com/play/1015406/Off-the-Beaten-Path-Non
http://www.gdcvault.com/play/1015667/Off-the-Beaten-Path-Non
ニューラルネットワークの応用
108. Neural Networks in Supreme Commander 2 (GDC 2012)
Michael Robbins (Gas Powered Games)
http://www.gdcvault.com/play/1015406/Off-the-Beaten-Path-Non
http://www.gdcvault.com/play/1015667/Off-the-Beaten-Path-Non
ニューラルネットワークの応用
109. 出力
入力
(DPS=Damage per second)
Neural Networks in Supreme Commander 2 (GDC 2012)
Michael Robbins (Gas Powered Games)
http://www.gdcvault.com/play/1015406/Off-the-Beaten-Path-Non
http://www.gdcvault.com/play/1015667/Off-the-Beaten-Path-Non
ニューラルネットワークの応用
110. Neural Networks in Supreme Commander 2 (GDC 2012)
Michael Robbins (Gas Powered Games)
http://www.gdcvault.com/play/1015406/Off-the-Beaten-Path-Non
http://www.gdcvault.com/play/1015667/Off-the-Beaten-Path-Non
ニューラルネットワークの応用
111. Neural Networks in Supreme Commander 2 (GDC 2012)
Michael Robbins (Gas Powered Games)
http://www.gdcvault.com/play/1015406/Off-the-Beaten-Path-Non
http://www.gdcvault.com/play/1015667/Off-the-Beaten-Path-Non
ニューラルネットワークの応用
112. Neural Networks in Supreme Commander 2 (GDC 2012)
Michael Robbins (Gas Powered Games)
http://www.gdcvault.com/play/1015406/Off-the-Beaten-Path-Non
http://www.gdcvault.com/play/1015667/Off-the-Beaten-Path-Non
ニューラルネットワークの応用
113. ニューラルネットワークの応用
Black & White (Lionhead,2000)
クリーチャーを育てていくゲーム。
クリーチャーは自律的に行動するが、
訓練によって学習させることができる。
http://www.youtube.com/watch?v=2t9ULyYGN-s
http://www.lionhead.com/games/black-white/
114. Belief – Desire – Intention モデル
Desire
(Perceptrons)
Opinions
(Decision Trees)
Beliefs
(Attribute List)
Intention
Overall Plan
(Goal, Main Object)
Attack enemy town
Specific Plan
(Goal, Object List)
Throw stone at house
Primitive Action List
Walk towards stone,
Pick it up,
Walk towards house,
Aim at house,
Throw stone at house
Richard Evans, “Varieties of Learning”, 11.2, AI Programming Wisdom
115. Belief – Desire – Intention モデル
Desire
(Perceptrons)
Opinions
(Decision Trees)
Beliefs
(Attribute List)
Richard Evans, “Varieties of Learning”, 11.2, AI Programming Wisdom
Low Energy
Source =0.2
Weight =0.8
Value =
Source*Weight =
0.16
Tasty Food
Source =0.4
Weight =0.2
Value =
Source*Weight =
0.08
Unhappiness
Source =0.7
Weight =0.2
Value =
Source*Weight =
0.14
∑
0.16+0.08+0.14
Threshold
(0~1の値に
変換)
hunger
Desire(お腹すいた度)欲求を決定する
対象を決定する
それぞれの対象の
固有の情報
他にも
いろいろな
欲求を計算
Hunger
Compassion
Attack(戦いたい)
Help
ニューラルネットワークの応用
Black & White (Lionhead,2000)
116. Belief – Desire – Intention モデル
Desire
(Perceptrons)
Opinions
(Decision Trees)
Beliefs
(Attribute List)
戦いたい?
+0.9 -0.2
味方敵
+0.4 +0.1 -0.3
小さい 大きい中
ニューラルネットワークの応用
Black & White (Lionhead,2000)
Richard Evans, “Varieties of Learning”, 11.2, AI Programming Wisdom
117. Belief – Desire – Intention モデル
Desire
(Perceptrons)
Opinions
(Decision Trees)
Beliefs
(Attribute List)
Intention
Overall Plan
(Goal, Main Object)
Attack enemy town
Specific Plan
(Goal, Object List)
Throw stone at house
Primitive Action List
Walk towards stone,
Pick it up,
Walk towards house,
Aim at house,
Throw stone at house
何に対して何を行うか決定
特定の行動を決定
詳細な行動
「何に対して何をするか」悩んでいる。
ニューラルネットワークの応用
Black & White (Lionhead,2000)
Richard Evans, “Varieties of Learning”, 11.2, AI Programming Wisdom
119. 機械学習
(例)FORZA MOTORSPORT におけるドライビング学習
Ralf Herbrich, Thore Graepel, Joaquin Quiñonero Candela Applied Games Group,Microsoft Research Cambridge
"Forza, Halo, Xbox Live The Magic of Research in Microsoft Products"
http://research.microsoft.com/en-us/projects/drivatar/ukstudentday.pptx
120. 機械学習
(例)FORZA MOTORSPORT におけるドライビング学習
Ralf Herbrich, Thore Graepel, Joaquin Quiñonero Candela Applied Games Group,Microsoft Research Cambridge
"Forza, Halo, Xbox Live The Magic of Research in Microsoft Products"
http://research.microsoft.com/en-us/projects/drivatar/ukstudentday.pptx
121. 機械学習
(例)FORZA MOTORSPORT におけるドライビング学習
• 揺らぎ
• ライン – コーナーやそのコンビネーションに対し
て、どれぐらいスムーズに車をガイドするか。
• コーナーへの突入スピードとブレーキを踏むタイ
ミングと。保守的か過激か。
• コーナーの頂点にどれぐらい近づくか、どれぐら
いの速度でそこを抜けるか?
• コーナーを抜ける時のスピードとコーナーを回る
時のスピード。
Drivatar がプレイヤーのコントロールから学習するもの
Microsoft Research
Drivatar™ in Forza Motorsport
http://research.microsoft.com/en-us/projects/drivatar/forza.aspx
122. 機械学習
(例)FORZA MOTORSPORT におけるドライビング学習
Ralf Herbrich, Thore Graepel, Joaquin Quiñonero Candela Applied Games Group,Microsoft Research Cambridge
"Forza, Halo, Xbox Live The Magic of Research in Microsoft Products"
http://research.microsoft.com/en-us/projects/drivatar/ukstudentday.pptx
プレイヤーの特性を解析する
特徴となる数値をドライブモデルに渡す
123. 機械学習
(例)FORZA MOTORSPORT におけるドライビング学習
Ralf Herbrich, Thore Graepel, Joaquin Quiñonero Candela Applied Games Group,Microsoft Research Cambridge
"Forza, Halo, Xbox Live The Magic of Research in Microsoft Products"
http://research.microsoft.com/en-us/projects/drivatar/ukstudentday.pptx
レーシングラインを事前に構築する。生成というよりテーブルから組み合わせる。
124. 機械学習
(例)FORZA MOTORSPORT におけるドライビング学習
Ralf Herbrich, Thore Graepel, Joaquin Quiñonero Candela Applied Games Group,Microsoft Research Cambridge
"Forza, Halo, Xbox Live The Magic of Research in Microsoft Products"
http://research.microsoft.com/en-us/projects/drivatar/ukstudentday.pptx
レーシングラインを事前に構築する。生成というよりテーブルから組み合わせる。
125. 機械学習
(例)FORZA MOTORSPORT におけるドライビング学習
Ralf Herbrich, Thore Graepel, Joaquin Quiñonero Candela Applied Games Group,Microsoft Research Cambridge
"Forza, Halo, Xbox Live The Magic of Research in Microsoft Products"
http://research.microsoft.com/en-us/projects/drivatar/ukstudentday.pptx
レーシングラインに沿わせるのではなく、理想とする位置とスピードから
コントローラーの制御を計算して、物理制御によって車を運転する。
126. Forza motorsports (EA)
Jeffrey Schlimmer, "Drivatar and Machine Learning Racing Skills in the Forza Series"
http://archives.nucl.ai/recording/drivatar-and-machine-learning-racing-skills-in-the-forza-series/
127. 機械学習
(例) Halo®3におけるオンライン・マッチング・システム
Ralf Herbrich, Thore Graepel, Joaquin Quiñonero Candela Applied Games Group,Microsoft Research Cambridge
"Forza, Halo, Xbox Live The Magic of Research in Microsoft Products"
http://research.microsoft.com/en-us/projects/drivatar/ukstudentday.pptx
128. 機械学習
(例) Halo®3におけるオンライン・マッチング・システム
• TrusSkill =プレイヤーの強さを正規分布の中
央値と標準偏差として扱う。
Ralf Herbrich, Thore Graepel, Joaquin Quiñonero Candela Applied Games Group,Microsoft Research Cambridge
"Forza, Halo, Xbox Live The Magic of Research in Microsoft Products"
http://research.microsoft.com/en-us/projects/drivatar/ukstudentday.pptx
μ : 中央値
σ: 標準偏差
その人の強さを表す
その人の強さの正確さを示す。
100回やってこのランクの人と
1000回やってこのランクの人では
1000回の人の方が正確
=標準偏差が小さい
129. 機械学習
(例) Halo®3におけるオンライン・マッチング・システム
• スキル 𝜇 𝐴, 𝜎𝐴 のプレイヤーと、スキル
𝜇 𝐵, 𝜎 𝐵 のプレイヤーが
マッチングする確率は、
Ralf Herbrich, Thore Graepel, Joaquin Quiñonero Candela Applied Games Group,Microsoft Research Cambridge
"Forza, Halo, Xbox Live The Magic of Research in Microsoft Products"
http://research.microsoft.com/en-us/projects/drivatar/ukstudentday.pptx
μ : 中央値
σ: 標準偏差
𝑒
−
(𝜇 𝐴−𝜇 𝐵)2
2𝐶2
𝑑 (𝑑 =
2𝛽2
𝑐
)
130. 機械学習
(例) Halo®3におけるオンライン・マッチング・システム
2人が対戦して勝ったとき、負けた時の中央値、標準偏差の変化
知能と情報 : 日本知能情報ファジィ学会誌: journal of Japan Society for Fuzzy Theory and Intelligent Informatics 22(6), 745-756, 2010-12-15
日本知能情報ファジィ学会 「オンラインゲームにおける人工知能・. プロシージャル技術の応用」
http://igda.sakura.ne.jp/sblo_files/ai-igdajp/image/JSFTII_22-6_online20game_Miyake.pdf
139. 強化学習
(例)格闘ゲームTaoFeng におけるキャラクター学習
Ralf Herbrich, Thore Graepel, Joaquin Quiñonero Candela Applied Games Group,Microsoft Research Cambridge
"Forza, Halo, Xbox Live The Magic of Research in Microsoft Products"
http://research.microsoft.com/en-us/projects/drivatar/ukstudentday.pptx
190. 全体の流れ
A D A D A D…
①初期の個体集合を生成
②シミュレーション
④交叉による次世代生成
⑤遺伝子操作(突然変異)
個体集合
②評価
③適応度による選択
A アクションタイプ
0 … 右回転
1 … 左回転
2 … 原則
3 … 何もしない
D 時間間隔
どれだけうまく着陸できたか?
245. 2D-シューティングゲームへの応用「バイナリーエイリア
ン」Mat Buckland, Chapter 10, AI techniques for game programming, Premier Press, 2002
(実行ファイルとソースコードがCD-ROMにあります)
…
15 neuron
弾丸1の
ベクトル
x
y
x
y
右へ移動
左へ移動
弾丸2の
ベクトル
x
y
弾丸3の
ベクトル
上へ移動
0.9 を超える値の中で、
最大のものが選択される。
もし、全て0.9を超えなければ、
「ドリフト」の動きをする。
このゲームでは、スクリーンに
3弾までしか表示されない。
x
y
プレイヤーの
銃の向き
247. 2D-シューティングゲームへの応用「バイナリーエイリア
ン」Mat Buckland, Chapter 10, AI techniques for game programming, Premier Press, 2002
(実行ファイルとソースコードがCD-ROMにあります)
…
15 neuron
弾丸1の
ベクトル
x
y
x
y
右へ移動
左へ移動
弾丸2の
ベクトル
x
y
弾丸3の
ベクトル
上へ移動
x
y
プレイヤーの
銃の向き
重み
重み
…
重みの実数を要素として遺伝子コードを定義する。
249. ④衝突回避と探索を行う戦車
Mat Buckland, Chapter 8, AI techniques for game programming, Premier Press, 2002
(実行ファイルとソースコードがCD-ROMにあります)
衝突回避のために仮想的な触覚を持つ。
触覚が衝突した場合に、衝突位置を検出する。
0.4
0.7 0.0
0.0
0.0
ニューラルネットで衝突を回避
250. 衝突回避を行う戦車
Mat Buckland, Chapter 8, AI techniques for game programming, Premier Press, 2002
(実行ファイルとソースコードがCD-ROMにあります)
6 neuron
触覚1
重み
重み
…
触覚2
触覚3
触覚4
触覚5
左の回転数
右の回転数
253. 衝突回避と探索を行う戦車
Mat Buckland, Chapter 8, AI techniques for game programming, Premier Press, 2002
(実行ファイルとソースコードがCD-ROMにあります)
NPCを、なるべく未踏野の領域に行く
ように移動させたい。
探索 各マスに、NPCがいた通算の
時間を規格化(未踏野-1、
通算時間は0~1で規格化)
して記憶する。
触覚は、自分のいるマスの
通算時間を読み取る。
254. 衝突回避と探索を行う戦車
Mat Buckland, Chapter 8, AI techniques for game programming, Premier Press, 2002
(実行ファイルとソースコードがCD-ROMにあります)
6 neuron
触覚1:衝突
左の回転数
右の回転数
触覚1:滞在時間
触覚2:衝突
触覚2:滞在時間
触覚5:衝突
触覚5:滞在時間
衝突情報
…
重み
…
重みの実数を要素として遺伝子コードを定義する。
重み
257. ⑤ニューラルネットワークの構造が進化させる
「NEAT」の技術
Mat Buckland, Chapter 11, AI techniques for game programming, Premier Press, 2002
(実行ファイルとソースコードがCD-ROMにあります)
これまでニューラルネットは、最初に構造を定義した後は変化しなかった。
動的にニューラルネットの構造を変化させる技術
Neuron Evoluation of Augmenting Topologies (NEAT)
258. NEAT
回路の構成を遺伝子コードで表現する。
Weight: 1.2
From: 1
To: 3
Enabled: Y
Recurrent: N
Innovation: 1
Weight: -3
From: 1
To: 4
Enabled: Y
Recurrent: N
Innovation: 6
Weight: 0.7
From: 2
To: 4
Enabled: Y
Recurrent: N
Innovation: 2
Weight: -2.1
From: 3
To: 4
Enabled: Y
Recurrent: N
Innovation: 6
Weight: 1.1
From: 3
To: 5
Enabled: N
Recurrent: N
Innovation: 3
Weight: 0.8
From: 4
To: 5
Enabled: Y
Recurrent: N
Innovation: 4
Weight: -1
From: 5
To: 3
Enabled: Y
Recurrent: Y
Innovation: 7
ID: 1
Type: Input
ID: 2
Type: Input
ID: 3
Type: hidden
ID: 4
Type: hidden
ID: 5
Type: Output
2
1
4
3
5
つなぎ方を定義する遺伝子
ニューロンを定義する遺伝子
入力 出力
259. NEAT
回路の構成を遺伝子コードで表現する。
Weight: 1.2
From: 1
To: 3
Enabled: Y
Recurrent: N
Innovation: 1
Weight: -3
From: 1
To: 4
Enabled: Y
Recurrent: N
Innovation: 6
Weight: 0.7
From: 2
To: 4
Enabled: Y
Recurrent: N
Innovation: 2
Weight: -2.1
From: 3
To: 4
Enabled: Y
Recurrent: N
Innovation: 6
Weight: 1.1
From: 3
To: 5
Enabled: N
Recurrent: N
Innovation: 3
Weight: 0.8
From: 4
To: 5
Enabled: Y
Recurrent: N
Innovation: 4
Weight: -1
From: 5
To: 3
Enabled: Y
Recurrent: Y
Innovation: 7
ID: 1
Type: Input
ID: 2
Type: Input
ID: 3
Type: hidden
ID: 4
Type: hidden
ID: 5
Type: Output
2
1
4
3
5
リンク(つなぎ方)を定義する遺伝子
ニューロンを定義する遺伝子
Innovation ID によってリンク、ニュー
ロンを全遺伝子共通の管理する。
無効
入力 出力
264. ⑥リアルタイム「NEAT」を使ったシミュレーションゲーム
「 NERO 」
Neural Networks Research Group, Department of Computer Sciences, University of Texas at
Austin, Neuro-Evolving Robotic Operatives, http://www.nerogame.org/,
(ゲームがあります)
①rtNEAT(リアルタイムNEAT)システムの上で、ユーザーが兵士を訓練する。
②訓練させた兵士同士を対戦させる。
https://www.youtube.com/watch?v=YA_eHaMEa58
274. A Brief History of Matchmaking in Heroes of the Storm
Alex Zook, Blizzard Entertainment
https://archives.nucl.ai/recording/a-brief-history-of-matchmaking-in-heroes-of-the-storm/