SYDE 572 · Introduction to Pattern Recognition
Value iteration and Q-learning
Library and demos. I used the simple_rl library (the neevparikh fork on GitHub, cloned and installed with pip install .) in a conda environment with Python 3.10.18. Problem 1 uses examples/value_iteration_update_viz_example.py and Problem 2 uses examples/q_learning_viz_example.py.
Gridworld conventions. Cells are numbered from one, with (1,1) at the bottom left and y increasing upward. In the pictures the goal is a green circle, the lava is a red circle, the start is a blue triangle and a wall is a dark grey cell. The demo defaults are: slip probability 0.05, gamma 0.95, delta 0.0001, at most 500 iterations, step cost 0.1 and lava cost 1.0 (the last two are fixed inside the demo). The demo's default grid is 4 wide and 3 high, so every run below passes the height explicitly with -H.
Getting iteration counts. Run with --skip, the demo only prints the running time, not the number of iterations. For counts I wrote common.py, which builds the same gridworld with the same settings as the demo and calls the library's value iteration, and the small scripts in the Code section use it. Where I also ran the demo without --skip (it prints "Showing history 0001 of N", with N the number of iterations), I say so.
Problem 2 runs and the seed. The Q-learning demo has no seed option, so two runs of the same command give slightly different numbers. I wrote demo_seed0.py, which fixes the random seed to 0 and then runs q_learning_viz_example.py -m agent itself, and which also saves the plot the demo draws as a png. All the Problem 2 figures come from it. Seed 0 is just the first seed, chosen before I looked at any results. To see how much the results depend on the seed, part2_runs.py repeats every setting with seeds 0 to 4 (same gridworld, same agents, 60 episodes of 200 steps, 5 instances) and I base the conclusions on those five seeds, not on one plot.
AttributeError: module 'time' has no attribute 'clock', because simple_rl/run_experiments.py calls time.clock(), which was removed in Python 3.8. I replaced every time.clock() in my installed copy of that file with time.perf_counter() (with a backup of the original). It only changes the timer that prints how long a run took, not the learning.The grid is 4 by 4 with the goal at the top right (4,4), the lava right below it at (4,3), the start at the bottom left (1,1) and one wall above the start at (1,2). Everything else is at the defaults.
python examples/value_iteration_update_viz_example.py -w 4 -H 4 -il '(1,1)' -gl '[(4,4)]' -ll '[(4,3)]' -W '[(1,2)]' --skip
Same gridworld and delta = 0.0001, with -g set to 0.9, 0.7, 0.1 and 0.001 (and 1 for part (ii)). Iteration counts are from part1b_iterations.py and part1b_gamma1.py.
| gamma | Iterations | Runs |
|---|---|---|
| 0.9 | 7 (one run gave 8) | 6 |
| 0.7 | 6 | 6 |
| 0.1 | 4 | 6 |
| 0.001 | 3 | 6 |
| 1 | 8 | 5 |




For gamma = 0.9 and 0.7 (and also at 0.95 and 1), the policy from the start (1,1) goes right, then up and across the top row to the goal at (4,4). That is 6 steps, which is the shortest possible path given the wall at (1,2), and it stays on the top row to avoid the lava at (4,3). So for these gammas the policy is the shortest path. As gamma goes down, the values shrink, because rewards further away count for less, so the goal is only worth much once the agent is close to it, and further away the -0.1 step cost dominates. Lower gamma also makes value iteration stop in fewer iterations: 7 at 0.9, 6 at 0.7, 4 at 0.1 and 3 at 0.001, because the values depend less on far-away states and settle faster.
At very low gamma the policy stops being the shortest path. At gamma = 0.1 only the states right next to the goal have a clear best action, such as (3,4) going right. Further away the values are all about -0.1 and the actions are almost tied, so the arrows in those cells do not mean much. At gamma = 0.001 this is even more extreme: every state except (3,4) has a value of about -0.1. The agent is basically myopic, because it only sees the next reward and the goal is too far away to matter. So a small gamma gives a policy that is not reliably the shortest path, and value iteration converges after only a few iterations.
Value iteration did converge with gamma = 1, in 8 iterations in all 5 runs, so it never came close to the 500 iteration limit. (Without --skip I did not run this one, so the count is from part1b_gamma1.py.) It converges because the goal and the lava are terminal states: the update loop skips them, and every path ends in one of them, so the values stay finite even with no discounting.
To make it not converge, take away the terminal states. With no goal and no lava, nothing ends the episode, so at gamma = 1 the -0.1 step cost adds up forever and the values fall without bound. I tested this with part1b_noterm.py, which removes the goal and the lava but keeps everything else:
| gamma | Iterations | Hit the 500 limit | Lowest value at iteration 1 / 10 / 100 / last |
|---|---|---|---|
| 1 | 500 | yes | -0.2 / -1.14 / -10.21 / -50.21 |
| 0.95 | 136 | no | -0.2 / -0.88 / -1.99 / -2.0 |
At gamma = 1 the lowest value drops by about 0.1 per iteration and never levels off. At gamma = 0.95 the discounting caps the sum and it settles near -2.0.
Same gridworld as 1(a), gamma = 0.95, with -d set to 1, 0.1, 0.01, 0.001 and 0.0001.
| delta | Iterations (demo window) | Iterations (part1c_delta.py) |
|---|---|---|
| 1 | 1 | 1 |
| 0.1 | 4 | 4 |
| 0.01 | 6 | 6 |
| 0.001 | 7 | 7 |
| 0.0001 | 8 | 8 |
The demo column comes from running the demo without --skip: for delta = 1 and 0.0001 I read the last line "Showing history N of N", and for 0.1, 0.01 and 0.001 I counted the "Showing history" lines. These were one run each. The script column is the same in 2 runs.
A bigger delta makes value iteration stop sooner. The library stops as soon as the largest change in any state's value during one iteration is no more than delta, so a looser threshold is reached earlier. The number of iterations grows slowly because the changes shrink fast. part1c_change.py prints the largest change after each iteration (one run):
| Iteration | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Largest change | 0.837 | 0.757 | 0.427 | 0.087 | 0.014 | 0.0017 | 0.0002 | 0.00002 |
Each delta stops at the first iteration whose largest change is at or below it. Delta = 1 stops after iteration 1 (0.837), delta = 0.1 after iteration 4 (0.087), delta = 0.01 after iteration 6 (0.0017), delta = 0.001 after iteration 7 (0.0002) and delta = 0.0001 after iteration 8 (0.00002). The first iterations change the values a lot, since that is where the goal and lava rewards spread through the grid. After that, the change shrinks by a factor of about 5 to 10 every iteration, so making delta 10 times smaller only costs one or two extra iterations, and going from delta = 1 to 0.0001 (10,000 times smaller) costs 7 more.
part1c_change.py once, so I did not check how often this happens.The grid is 4 by 4 with the start at (1,1), the goal at the top right (4,4), no lava, and everything else at the defaults (gamma 0.95, slip 0.05, step cost 0.1). "Three walls around the start" is my reading of the question: the start is in the corner, so the three walls go on (1,2), (2,1) and (2,2), which leaves the agent completely enclosed.
python examples/value_iteration_update_viz_example.py -w 4 -H 4 -il '(1,1)' -gl '[(4,4)]' -ll '[]' -W '[(1,2),(2,1),(2,2)]' --skip
No. Every cell except the start is unreachable from the start, and Fig 7 shows non-zero values in all of them, for example 0.89 at (3,4) and (4,3), 0.74 at (3,3) and 0.46 at (3,1). Value iteration does not use the start state at all: it updates every state in the grid on every iteration. The value of a state only depends on where the agent can go from that state, not on whether the agent can ever get there from the start. So these values are what the agent would get if it were placed in that cell, and they are largest next to the goal. The wall cells have no value because they are not states.
Yes, to -2. Fig 7 shows -2.0 at the start, and the library's value at the end is -1.9982 after 136 iterations.
Why. From (1,1), up is the wall at (1,2), right is the wall at (2,1), and left and down are the edge of the grid. A slip moves the agent sideways, which is also a wall or an edge, so every action keeps the agent at (1,1) with probability 1. Each step costs 0.1, so the reward is $-0.1$ for every action. All four actions are identical, so the max in the Bellman backup does not matter, and with $V_0 = 0$ the backup at the start state is
$$V_k = -0.1 + 0.95\, V_{k-1}.$$
Claim: $V_k = -0.1\,\dfrac{1 - 0.95^k}{1 - 0.95} = -2\,(1 - 0.95^k)$.
Proof by induction. For $k = 0$ the formula gives $0$, which is $V_0$. If it holds for $k-1$, then
$$V_k = -0.1 + 0.95\,\big(-2 + 2 \cdot 0.95^{k-1}\big) = -0.1 - 1.9 + 2 \cdot 0.95^{k} = -2\,(1 - 0.95^k),$$
so it holds for $k$. Since $0.95^k \to 0$, $V_k \to -2$. This is also the only value that does not change under the backup: $V = -0.1 + 0.95\,V$ gives $V = -0.1 / (1 - 0.95) = -2$. In words, the agent pays 0.1 forever, and discounting makes the total finite.
Why it stops at 136. The change at iteration $k$ is $|V_k - V_{k-1}| = 0.1 \cdot 0.95^{k-1}$. This is at most $\delta = 0.0001$ when $0.95^{k-1} \le 0.001$, that is $k - 1 \ge \ln(0.001) / \ln(0.95) \approx 134.7$, so the first such $k$ is 136. Value iteration also took 136 iterations, so the start state is the one that decides when it stops. At that point the value is still about 0.002 away from -2, which is why the screen shows -2.0 but the library reports -1.9982.
Check. part1d_start.py prints the start value after several iterations next to the formula. They agree to 4 decimals (same output in 2 runs):
| Iteration $k$ | 1 | 2 | 5 | 10 | 50 | 100 | 136 |
|---|---|---|---|---|---|---|---|
| Value from value iteration | -0.1 | -0.195 | -0.4524 | -0.8025 | -1.8461 | -1.9882 | -1.9981 |
| $-2(1 - 0.95^k)$ | -0.1 | -0.195 | -0.4524 | -0.8025 | -1.8461 | -1.9882 | -1.9981 |
Grids of 5x5, 10x10, 15x15, 20x20 and 25x25, with only -w and -H changed. The goal (3,3), lava (3,2), wall (2,2) and start (1,1) stay at the demo defaults on every size, and so do gamma, delta and the slip probability.
part1e_time.py runs value iteration on each size 5 times and reports the average. "Total time" is measured the same way as the demo's "Took X seconds" (around run_vi_histories). "Setup" is the part of that spent building the library's table of transition probabilities before the first iteration, and "loop" is total minus setup. The number of states is $N^2 - 1$, since the wall cell is not a state. "Backups" is the library's own count of Bellman backups. As a cross-check, the demo itself printed 0.2364 s for 5x5 and 7.3533 s for 25x25 (one run each, with --skip), close to the 0.24 s and 7.66 s in the table.
| Grid | States | Iterations | Backups | Total time (s) | Setup (s) | Loop (s) | Loop time per backup (µs) |
|---|---|---|---|---|---|---|---|
| 5x5 | 24 | 8 | 192 | 0.24 | 0.23 | 0.01 | 52 |
| 10x10 | 99 | 13 | 1287 | 1.06 | 1.0 | 0.06 | 47 |
| 15x15 | 224 | 19 | 4256 | 2.5 | 2.3 | 0.2 | 47 |
| 20x20 | 399 | 29 | 11571 | 4.68 | 4.1 | 0.58 | 50 |
| 25x25 | 624 | 40 | 24960 | 7.66 | 6.42 | 1.24 | 50 |
The total time grows roughly in proportion to the number of states. Per state it is 10.0, 10.7, 11.2, 11.7 and 12.3 ms going from the smallest grid to the largest, so it is close to linear but a little worse than linear. Most of the time is setup (96% at 5x5, down to 84% at 25x25), and setup alone is about 10 ms per state at every size (9.6, 10.1, 10.3, 10.3 and 10.3 ms), so it is linear in the number of states. The loop is a small share of the total, but it grows faster: from 99 states to 624 states (6.3 times as many) it goes from 0.06 s to 1.24 s (about 20 times as long). The reason is that the number of iterations also grows with grid size, from 8 to 40.
One iteration computes, for every state $s$,
$$V_k[s] = \max_a \sum_{s'} P(s' \mid s, a)\,\big(R(s,a,s') + \gamma\, V_{k-1}[s']\big).$$
Take one state $s$ and one action $a$. Each term of the sum needs $P(s' \mid s, a)$, $R(s,a,s')$ and $V_{k-1}[s']$, and the question lets us treat $V_{k-1}[s']$ as constant time, so each term costs $O(1)$. In a gridworld the agent can only end up in a few cells after one move: the cell next to it in one of the four directions or the same cell if it bumps into something (so at most 5 cells), whatever the size of the grid. So the sum has at most 5 terms, a constant, and computing the value of one $(s, a)$ pair costs $O(1)$. The max over actions goes over 4 actions (up, down, left, right), which is also a constant, so updating one state costs $O(|A| \cdot 5) = O(1)$. The loop over all states does this $|S|$ times, so one iteration costs
$$O(|S|),$$
which for an $N \times N$ grid is $O(N^2)$. The initial value $V_0$ being constant only matters for what the first iteration reads and does not change the cost. If transitions were not sparse, so that any state could lead to any other, the sum would have $|S|$ terms and one iteration would cost $O(|A|\,|S|^2)$. The gridworld is the sparse case. The library updates states in place (a state's update can already use new values from earlier states in the same sweep), unlike $V_{k-1}$ in the pseudocode, but it still does one backup per state per iteration, so the count does not change.
One iteration costs $O(|S|)$, so $k$ iterations cost $O(k\,|S|)$, and that is exactly the library's backup count: 24 × 8 = 192 backups for 5x5 up to 624 × 40 = 24960 for 25x25 (the "Backups" column equals states times iterations on every row). The measured loop time follows it. It takes about 50 µs per backup on every size, so each backup does take constant time, which matches the $O(1)$ cost of updating one state from (ii). The loop time grows faster than the number of states only because the iteration count $k$ grows too, which matches $O(k\,|S|)$.
The total time in (i) is not just this loop. About 84% to 96% of it is the setup, which I did not count in (ii) because it is not part of the iteration. The setup also scales with the number of states (about 10 ms per state), so the total looks close to linear in $|S|$ on these grid sizes. Because the iteration count keeps growing with grid size, I would expect the loop part to take a larger share on bigger grids, but I only tested up to 25x25, so I did not check that.
All of Problem 2 uses the demo's default gridworld: 10 by 10 with the demo's maze of walls, five lava cells, the goal at (10,8), the start at (1,1), slip probability 0.05 and gamma 0.95. The Q-learning agent defaults are epsilon = 0.1, alpha = 0.2, uniform exploration and no annealing, and each setting changes only what the question says. -m agent trains the agent for 60 episodes of at most 200 steps, repeats that 5 times (the "instances") and plots the cumulative reward, with a shaded band, next to a random agent. Each step costs 0.1, lava costs 1.0 and reaching the goal gives a positive reward, so a higher (less negative) cumulative reward is better. The number printed at the end of each run, and used below, is the final cumulative reward averaged over the 5 instances. The line in each figure stops at episode 58, so it ends slightly above the printed number.
Final cumulative reward (higher is better) for seeds 0 to 4, from part2_runs.py. The random agent averages -593.2 over the same five seeds in every row except the last (where it is -1200.0).
| Setting | Seed 0 | Seed 1 | Seed 2 | Seed 3 | Seed 4 | Mean |
|---|---|---|---|---|---|---|
| default (epsilon 0.1, alpha 0.2) | -490.46 | -483.72 | -484.32 | -504.72 | -488.1 | -490.3 |
| epsilon 0.01 | -498.82 | -493.54 | -505.48 | -502.9 | -492.26 | -498.6 |
| epsilon 0.5 | -357.62 | -351.98 | -363.44 | -367.62 | -347.78 | -357.7 |
| epsilon 0.99 | -581.5 | -563.82 | -596.16 | -552.66 | -566.58 | -572.1 |
| epsilon 1 | -579.88 | -612.26 | -590.14 | -587.54 | -589.94 | -592.0 |
| epsilon 0 | -491.64 | -491.66 | -501.42 | -484.6 | -487.58 | -491.4 |
| alpha 0.01 | -718.1 | -717.02 | -732.94 | -702.14 | -729.06 | -719.9 |
| alpha 0.5 | -365.58 | -365.1 | -372.9 | -367.4 | -359.28 | -366.1 |
| alpha 0.99 | -272.44 | -273.14 | -269.64 | -274.82 | -277.82 | -273.6 |
| softmax exploration | -562.84 | -569.18 | -563.52 | -577.72 | -561.42 | -566.9 |
| annealing | -491.28 | -487.22 | -494.42 | -476.42 | -486.28 | -487.1 |
| softmax and annealing | -558.68 | -566.0 | -569.96 | -584.64 | -573.1 | -570.5 |
| start blocked by walls | -1200.0 | -1200.0 | -1200.0 | -1200.0 | -1200.0 | -1200.0 |
The table comes from one run of part2_runs.py. The seed-0 column matches, to the last decimal, the final Q-learning numbers the demo printed for the figures below, which is what a fixed seed should give.
Not in the form we used it here. Value iteration needs the model of the environment, the transition probabilities $P(s' \mid s, a)$ and the rewards, and it loops over every state on every iteration, so it needs a state space it can list. A Gym environment only gives a simulator: I can call it with an action and get back one sampled next state and reward, but not the probabilities. CartPole and MountainCar also have continuous states, so there are infinitely many states to sweep over, and Atari states are screen images, so there are far too many. I could force it by discretizing the states and estimating a model from samples, but that is exactly the work Q-learning avoids.
These features of Q-learning let it run on those domains:
Epsilon is the probability that the agent ignores its Q-values and picks a uniformly random action. The runs below use -ep with everything else at the defaults (seed 0).




Over the five seeds (table above), epsilon = 0.01 gave a mean of -498.6, 0.1 gave -490.3, 0.5 gave -357.7 and 0.99 gave -572.1, against -593.2 for the random agent. So 0.5 was clearly best of the values I tried. The result is not monotonic: more exploration helped up to 0.5 and then hurt, and at 0.99 the agent is only slightly better than random. My explanation is that with only 60 episodes the agent has to find the goal and the safe paths in a large maze, so extra random moves help it learn more of the maze early, while at 0.99 it almost never uses what it has learned. I did not test this directly. Epsilon = 0.01 and 0.1 gave almost the same result (the gap, 8 points, is smaller than the spread between seeds within one setting, which was 13 points for 0.01 and 21 points for 0.1); part (ii) below gives a possible reason.
With epsilon = 1 the agent picks a uniformly random action on every step, so it behaves exactly like the random agent, even though its Q-values are still being updated. The two lines in Fig 12 follow each other and their bands overlap (final values -579.88 and -613.64 with intervals of about 33 and 22), and over five seeds the means are -592.0 and -593.2. It learns nothing useful in terms of reward, because it never acts on what it has learned.
With epsilon = 0 the agent always takes the action with the highest Q-value and never explores at random. I expected this to do worse, but its mean over five seeds is -491.4, the same as epsilon = 0.1 (-490.3), and much better than random. A possible reason is that all the Q-values start at 0 and every step has a negative reward, so each action the agent tries looks worse than the actions it has not tried yet, and a purely greedy agent is pushed to try the other actions anyway. The library also breaks ties between equal Q-values at random, and the slip probability adds some randomness. I did not test this explanation. A greedy agent can get stuck on the first path that works and never find a better one, and my runs are too short to show whether that happens.
Alpha is the learning rate: how far each update moves the Q-value toward the new estimate. The runs use -a with everything else at the defaults (seed 0; the default alpha = 0.2 is Fig 11).



Over five seeds the means are -719.9 for alpha = 0.01, -490.3 for the default 0.2, -366.1 for 0.5 and -273.6 for 0.99, so in this range a larger alpha was better every time. Alpha = 0.01 did worse than the random agent (-593.2), and the gap is far larger than the spread between seeds. With such a small alpha each update changes a Q-value by 1% of the way to its target, so in 60 episodes the Q-values barely move away from 0 and the agent has not learned much by the end. I did not find out why it ends up worse than random and not just equal to it. At the other end, alpha = 0.99 replaces the old Q-value almost completely with each new sample, which works here because the gridworld is almost deterministic (slip probability 0.05). In a noisier environment I would expect a value that high to make the Q-values jump around with every sample, so I would not assume it is best in general.
Uniform exploration (-ex uniform, the default) is epsilon-greedy: with probability 1 - epsilon the agent takes the best action, and otherwise a uniformly random one. Softmax exploration (-ex softmax) picks every action with probability proportional to $e^{Q(s,a)/\beta}$, so actions with higher Q-values are more likely and clearly bad ones are rarely tried. In the library the temperature $\beta$ is fixed at 0.2 and epsilon is not used.


Uniform exploration did better in my runs: the mean over five seeds is -490.3 for uniform and -566.9 for softmax, and softmax is only a little better than random (-593.2). One reason could be that with a step cost of only 0.1 the Q-values early on differ by small amounts. With $\beta = 0.2$, two actions whose Q-values differ by 0.1 get probabilities in the ratio $e^{0.5} \approx 1.65$, so the best of four actions would get about 35% instead of 25%. The softmax agent would then still act almost randomly until the Q-values spread out, which takes longer than 60 episodes. I did not test this. The advantage of softmax is that its exploration avoids actions that are clearly bad (an action whose Q-value is lower by 1 would be about 150 times less likely than the better one), while epsilon-greedy explores into them just as often as anything else. My runs are too short to show that benefit.
What it does. With -an, the agent slowly lowers its learning rate alpha and its exploration rate epsilon as training goes on. In the library both are divided by $1 + \frac{\text{step}}{1000} \cdot \frac{\text{episode} + 1}{2000}$, so the divisor grows with the number of steps and episodes so far.
Why it helps. Early on the agent knows little, so a high epsilon and alpha let it explore and learn fast. Later the Q-values are mostly right, so a smaller epsilon lets the agent follow what it learned and waste fewer steps on random moves, and a smaller alpha stops single noisy samples (such as a slip) from pulling the Q-values around, so they can settle. A shrinking learning rate is also the standard condition for Q-learning to converge.
What I saw when toggling it. No clear difference. With uniform exploration the mean over five seeds went from -490.3 to -487.1, and with softmax from -566.9 to -570.5. These are paired runs (same seeds), and the differences go both ways: with annealing the result was better on 2 of 5 seeds and worse on 3 of 5 for uniform exploration (the differences range from -10.1 to +28.3), and the same split for softmax (from -11.7 to +4.2). That is within the spread between seeds, so I cannot say annealing helped or hurt. This fits the schedule: in a 60-episode run with at most 200 steps each, the divisor reaches about $1 + 12 \cdot 61 / 2000 \approx 1.4$ at the very end, so epsilon only goes from 0.1 to about 0.07 and alpha from 0.2 to about 0.15. A much longer run would be needed to see an effect, and I did not try one.
The demo's default walls already include (2,1), the cell to the right of the start (1,1). I added walls at (1,2) and (2,2) (the same cells as in 1(d)), so the start is completely enclosed. Everything else is at the defaults (seed 0, --block in demo_seed0.py).
Both agents get a straight line down to -1200, and only one line is visible because the Q-learning line sits exactly on top of the random one (the band has width 0, and the five seeds all gave exactly -1200.0). The agent cannot leave (1,1), so every action keeps it there and costs 0.1. An episode is 200 steps, so each one gives $200 \times (-0.1) = -20$, and 60 episodes give $-1200$. Nothing the agent does changes anything, so there is nothing for Q-learning to learn, and any exploration setting would give the same line. This is the same situation as the walled-in start in 1(d), where the start state's value went to -2 (the sum of the -0.1 steps discounted by 0.95) because the agent pays the step cost forever.
All scripts are in this folder and are run with python -W ignore from this folder, in the conda environment with simple_rl installed.
| File | What it does |
|---|---|
| common.py | builds the gridworld with the demo's settings and runs value iteration |
| part1b_iterations.py | 1(b): iterations for gamma = 0.9, 0.7, 0.1, 0.001 |
| part1b_gamma1.py | 1(b)(ii): gamma = 1 on the 1(a) gridworld |
| part1b_noterm.py | 1(b)(ii): no goal and no lava, gamma = 1 and 0.95 |
| part1c_delta.py | 1(c): iterations for delta = 1, 0.1, 0.01, 0.001, 0.0001 |
| part1c_change.py | 1(c): largest change in any state's value after each iteration |
| part1d_start.py | 1(d): start state value per iteration, compared with the formula |
| part1e_time.py | 1(e): states, iterations, backups, total and setup time for each grid size |
| part2_runs.py | Problem 2: final cumulative reward for every setting, seeds 0 to 4 |
| demo_seed0.py | Problem 2: runs the Q-learning demo with seed 0 and saves its plot as a png |
Larissa Rudenko - Fall 2026