|
| 1 | +# Homework 1: Value-Based Reinforcement Learning |
| 2 | + |
| 3 | +This homework covers tabular and deep Q-learning methods. |
| 4 | + |
| 5 | +## Structure |
| 6 | + |
| 7 | +- `Homework_1_theory.pdf` - Theory questions (submit on Gradescope) |
| 8 | +- `problem_1/` - Tabular Q-iteration for MountainCar |
| 9 | +- `problem_2/` - DQN for Tetris (provided separately) |
| 10 | + |
| 11 | +## Submission Instructions |
| 12 | + |
| 13 | +### Theory (Gradescope) |
| 14 | +Submit your answers to the theory questions as a PDF on Gradescope. |
| 15 | + |
| 16 | +### Programming Problems (Leaderboard) |
| 17 | + |
| 18 | +For each programming problem, submit to the course leaderboard: |
| 19 | + |
| 20 | +**Problem 1: MountainCar Q-Iteration** |
| 21 | +- Submit: `policy.py` and `checkpoint.pt` |
| 22 | +- Your policy must achieve mean reward > -150 |
| 23 | + |
| 24 | +**Problem 2: Tetris DQN** |
| 25 | +- Submit: `policy.py` and `checkpoint.pt` |
| 26 | +- Your policy must beat the random baseline |
| 27 | + |
| 28 | +### How to Submit to Leaderboard |
| 29 | + |
| 30 | +1. Go to the course leaderboard website |
| 31 | +2. Select the appropriate problem (MountainCar or Tetris) |
| 32 | +3. Upload your `policy.py` and `checkpoint.pt` files |
| 33 | +4. Wait for evaluation results |
| 34 | + |
| 35 | +### File Requirements |
| 36 | + |
| 37 | +Your `policy.py` must contain: |
| 38 | +- A `Policy` class with a `forward(obs)` method that returns an action |
| 39 | +- A `load_policy(checkpoint_path)` function that returns a Policy instance |
| 40 | + |
| 41 | +Your `checkpoint.pt` must be loadable by your `load_policy` function. |
| 42 | + |
| 43 | +## Getting Started |
| 44 | + |
| 45 | +```bash |
| 46 | +# Install dependencies |
| 47 | +pip install torch numpy gymnasium pufferlib |
| 48 | + |
| 49 | +# Problem 1: Run Q-iteration |
| 50 | +cd problem_1 |
| 51 | +python problem_1.py |
| 52 | + |
| 53 | +# Test your policy locally |
| 54 | +python policy.py |
| 55 | +``` |
| 56 | + |
| 57 | +## Grading |
| 58 | + |
| 59 | +- Theory questions: See Gradescope rubric |
| 60 | +- Programming problems: Pass/fail based on leaderboard performance thresholds |
0 commit comments