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 QuadraticActionValue and add tests #190

Merged
merged 5 commits into from
Dec 1, 2017

Conversation

toslunar
Copy link
Member

QuadraticActionValue called with min_action=None or max_action=None seems to have a bug.

Note:

>>> import numpy as np
>>> np.asarray(None, dtype=np.float32)
array(nan, dtype=float32)

Copy link
Member

@muupan muupan left a comment

Choose a reason for hiding this comment

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

Good catch!

# Otherwise, v_out[i] should be less than v[i]
np.testing.assert_array_less(
v_out[~mu_is_allowed],
v[~mu_is_allowed] + 1e-4)
Copy link
Member

Choose a reason for hiding this comment

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

How about asserting v_out[~mu_is_allowed] is strictly smaller than v[~mu_is_allowed], by removing + 1e-4? The current assertion doesn't fail if they have the same values i.e. min_action and max_action are not used at all.

@muupan
Copy link
Member

muupan commented Dec 1, 2017

LGTM

@muupan muupan merged commit 4e71bad into chainer:master Dec 1, 2017
@muupan muupan added the bug label Dec 1, 2017
@muupan muupan added this to the v0.3 milestone Dec 1, 2017
@toslunar toslunar deleted the fix-actionvalue-bounds branch December 1, 2017 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants