🧠 02. 倒立振子制御へのDDPG応用(CartPole + DDPG)

ℹ️ 数式が正しく表示されない場合は、GitHub版はこちら を参照してください。


本節では、強化学習アルゴリズムの一つ DDPG(Deep Deterministic Policy Gradient) を用いて、
代表的な制御対象 倒立振子(CartPole) の安定化制御器を学習します。

This section applies the DDPG algorithm to the classic CartPole control task,
training a controller to stabilize the pole in a continuous action setting.


🎯 CartPole 環境の概要 / Overview of the CartPole Environment

\[s = [x, \dot{x}, \theta, \dot{\theta}]\]

(位置・速度・角度・角速度 / position, velocity, angle, angular velocity)

使用環境 / Environment: Pendulum-v1 または連続版 CartPoleContinuous-v0


🧪 使用アルゴリズム:DDPG / Algorithm: DDPG

DDPG(Deep Deterministic Policy Gradient)は、
Actor-Critic構造に基づく連続制御向けアルゴリズムです。


⚙️ 学習の流れ / Training Loop

  1. 環境初期化 / Initialize environment → $s_0$ を取得
  2. Actorネットで行動選択 / Action selection: $a_t = \mu(s_t) + \text{noise}$
  3. 環境ステップ / Environment step: $(r_t, s_{t+1})$ を取得
  4. 経験保存 / Store experience: $(s_t, a_t, r_t, s_{t+1})$
  5. バッチ学習 / Batch update:Actor & Critic を更新
  6. ターゲットネット更新 / Soft update target networks
  7. 上記を繰り返し、最適ポリシーを獲得

📊 学習過程の観察 / Monitoring Training

学習ログ可視化で制御性能の改善を確認できます。

📁 関連ファイル / Related files:


🧠 技術メモ / Technical Notes


🔚 まとめと展望 / Summary & Outlook


⬅️ 前節 / Previous: 01. RLの基本構造
Covers RL fundamentals, terminology, and the MDP framework.

➡️➡️ 次節 / Next: 03. RL vs 古典制御
Compares RL with classical control approaches and discusses hybrid strategies.

🏠 Part 07 トップ / Back to Part 07 Top