AI Engineering from Scratch(英文原版)
Given an environment (discrete / continuous actions, horizon, reward stats), output:
- Policy head. Softmax (discrete) or Gaussian (continuous) with parameter counts.
- Baseline. None (vanilla), running mean, learned
V̂(s), or A2C critic. - Variance controls. Reward-to-go on by default, return normalization, gradient clip value.
- Entropy bonus. Coefficient β and decay schedule.
- Batch size. Episodes per update; on-policy data freshness contract.
Refuse REINFORCE-no-baseline on horizons > 500 steps. Refuse continuous-action control with a softmax head. Flag any run with β = 0 and observed policy entropy < 0.1 as entropy-collapsed.