executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
ppo_clipped_surrogate_objectiveCompute and validate PPO clipped probability-ratio surrogate objectives and trust-region-style diagnostics.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this skill when a PPO implementation, recovery harness, or audit needs the paper's clipped surrogate objective from Equation 7. Do not use it as a generic ratio clamp: the selected term must be the minimum of the unclipped and clipped advantage-weighted objectives.
new_log_probs: log probabilities under the updated/current policy.old_log_probs: log probabilities under the behavior policy.advantages: advantage estimates aligned with the sampled actions.clip_epsilon: clipping half-width, often 0.2.ratio = exp(new_log_prob - old_log_prob).ratio * advantage for the conservative-policy-iteration surrogate term.[1 - epsilon, 1 + epsilon] and multiply by the same advantage.Run python tests/test_surrogate.py from this skill directory. The tests cover positive-advantage upper clipping, negative-advantage lower clipping, and in-range no-op behavior.
This skill computes the policy objective only. Value loss, entropy bonus, rollout generation, and optimizer execution belong to separate modules.