mpatacchiola / dissecting-reinforcement-learning

Python code, PDFs and resources for the series of posts on Reinforcement Learning which I published on my personal blog
https://mpatacchiola.github.io/blog/
MIT License
609 stars 175 forks source link

Part 3, TD(lambda): trace_matrix should be reset to zeroes at the beginning of each epoch #22

Open johanwiden opened 9 months ago

johanwiden commented 9 months ago

I believe that in part 3, TD(lambda), the trace_matrix should be reset to zeros at the beginning of each epoch. Otherwise the utility of a state may be updated even if the state is not part of the current trace.

Also, I believe that the decay of the trace_matrix should be moved to just before the line: trace_matrix[observation[0], observation[1]] += 1