PaperLeet

DAgger Expert Mixtures and Visited-State Aggregation

DAgger · AISTATS 2011 · Medium · 30 minutes

Implement per-state expert mixing and retain every previous round of labeled states.

Isolate Algorithm 3.1 in a scalar linear environment with policy refitting; no interactive human expert or full classifier.

Functions to implement

DAgger Expert Mixtures and Visited-State Aggregation

1. Exercise goal

Implement per-state expert mixing and retain every previous round of labeled states.

Isolate Algorithm 3.1 in a scalar linear environment with policy refitting; no interactive human expert or full classifier.

2. Core equations

$$ \pi_i=\beta_i\pi^+(1-\beta_i)\hat\pi_i,\qquad D\leftarrow D\cup{(s,\pi^(s))}. $$

3. From equations to code

  • mixture_actions(expert: Tensor, learner: Tensor, draws: Tensor, beta: float) -> Tensor
  • aggregate_dataset(old_states: Tensor, old_labels: Tensor, states: Tensor, labels: Tensor) -> tuple

Select one policy action per state rather than averaging action vectors. Concatenate on the sample axis and retain old labels. Expert labels belong to states visited by the learner; they are not the executed mixture actions.

4. Contract and boundaries

Expert/learner actions are (B,A); draws is (B,) in [0,1), and draws<beta selects the expert. Old/new states are (N,S)/(M,S), labels (N,A)/(M,A), N>=0 and M>0. Aggregated data detach all inputs; selected mixture branches preserve gradients.

Validation helpers are provided. All floating inputs are finite CPU float32/float64; do not mutate inputs. Invalid shape, dtype, range or mask arguments raise ValueError.

5. Deterministic experiment and visualization

Starting from zero-state data, collect eight-step trajectories from eight starts for four aggregation rounds and fit a feedback gain by least squares; compare twelve-step state energy.

The visualization is generated by viz/gen.py; T3 runs the same experiment with your functions and records its actual metrics. These are small deterministic teaching results, not a robot benchmark.

6. Run your implementation

Complete the functions in the Python editor on the right, then click Run tests. Inspect each failed check, update your implementation, and run again. Passing every required check marks the problem as solved and unlocks the notes.

7. Sources and extensions

Verified 2026-10-28. Extending this operator to the full paper requires the omitted model, data and environment described in the scope above.

Read source material

Related exercises