Skip to content

fix state values update bug in ch04/policy_eval.py #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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