Glossary · Reinforcement learning

CAPS regularisation

Also called CAPS, Conditioning for Action Policy Smoothness

Extra loss terms that make a policy's actions smooth: similar from one step to the next, and similar for similar states.

CAPS (Conditioning for Action Policy Smoothness, Mysore et al. 2021) is a regularisation method for smooth control. RL policies often jitter: the network’s output can change sharply between nearby inputs, and on a real motor or a simulated body that becomes visible twitching (see jitter).

CAPS adds two penalties to the training loss. Writing μθ(s)\mu_\theta(s) for the policy’s mean action:

Temporal smoothness: consecutive actions should be close.

LT=∥μθ(st)−μθ(st+1)∥L_T = \big\lVert \mu_\theta(s_t) - \mu_\theta(s_{t+1}) \big\rVert

Spatial smoothness: states that are almost the same should get almost the same action. A nearby state sˉ\bar{s} is made by adding a little noise.

LS=∥μθ(s)−μθ(sˉ)∥,sˉ∼N(s,σ2)L_S = \big\lVert \mu_\theta(s) - \mu_\theta(\bar{s}) \big\rVert, \qquad \bar{s} \sim \mathcal{N}(s, \sigma^2)

The total loss is

L=LPPO+λTLT+λSLSL = L_{\text{PPO}} + \lambda_T L_T + \lambda_S L_S

Larger weights λT,λS\lambda_T, \lambda_S give smoother but less responsive control.

Why not just filter the actions?

A low-pass filter on the output also smooths, but it adds lag, and the policy has to learn around the lag. CAPS makes the network itself smooth, so it doesn’t need heavy filtering. In practice the two work well together.

In this project

We use squared distances for both terms, with λT=λS=0.5\lambda_T = \lambda_S = 0.5, and make sˉ\bar{s} by adding noise with σ=0.05\sigma = 0.05 to the normalised observation. CAPS was one of five changes that took calm jitter from 1.7 to 0.01 direction reversals per joint per second. The others were a balance gate, an adaptive action filter, smoothness rewards on the real joint motion, and a foam floor.

In the blocking work, CAPS also smoothed the four block buttons the policy presses itself. A press is exactly a sudden jump in an output, so the fighter never pressed one deliberately until the buttons were exempted (see Blocking).

Related terms

Used in

← All terms