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] AlgorithmConfigs: Make None a valid value for methods to set properties; Use new NotProvided singleton, instead, to indicate no changes wanted on that property. #30020

Merged
merged 49 commits into from
Nov 5, 2022

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented Nov 4, 2022

AlgorithmConfigs: Make None a valid value for methods to set properties; Use new NotProvided singleton, instead, to indicate no changes wanted on that property.

Synopsis:

        >>> from ray.rllib.algorithms.algorithm_config import AlgorithmConfig
        >>> config = AlgorithmConfig()
        >>> # Print out the default learning rate.
        >>> print(config.lr)
        ... 0.001
        >>> # Print out the default `preprocessor_pref`.
        >>> print(config.preprocessor_pref)
        ... "deepmind"
        >>> # Will only set the `preprocessor_pref` property (to None) and leave
        >>> # all other properties at their default values.
        >>> config.training(preprocessor_pref=None)
        >>> config.preprocessor_pref is None
        ... True
        >>> # Still the same value (didn't touch it in the call to `.training()`.
        >>> print(config.lr)
        ... 0.001

Why are these changes needed?

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • 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 :(

Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
…_configs_next_steps_4

Signed-off-by: sven1977 <svenmika1977@gmail.com>

# Conflicts:
#	rllib/algorithms/algorithm.py
#	rllib/algorithms/dreamer/dreamer.py
#	rllib/algorithms/maddpg/maddpg.py
…_configs_next_steps_4

Signed-off-by: sven1977 <svenmika1977@gmail.com>

# Conflicts:
#	rllib/algorithms/algorithm.py
#	rllib/algorithms/dreamer/dreamer.py
#	rllib/algorithms/maddpg/maddpg.py
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
@sven1977 sven1977 changed the title [RLlib] AlgorithmConfigs: Make None a valid value for methods to set properties; Use new NotProvided singleton, instead, to indicate no changes wanted on that property. [WIP; RLlib] AlgorithmConfigs: Make None a valid value for methods to set properties; Use new NotProvided singleton, instead, to indicate no changes wanted on that property. Nov 4, 2022
…_configs_next_steps_5

Signed-off-by: sven1977 <svenmika1977@gmail.com>

# Conflicts:
#	rllib/algorithms/algorithm_config.py
#	rllib/algorithms/dqn/dqn.py
#	rllib/algorithms/impala/impala.py
#	rllib/algorithms/pg/pg.py
#	rllib/algorithms/ppo/ppo.py
#	rllib/algorithms/sac/sac.py
#	rllib/algorithms/simple_q/simple_q.py
#	rllib/algorithms/slateq/slateq.py
#	rllib/algorithms/tests/test_algorithm_config.py
@sven1977 sven1977 changed the title [WIP; RLlib] AlgorithmConfigs: Make None a valid value for methods to set properties; Use new NotProvided singleton, instead, to indicate no changes wanted on that property. [RLlib] AlgorithmConfigs: Make None a valid value for methods to set properties; Use new NotProvided singleton, instead, to indicate no changes wanted on that property. Nov 4, 2022
Copy link
Contributor

@maxpumperla maxpumperla left a comment

Choose a reason for hiding this comment

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

Great, looks very clean to me.

Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
@sven1977 sven1977 merged commit 0875480 into ray-project:master Nov 5, 2022
WeichenXu123 pushed a commit to WeichenXu123/ray that referenced this pull request Dec 19, 2022
…properties; Use new `NotProvided` singleton, instead, to indicate no changes wanted on that property. (ray-project#30020)

Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
@sven1977 sven1977 deleted the algo_configs_next_steps_5 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