spinning-up-deep-rl
Skill này làm gì
Skill này giải thích học tăng cường sâu dựa trên tài liệu Spinning Up của OpenAI. Skill dành cho sinh viên và kỹ sư đang học hoặc áp dụng học tăng cường.
Khi nào nên dùng
- ✓Khi bạn đang tìm hiểu học tăng cường sâu hoạt động thế nào.
- ✓Khi bạn muốn so sánh các thuật toán như PPO, SAC hoặc TD3.
- ✓Khi code học tăng cường của bạn lỗi mà không có thông báo rõ ràng.
Liên kết skill
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/spinning-up-deep-rl/skills/spinning-up-deep-rl/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Giải thích PPO hoạt động ra sao và vì sao nó ổn định hơn policy gradient cơ bản.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill trả lời dựa trên các khung kiến thức cốt lõi trong tài liệu, và tra cứu chương liên quan cho các chủ đề chi tiết trước khi trả lời, để câu trả lời bám sát nguồn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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_thetato 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 isV^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
Câu hỏi thường gặp
Nó bao gồm những thuật toán nào?
Các chủ đề như VPG, TRPO, PPO, DDPG, TD3 và SAC.
Tôi có thể hỏi về một chủ đề cụ thể không?
Có, bạn có thể nêu một chủ đề như entropy regularization và skill sẽ tìm chương phù hợp.
Nó có giúp gỡ lỗi code huấn luyện không?
Có, nó bao gồm cách gỡ lỗi code học tăng cường bị lỗi âm thầm.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9609
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-launcher-orchestrator
29kGiúp agent của bạn lên kế hoạch, xây dựng, kiểm thử và lên lịch một Claude managed agent trong tài khoản riêng, từng bước một, bắt đầu từ một mục tiêu rõ ràng.
grade-iterate
29kCho phép agent của bạn chấm kết quả một managed AI agent theo bảng tiêu chí và cải thiện qua số vòng cố định, nên không bao giờ lặp vô tận.
interview
29kCho phép agent của bạn phỏng vấn bạn về ý tưởng agent AI và biến câu trả lời thành một kế hoạch xây dựng đơn giản trước khi khởi chạy bất cứ điều gì.
run-without-you
29kGiúp agent của bạn thiết lập một managed AI agent chạy theo lịch hoặc khi có sự kiện xảy ra, với thời gian cron được kiểm tra trước khi khởi chạy.
Skill tương tự
pytorch-patterns
280kGiúp agent của bạn dùng PyTorch cho các mô hình học máy. Áp dụng thực hành tốt nhất để huấn luyện mô hình hiệu quả và đảm bảo kết quả có thể lặp lại.
evm-token-decimals
280kGiúp agent tránh lỗi về số thập phân khi làm việc với các mạng blockchain khác nhau. Đảm bảo giá trị token chính xác trong giao dịch và phép tính.
ito-inference
280kGiúp agent kiểm tra xem các mô hình AI đã sẵn sàng để dùng chưa. Kết nối yêu cầu tài nguyên tính toán với dịch vụ mô hình đã sẵn sàng.