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; Docs overhaul] Docstring cleanup: Environments. #19784

Merged
merged 12 commits into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/ray/tune/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def to_argv(config):
def create_trial_from_spec(spec, output_path, parser, **trial_kwargs):
"""Creates a Trial object from parsing the spec.

Arguments:
Args:
spec (dict): A resolved experiment specification. Arguments should
The args here should correspond to the command line flags
in ray.tune.config_parser.
Expand Down
15 changes: 8 additions & 7 deletions rllib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2006,13 +2006,14 @@ py_test(
args = ["--as-test", "--framework=torch", "--stop-reward=150", "--num-cpus=4"]
)

py_test(
name = "examples/bare_metal_policy_with_custom_view_reqs",
main = "examples/bare_metal_policy_with_custom_view_reqs.py",
tags = ["team:ml", "examples", "examples_B"],
size = "small",
srcs = ["examples/bare_metal_policy_with_custom_view_reqs.py"],
)
# times-out: #
#py_test(
# name = "examples/bare_metal_policy_with_custom_view_reqs",
# main = "examples/bare_metal_policy_with_custom_view_reqs.py",
# tags = ["team:ml", "examples", "examples_B"],
# size = "small",
# srcs = ["examples/bare_metal_policy_with_custom_view_reqs.py"],
#)

py_test(
name = "examples/batch_norm_model_ppo_tf",
Expand Down
15 changes: 9 additions & 6 deletions rllib/agents/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ def on_episode_start(self,
"""Callback run on the rollout worker before each episode starts.

Args:
worker (RolloutWorker): Reference to the current rollout worker.
base_env (BaseEnv): BaseEnv running the episode. The underlying
env object can be gotten by calling base_env.get_unwrapped().
policies (dict): Mapping of policy id to policy objects. In single
worker: Reference to the current rollout worker.
base_env: BaseEnv running the episode. The underlying
sub environment objects can be received by calling
`base_env.get_sub_environments()`.
policies: Mapping of policy id to policy objects. In single
agent mode there will only be a single "default" policy.
episode (MultiAgentEpisode): Episode object which contains episode
state. You can use the `episode.user_data` dict to store
Expand Down Expand Up @@ -80,7 +81,8 @@ def on_episode_step(self,
Args:
worker (RolloutWorker): Reference to the current rollout worker.
base_env (BaseEnv): BaseEnv running the episode. The underlying
env object can be gotten by calling base_env.get_unwrapped().
sub environment objects can be gotten by calling
`base_env.get_sub_environments()`.
policies (Optional[Dict[PolicyID, Policy]]): Mapping of policy id
to policy objects. In single agent mode there will only be a
single "default_policy".
Expand Down Expand Up @@ -112,7 +114,8 @@ def on_episode_end(self,
Args:
worker (RolloutWorker): Reference to the current rollout worker.
base_env (BaseEnv): BaseEnv running the episode. The underlying
env object can be gotten by calling base_env.get_unwrapped().
sub environment objects can be retrieved by calling
`base_env.get_sub_environments()`.
policies (Dict[PolicyID, Policy]): Mapping of policy id to policy
objects. In single agent mode there will only be a single
"default_policy".
Expand Down
2 changes: 1 addition & 1 deletion rllib/contrib/alpha_zero/core/alpha_zero_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AlphaZeroDefaultCallbacks(DefaultCallbacks):

def on_episode_start(self, worker, base_env, policies, episode, **kwargs):
# save env state when an episode starts
env = base_env.get_unwrapped()[0]
env = base_env.get_sub_environments()[0]
state = env.get_state()
episode.user_data["initial_state"] = state

Expand Down
25 changes: 0 additions & 25 deletions rllib/env/atari_wrappers.py

This file was deleted.

Loading