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

fix trasure_on_right choose_action bug #31

Merged
merged 2 commits into from
Jan 27, 2018

Conversation

chucklqsun
Copy link
Contributor

.any() is checking whether any value is true,
.all() is checking whether all values are true.
state_actions.all() == 0 will be true if s[n]'s values are (0, 1) and select action randomly. It is a bug.

  A  B
0  0  0
1  0  1
2  1  2
==below is any()==
('0:', False)
('1:', True)
('2:', True)
==below is all()==
('0:', False)
('1:', False)
('2:', True)

Copy link
Owner

@MorvanZhou MorvanZhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks mate, this is indeed a bug. But to be more intuitive, I think we can change not state_actions.any() to (state_actions == 0).all(). I will approve it after you applying this change.

@chucklqsun
Copy link
Contributor Author

@MorvanZhou Good solution. I have modified and committed the revision.

@MorvanZhou
Copy link
Owner

Closed with thanks

@MorvanZhou MorvanZhou closed this Jan 27, 2018
@MorvanZhou MorvanZhou reopened this Jan 27, 2018
@MorvanZhou MorvanZhou merged commit ed018b4 into MorvanZhou:master Jan 27, 2018
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.

3 participants