Skip to content

Conversation

@cutePanda123
Copy link

Issue
The existing code has a bug where the state values(array V) is being updated within the loop. As a result, new calculated values are based on the already updated values rather than the original values from previous state. This leads to incorrect calculations.

Fix
This pull request modifies the code to create a copy of the values before performing calculations. Instead of using the updated values within the loop, the new values are now derived from the copied state, ensuring correctness.

@cutePanda123 cutePanda123 changed the title fix state values update bug in ch04/policy_eval.py code fix state values update bug in ch04/policy_eval.py Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant