Differentiate a fixed-noise path
For , write with parameter-independent . Under conditions permitting differentiation through expectation,
Randomness remains, but the sampled path becomes differentiable in the parameters. Reusing noise for nearby parameter values also supports a finite-difference check.
Compared with score-function estimators
REINFORCE uses and need not differentiate the objective with respect to the sample. Pathwise estimation requires a differentiable sampling transform and objective. It often reduces variance, but there is no universal variance ordering for all distributions and objectives. Ordinary continuous pathwise gradients do not directly apply to categories; relaxations and straight-through estimators introduce their own tradeoffs.
Squashed Gaussian policies
For and ,
Scaling into actuator bounds adds the corresponding Jacobian constant. Use stable log-Jacobian calculations near saturation.
Gradient boundaries in SAC
During an actor update, critic parameters can remain fixed while action derivatives of flow into the actor. Detaching the complete Q value destroys that path. Temperature updates normally detach the entropy residual so they do not inadvertently optimize the policy.
Check a Gaussian expectation with a known analytic gradient, then the squashing density, before integrating the estimator into SAC.
Related reading: SAC and duality and policy gradients.