GuideOpen

Cheatsheet (spinning up deep rl)

Decision rules, thresholds and tells from Spinning Up. One page; keep it beside you.

Cheatsheet

Decision rules, thresholds and tells from Spinning Up. One page; keep it beside you.

Which algorithm?

IfThenBecause
Discrete actionsPPO (or VPG to learn)DDPG, TD3 and shipped SAC are continuous-only
Continuous, stability matters mostPPODirectly optimizes performance; on-policy is stable
Continuous, sample efficiency matters mostSAC, else TD3Off-policy data reuse; both are research-grade here
You are learning the fieldVPG first, then DQN, A2C, PPO, DDPGSimplest first; complexity added gradually
You need a research baseline for TRPO/PPOOpenAI Baselines, not Spinning UpSpinning Up's on-policy trio omits observation normalization and normalized value targets
You need a research baseline for DDPG/TD3/SACSpinning Up is fineRoughly at parity with best reported results
Partial observability or pixelsNone of these as shippedAll six are non-recurrent MLP actor-critics

Debugging a run that does not learn

  1. Assume it is a bug, not the hyperparameters. Bad hyperparameters degrade performance;

if yours resemble the paper's, they are probably not the cause.

  1. Check tensor shapes. A [N] vs [N,1] mismatch is broadcast-compatible, raises

nothing, and silently corrupts the Bellman backup into an [N,N] matrix.

  1. Check what your loss is computed on — wrong equation, wrong distribution, or data

piped to the wrong place are the three usual causes.

  1. Do not read the policy-gradient loss as a health signal. Only average return means

anything; the loss can go to negative infinity while performance craters.

  1. Instrument more. Mean/std/min/max of returns, episode lengths and value estimates;

objective losses; exploration parameters (policy entropy, epsilon). Watch videos too.

  1. Test in more than one environment once results look promising — code can work in one

environment despite a breaking bug.

Thresholds and defaults

QuantityValueSource
Debug-stage turnaround targetunder 5 minutes locallyCh 10
Random seeds, minimum3Ch 10
Random seeds, thorough10 or moreCh 10, Ch 13
Debug environmentsCartPole-v0, InvertedPendulum-v0, FrozenLake-v0, HalfCheetah-v2 at 100-250 stepsCh 10
From-scratch implementation size~250-300 lines; no-frills VPG ~80Ch 10
On-policy benchmark network(64, 32), tanhCh 13
Off-policy benchmark network(256, 256), reluCh 13
On-policy batch4000 env steps per updateCh 13
Off-policy minibatch100 per gradient stepCh 13
TD3 policy_delay2Ch 18
Polyak rhoin (0,1), usually close to 1Ch 17
Benchmark length3M timesteps, 5 MuJoCo envsCh 13
Plot smoothing used in the book11-epoch windowCh 13

Choosing a research frame

FrameScopeWraps up inMain risk
Improve an existing approachNarrowA few monthsTweaks fail and you have no signal on what next
Unsolved benchmarkBroadMonths to a year-plusMay need a breakthrough; long time, no progress
New problem settingOpen-endedUnboundedYou must design the benchmark too; cannot go looking for these

Rigor checklist before reporting

  • [ ] Baseline tuned as much as your own method. Never handicap it.
  • [ ] All else held equal (e.g. comparable parameter counts across architecture variants).
  • [ ] At least 3 seeds, ideally 10 or more; plot mean and std dev.
  • [ ] Final runs launched fresh and precommitted — not the best or most interesting runs.
  • [ ] One ablation per design decision, so each claim is separately supported.
  • [ ] Checked the idea has not already been published.

Tells and smells

  • A learning curve with no seed band is telling you less than it looks like.
  • AverageEpRet on an off-policy algorithm is the noisy behavior policy, not performance.

Use the plotter's Performance alias.

  • Evaluating SAC without --deterministic measures the wrong policy.
  • A model-based agent that scores well but behaves badly is exploiting model bias — the

same shape as a policy exploiting Q-function errors.

  • "Fits the Bellman equation well" carries no guarantee of good policy performance.
  • A single missing squeeze in a critic is the archetype of silent failure.
  • A paper's full trick list is usually more than strictly necessary — try simplifications.
  • A library abstraction is good for reuse across algorithms and a cost when learning one.

Quick commands

python -m spinup.run ppo --env Walker2d-v2 --exp_name walker --seed 0 10 20
python -m spinup.run test_policy data/walker/walker_s0        # add -d for SAC
python -m spinup.run plot data/walker                          # prefix autocompletes
python -m spinup.run [algo] --help                             # every kwarg is a flag

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

Author: alirezarezvani, Alireza Rezvani skills and agents. License: MIT.

Shown here with formatting for the web. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The Codex library holds 7,009 entries. Members can search all of them by meaning and read every one in full.