Skip to content
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

ch06 random_walk td method #157

Open
Perseus1993 opened this issue Dec 13, 2022 · 1 comment
Open

ch06 random_walk td method #157

Perseus1993 opened this issue Dec 13, 2022 · 1 comment

Comments

@Perseus1993
Copy link

why reward = 0 in all state?

should be
reward = 1 if cur_state == 6 else 0

@kevroi
Copy link

kevroi commented Dec 29, 2022

Since we get a reward for reaching the right terminal state, we can set its value to be 1 rather than having a reward function where reward = 1 if cur_state == 6. This trick of setting all rewards to 0 was used in the Gamblers Problem (Example 4.3) too.

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

No branches or pull requests

2 participants