Langsung ke konten
Skillpedia
Machine learning29k Β· #9609

spinning-up-deep-rl

Fungsinya

Skill ini menjelaskan deep reinforcement learning dengan memakai materi Spinning Up dari OpenAI. Skill ini untuk mahasiswa dan engineer yang sedang belajar atau menerapkan reinforcement learning.

Kapan dipakai

  • βœ“Saat Anda sedang belajar bagaimana deep reinforcement learning bekerja.
  • βœ“Saat Anda ingin membandingkan algoritma seperti PPO, SAC, atau TD3.
  • βœ“Saat kode reinforcement learning Anda gagal tanpa error yang jelas.

Link skill

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/spinning-up-deep-rl/skills/spinning-up-deep-rl/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/spinning-up-deep-rl/skills/spinning-up-deep-rl/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œJelaskan bagaimana PPO bekerja dan mengapa lebih stabil daripada policy gradient dasar.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill menjawab berdasarkan kerangka inti dalam panduan, dan mencari bab yang relevan untuk topik yang lebih rinci sebelum menjawab, sehingga jawabannya berpijak pada sumber.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Spinning Up in Deep RL

Author: Joshua Achiam (OpenAI) | Source: spinningup.readthedocs.io, MIT | Chapters: 20 | Generated: 2026-08-25

How to Use This Skill

  • No argument β€” load the core frameworks below
  • A topic β€” ask about advantage function, target networks, entropy regularization; I resolve it through the Topic Index and read that chapter file
  • chNN β€” I load that chapter's summary
  • "what chapters do you have?" β€” the full index
/cs-spinning-up-deep-rl                      # core frameworks + chapter index
/cs-spinning-up-deep-rl entropy regularization   # topic index -> ch19, read that chapter
/cs-spinning-up-deep-rl ch09                 # one chapter summary

When you ask about something not in Core Frameworks, I read the relevant chapter file before answering rather than guessing from the index.


Core Frameworks & Mental Models

The RL problem

pi* = argmax_pi J(pi), where J(pi) = E_{tau~pi}[R(tau)]. Every algorithm approximates this; where it substitutes a different objective (a Bellman residual, a surrogate), that substitution is the source of its failure modes. Four value functions β€” V^pi, Q^pi, V*, Q* β€” all obey Bellman self-consistency, and a*(s) = argmax_a Q*(s,a) is why Q-learning is a viable family at all. Advantage A^pi(s,a) = Q^pi(s,a) - V^pi(s) is the relative-quality signal policy gradients run on. (ch07)

The two branching questions

Place any algorithm by asking: does it have or learn a model, and what does it learn (policy, Q-function, value function, model). That generates the whole landscape. (ch08)

Policy optimization vs Q-learning β€” the central trade-off

  • Policy optimization is principled: you directly optimize the thing you want. Stable and reliable. On-policy, so it cannot reuse data, so it is sample-hungry.
  • Q-learning only indirectly optimizes performance, by training Q_theta to satisfy a self-consistency equation. Many failure modes, so less stable. But substantially more sample efficient when it works, because it reuses everything.
  • Satisfying the Bellman equations well carries no guarantee of good policy performance.
  • The two are not exclusive β€” DDPG and SAC live between them deliberately. (ch08)

The policy gradient template

grad J = E[ sum_t grad log pi_theta(a_t|s_t) * Phi_t ]. Five valid choices of Phi_t: full return, reward-to-go, reward-to-go minus a baseline, Q^pi, and A^pi. All share an expectation and differ in variance. Two rules get you from the first to the last:

  • Don't let the past distract you β€” drop rewards obtained before the action. Those terms had zero mean and nonzero variance: pure noise.
  • Baselines β€” by the EGLP lemma, any state-only b(s) can be added or subtracted freely. The standard choice is V^pi(s_t), learned by MSE regression onto reward-to-go. (ch09)

The policy-gradient loss is not a loss function

Its data distribution depends on the parameters, and it does not measure performance even in expectation. Only at the current parameters, with data from those parameters, does it have the negative gradient of performance. You can send it to negative infinity while performance craters, and it usually will. Only average return means anything. (ch09)

Broken RL code almost always fails silently

It runs fine; the agent just never learns. Usually something is computed with the wrong equation, on the wrong distribution, or piped to the wrong place. If it doesn't work, assume there's a bug before touching hyperparameters. Debug by measuring everything and reading the code critically. The archetype is one missing squeeze: a [N] vs [N,1] shape mismatch is broadcast-compatible, raises nothing, and silently turns the Bellman backup into an [N,N] matrix. (ch10, ch12)

Learn by doing

Write your own implementations, shortest correct version of each, simplest algorithms first. VPG, DQN, A2C, PPO, DDPG, roughly in that order; ~250-300 lines each. Single-threaded before parallel. Iterate fast in simple environments β€” under 5 minutes turnaround at the debug stage. Do not attempt Atari or Humanoid before the toy task works. Read papers for their ablations and supplementary material, but do not overfit to paper details (the original DDPG's architecture, init scheme and batch norm are not strictly necessary) or to existing implementations (their abstractions serve reuse, not your

Pertanyaan umum

Algoritma apa saja yang dicakup?

Mencakup topik seperti VPG, TRPO, PPO, DDPG, TD3, dan SAC.

Bisakah bertanya tentang topik tertentu?

Bisa. Anda dapat menyebut topik seperti entropy regularization dan skill akan mencari bab yang sesuai.

Apakah membantu men-debug kode training?

Ya, skill mencakup men-debug kode reinforcement learning yang gagal tanpa pesan jelas.

Detail

Deskripsi asli dari pembuat

Use when learning or applying deep RL from OpenAI's Spinning Up: MDPs, policy gradients, VPG, TRPO, PPO, DDPG, TD3, SAC, debugging RL code that fails silently, or multi-seed experiments. Indexes the 20 chapters for on-demand reading.

repo: alirezarezvani/claude-skills

Popularitas

Bintang GitHub
29k
Peringkat
#9609
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa