Learn from expert demonstrations: train policy to mimic expert behavior using supervised learning on (state, action) pairs.
The problem, from first principles
RL exploration is expensive. If expert demonstrations available, learn directly by supervised learning. Behavioral cloning minimizes cross-entropy loss on expert actions.
Takes predicted action logits and expert action labels
Computes cross-entropy loss between policy and expert
Averages over batch
Returns scalar loss
Constraints
Expert dataset can be small but must be representative
Distribution mismatch: learned policy diverges from expert
Requires expert demonstrations (offline)
Hints
Hint 1: Supervised learning
Treat as action classification: cross-entropy between predicted and expert action
Hint 2: Logits to probability
Use log_softmax for numerical stability
Hint 3: Distribution mismatch
Policy must handle states outside expert's distribution (DAgger addresses this)
Keywords
rlimitationdemonstrationsbehavioral-cloning
Python
Run your code to see results
No results yet
Run your code to check it against the examples, or submit to run every test.