Commit Graph

5 Commits

Author SHA1 Message Date
Chris Proctor
d83a3b7e4b Update questions 2026-06-26 21:30:22 -04:00
Chris Proctor
482f4f6cfa Updates 2026-06-26 20:59:25 -04:00
Chris Proctor
a9385f8296 Refactoring lab 2026-06-26 13:27:11 -04:00
Chris Proctor
e752bb848b Refactor lab 2026-06-25 21:10:13 -04:00
Chris Proctor
e8a24ae7be Split q_learning.py into algorithm, environment glue, and a training script
q_learning.py mixed a bespoke BabySnake environment wrapper, the two
functions students implement, a training loop, and a terminal watch
routine in one file, with no tests and no single command to run
training.

- q_learning.py / q_learning_solution.py now hold only choose_action
  and update_q, with actions as an explicit parameter instead of a
  module-global, so the file has no babysnake/retro/retro_gamer
  imports at all.
- train_babysnake.py builds GameEnvironment directly from babysnake's
  pyproject metadata, trains, and watches the trained agent in one
  command: `python train_babysnake.py`. It also caps steps per
  episode, since a lucky random walk that keeps finding food can
  otherwise make an episode run unboundedly long.
- test_q_learning.py adds unittest coverage for both functions with no
  game dependency.
- questions.md adds a checkpoint instructing students to get the tests
  passing before training, and points the post-training step at
  train_babysnake.py.
2026-06-24 07:50:28 -04:00