-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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] Add simple curriculum learning API and example script. #15740
[RLlib] Add simple curriculum learning API and example script. #15740
Conversation
…iculum_learning_api
…iculum_learning_api
…iculum_learning_api
rllib/agents/trainer_template.py
Outdated
|
||
# Check `env_task_fn` for possible update of the env's task. | ||
if self.config["env_task_fn"] is not None: | ||
assert callable(self.config["env_task_fn"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertions in code can be a bit unwieldy, especially when the users see it.
I would consider writing a special check function that also prints a user friendly message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
parser.add_argument("--stop-iters", type=int, default=50) | ||
parser.add_argument("--stop-timesteps", type=int, default=200000) | ||
parser.add_argument("--stop-reward", type=float, default=10000.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add helpstring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I'll do this for all the other example scripts in a separate PR.
|
||
if args.as_test: | ||
check_learning_achieved(results, args.stop_reward) | ||
ray.shutdown() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need this right?
- in local case, ray will shutdown when process exits
- in remote case, ray will disconnect when process exits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember a time when not calling shutdown
at the end of tests would lead to re-init errors when we run these tests in e.g. the CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider highlighting this in a FAQ
…iculum_learning_api
…iculum_learning_api
This PR adds:
that determines, whether the env should be set to a new task.
Why are these changes needed?
Related issue number
Checks
scripts/format.sh
to lint the changes in this PR.