spinning-up-deep-rl
Qué hace
Esta skill explica el aprendizaje por refuerzo profundo con el material Spinning Up de OpenAI. Es para estudiantes e ingenieros que aprenden o aplican el aprendizaje por refuerzo.
Cuándo usarla
- ✓Cuando estás aprendiendo cómo funciona el aprendizaje por refuerzo profundo.
- ✓Cuando quieres comparar algoritmos como PPO, SAC o TD3.
- ✓Cuando tu código de aprendizaje por refuerzo falla sin un error evidente.
Link de la skill
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/spinning-up-deep-rl/skills/spinning-up-deep-rl/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Explícame cómo funciona PPO y por qué es más estable que los gradientes de política básicos.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
Responde a partir de los marcos fundamentales de la guía y busca el capítulo correspondiente para los temas más detallados, de modo que las respuestas se basan en la fuente.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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_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
Preguntas frecuentes
¿Qué algoritmos cubre?
Cubre temas como VPG, TRPO, PPO, DDPG, TD3 y SAC.
¿Puedo preguntar por un tema concreto?
Sí. Puedes nombrar un tema como la regularización por entropía y la skill encuentra el capítulo correspondiente.
¿Ayuda a depurar código de entrenamiento?
Sí. Cubre la depuración de código de aprendizaje por refuerzo que falla sin avisar.
Detalles
Descripción original del autor
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.
Popularidad
- Estrellas en GitHub
- 29 mil
- Posición en el ranking
- #9609
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
agent-launcher-orchestrator
29 milAyuda a tu agente a planificar, crear, probar y programar un agente gestionado de Claude en tu propia cuenta, paso a paso, a partir de un objetivo claro.
grade-iterate
29 milPermite que tu agente evalúe el trabajo de un agente de IA gestionado según una rúbrica y lo mejore en un número fijo de rondas, para que nunca entre en un bucle infinito.
interview
29 milPermite que tu agente te entreviste sobre una idea de agente de IA y convierta tus respuestas en un plan de construcción sencillo antes de poner nada en marcha.
run-without-you
29 milAyuda a tu agente a configurar un agente gestionado de IA para que se ejecute según un calendario o cuando ocurra un evento, comprobando el horario cron antes del lanzamiento.
Skills parecidas
pytorch-patterns
280 milAyuda a tu agente a usar PyTorch para modelos de machine learning. Aplica buenas prácticas para entrenar modelos de forma eficiente y obtener resultados reproducibles.
evm-token-decimals
280 milAyuda a tu agente a evitar errores con números decimales en distintas redes blockchain. Asegura que los valores de los tokens sean exactos en transacciones y cálculos.
ito-inference
280 milPermite a tu agente comprobar la disponibilidad de modelos de IA. Conecta la solicitud de cómputo con el servicio de modelo listo.