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

[RLlib] SimpleQ PolicyV2 (sub-classing). #25871

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented Jun 16, 2022

SimpleQ PolicyV2 (sub-classing).

Why are these changes needed?

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Copy link
Member

@gjoliver gjoliver left a comment

Choose a reason for hiding this comment

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

looks really good. thanks.
just 1 question, and 1 unit test seems to fail. should be easy to fix:

ImportError: cannot import name 'SimpleQTFPolicy' from 'ray.rllib.algorithms.simple_q.simple_q_tf_policy'

if SampleBatch.PREV_REWARDS in input_dict:
builder.add_feed_dict(
{self._prev_reward_input: input_dict[SampleBatch.PREV_REWARDS]}
if hasattr(self, "_input_dict"):
Copy link
Member

Choose a reason for hiding this comment

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

can you explain the changes a little bit?
It seems you removed the state_batches from feed_dict, and I am not sure why.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's soft-deprecated since the trajectory view API was introduced. You shouldn't call this method anymore with anything other than an input_dict, such that you have flexibility as to the different field names, e.g. you could have a "prev_10_actions" in your input_dict (was not supported before due to hardcoded prev_action|reward schema).

Copy link
Member

Choose a reason for hiding this comment

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

wow, ok, should have been deprecated long time ago then.
cool.

@sven1977
Copy link
Contributor Author

Sorry, I had forgotten to push the tf fixes. This is done now. Let's wait for tests to pass, then I'll ping you again. Thanks for reviewing @gjoliver .

Copy link
Member

@gjoliver gjoliver left a comment

Choose a reason for hiding this comment

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

this is good! that cql test is not related. I can't figure out why test_cql times out in ci.

@sven1977 sven1977 merged commit d90c6cf into ray-project:master Jun 17, 2022
@sven1977 sven1977 deleted the simpleq_dqn_policy_sub_classes_2nd_attempt branch June 2, 2023 20:18
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.

2 participants