# Investigate Reward Ablations

What happens to Microduck’s walk when you take away a reward? In this
**ablation study**, each ablation leaves out one named reward term. Use the
recordings and measurements to compare those policies with the baseline.
Look at both how closely the duck follows commands and whether its feet take
turns leading.

Each row shows one training run after 10,000 training iterations. **Off** means
the reward weight was zero. The foot-order test checks whether the feet take
turns leading during forward and backward travel.

| Training recipe         | Linear tracking   | Yaw tracking   | Foot air time   | Observed behavior                                                                                          |
|-------------------------|-------------------|----------------|-----------------|------------------------------------------------------------------------------------------------------------|
| Baseline                | ✓ On              | ✓ On           | ✓ On            | Followed horizontal commands with an error of 0.035 m/s and passed the foot-order test in 29 of 32 trials. |
| Without linear tracking | **Off**           | ✓ On           | ✓ On            | Horizontal tracking error rose to 0.201 m/s. No trial passed the foot-order test.                          |
| Without yaw tracking    | ✓ On              | **Off**        | ✓ On            | The feet took turns leading in all 32 trials, but turning-speed error rose from 0.15 to 1.28 rad/s.        |
| Without air time        | ✓ On              | ✓ On           | **Off**         | Horizontal tracking error fell to 0.026 m/s, but only 12 of 32 trials passed the foot-order test.          |

## Start With a Prediction

Imagine two ducks following the same forward command. One moves at the requested
speed but keeps the same foot in front. The other alternates its leading foot
but follows the speed less closely. Which would you choose for a walking task?
Jot down what you would measure before choosing.

In your IsaacLabTutorial checkout, open
`microduck/walking.py`. Lesson 6
uses its `RewardsCfg` in `WalkEnvCfg`. Find these three terms and predict how
the gait or command tracking might change if you set each weight to zero:

- `track_lin_vel`: reward for matching requested horizontal velocity.
- `track_ang_vel`: reward for matching requested yaw rate, or turning speed.
- `air_time`: reward for a foot being airborne within the specified time window.

For `air_time`, follow `feet_air_time_windowed` into `mdp/rewards.py`.
When the movement command exceeds the threshold, the function counts each foot
whose current air time is between 0.125 and 0.30 seconds. Could the same foot
stay ahead while both feet earn that reward?

For each prediction, name an intended effect and a possible tradeoff. Keep your
notes so you can revisit them after examining the results.

## Understand the Study Conditions

This case study uses Isaac Lab’s flat-ground Microduck task with the backlash
preset. Each reward recipe was trained from scratch for 10,000 iterations. The
symmetric recipes use the symmetry-enabled runner, which trains on mirrored left
and right data. An ablation sets one named reward weight to zero.

Some recipes also differ in the action-change penalty weights applied during
training. Because more than one factor can change, use the results to form
hypotheses rather than attribute an effect to one reward alone.

## Inspect the Motion at 5k Iterations

The 40-second recordings request standing, forward, backward, left, right,
turning left, turning right, combined travel and turning, and stopping, in
four-second segments. These recordings use checkpoints saved at 5,000 iterations
(5k). They start from fixed positions and change commands. The measurements
below use multiple trials with randomized starts.

Compare **Baseline** and **Without air time** in the video grid. Select the
**Forward** chapter at **0:04** to jump all four videos to that command, then
select **Play All**. Compare the feet during the forward command. At 0:08, watch
what changes when the command switches to backward.

Open the [shared 5k recording](https://docs.nvidia.com/learning/physical-ai/getting-started-with-isaac-lab/2026-11.3/_downloads/148347808e3527b5a091a2f03658e7f2/microduck-ablation-shared-5k.html)
in a browser, or watch the [baseline recording](https://docs.nvidia.com/learning/physical-ai/getting-started-with-isaac-lab/2026-11.3/_downloads/6839c059fd65314c0ab471ac7103ce9b/baseline-5k.mp4)
and [air-time ablation recording](https://docs.nvidia.com/learning/physical-ai/getting-started-with-isaac-lab/2026-11.3/_downloads/b26a31e250d4136f5e92e331dff818a6/air_time-5k.mp4)
separately. Use the timestamps above to compare the same command.

Watch the baseline, then the air-time ablation. Look for whether each foot
passes the other, sideways motion, and body rotation. Note what you can see and
one question the recording leaves open.

## Read the Measurements Before Ranking Policies

The static figures compare the baseline with the linear-tracking, yaw-tracking,
and air-time ablations at **10k** and **5k** training updates. Use the **5k**
figure later in this section when comparing measurements with the recordings.

![At 10,000 updates, removing linear tracking increases horizontal error, removing yaw tracking increases yaw error, and removing air time reduces horizontal error while decreasing foot-order acceptance. All four policies survive every nominal trial.](images/microduck-ablation-10k.svg)

The four example policies show several tradeoffs at 10,000 iterations.
Without linear tracking, horizontal error is much greater. Every nominal trial
survives, but none of the forward/backward trials passes the foot-order criterion.
Survival alone would have missed both problems.

Removing yaw tracking coincides with much greater yaw-rate error, even though
all forward/backward trials pass the foot-order criterion. That foot check does
not evaluate whether the robot turns when asked.

A policy passes every foot-order trial. Can you
conclude that it follows turning commands? Explain which measurement you need
before answering.

<!-- BEGIN ablation-explorable-D: task-requirements -->

## Which Policies Meet Your Task Requirements?

Compare four recorded policies at **10k** updates. Require horizontal tracking
error of at most **0.05 m/s**, foot-order acceptance of at least **80%**, and
**100% nominal survival**.

- **Baseline:** horizontal error 0.0352 m/s; foot-order acceptance 90.625%; nominal survival 100%. Meets these requirements.
- **Without linear tracking:** horizontal error 0.2008 m/s; foot-order acceptance 0%; nominal survival 100%. Does not meet these requirements.
- **Without yaw tracking:** horizontal error 0.0306 m/s; foot-order acceptance 100%; nominal survival 100%. Meets these requirements.
- **Without air time:** horizontal error 0.0255 m/s; foot-order acceptance 37.5%; nominal survival 100%. Does not meet these requirements.

These requirements do not test yaw tracking, pushes, or rough terrain.

A policy passes this filter but turns the wrong way at a corner. Which missing requirement would you add, and which evaluation scenarios would test it?

<!-- END ablation-explorable-D -->

## Choose the Next Experiment

Suppose your robot must walk a narrow inspection route and turn at each corner.
Your task needs reliable command following and repeated foot alternation. Pick
a candidate from the measured policies and write a short recommendation
containing:

1. Your task requirements and the measurements you used to judge them.
2. At least two measured results, with checkpoint age and policy identity.
3. One observation from a recording, identifying its checkpoint age.
4. One limitation that could change your conclusion.
5. A follow-up experiment that changes one factor and states what would count
   against your explanation.

For example, investigate whether a smaller nonzero air-time weight preserves
foot alternation while retaining some of the tracking improvement. Specify the
weights, matched curriculum, training budget, evaluation commands, and repeated
independent training runs before testing. The current study suggests the idea
is worth testing, but it can’t tell you the outcome.

Use the four measurements in the chart to support your recommendation. Identify
any additional measurements you would need to explain the policies’ behavior.
Avoid ranking recipes by total training return: removing a term changes the
score being optimized.

**Check Your Progress:** Another policy survives every trial and has lower
horizontal tracking error, but foot-order data is missing. Would you recommend
it for a walking task? Explain the missing evidence and propose a test.

Next, in [Shape Rewards](https://docs.nvidia.com/learning/physical-ai/getting-started-with-isaac-lab/2026-11.3/train-a-microduck/08-shape-rewards.md), examine how a weight changes the feedback
for a fixed motion, then plan a matched slip-weight experiment to test how
training changes the behavior.

For a new video-comparison case, a fifth recording includes a reset halfway
through the backward-command segment. Explain how you would align the videos
and report that interruption so a short successful interval is not mistaken
for completion of the command.
