-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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] Docs API reference pages: rllib/execution
, rllib/evaluation
, rllib/models
, rllib/offline
.
#20538
[RLlib; Docs] Docs API reference pages: rllib/execution
, rllib/evaluation
, rllib/models
, rllib/offline
.
#20538
Conversation
…_api_reference_pages_1
…_api_reference_pages_2 # Conflicts: # doc/source/rllib-package-ref.rst # doc/source/rllib/package_ref/index.rst
…_api_reference_pages_3
…_api_reference_pages_2
…_api_reference_pages_2
…_api_reference_pages_2
…_api_reference_pages_2
…_api_reference_pages_3
rllib/execution
, rllib/evaluation
, rllib/models
, rllib/offline
.rllib/execution
, rllib/evaluation
, rllib/models
, rllib/offline
.
…_api_reference_pages_3
This is ready for review now. @richardliaw |
rllib/execution
, rllib/evaluation
, rllib/models
, rllib/offline
.rllib/execution
, rllib/evaluation
, rllib/models
, rllib/offline
.
…_api_reference_pages_3 # Conflicts: # rllib/models/modelv2.py
|
||
All RLlib neural network models have to be provided as ModelV2 sub-classes. | ||
|
||
.. autoclass:: ray.rllib.models.modelv2.ModelV2 |
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.
btw, this isn't showing up properly:
classray.rllib.models.modelv2.ModelV2(obs_space: , action_space: , num_outputs: int, model_config: dict, name: str, framework: str)[source]
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.
This is an existing problem (not introduced by this PR) with gym.spaces.Space
, it seems. See e.g. my screenshot below. I'm not sure how to fix this. Sphinx replaces the gym.spaces.Space
typehint with some <Mock name='mock.Space' id='...'>
-tag ?? (could be because of the string "Space" having a special meaning for Sphinx?).
.. autoclass:: ray.rllib.models.tf.tf_modelv2.TFModelV2 | ||
:members: | ||
|
||
TorchModelV2 (rllib.env.models.torch.torch_modelv2.TorchModelV2) |
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.
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.
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.
btw I was talking about the sidebar.
Also we have to fix the mock spaces
InputReaders | ||
------------ | ||
|
||
The InputReader API is used by individual :py:class:`~ray.rllib.evaluation.rollout_worker.RolloutWorker`s |
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.
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.
fixed
you can use the built-in :py:class:`~ray.rllib.offline.json_reader.JsonReader` class. | ||
You will have to change the ``input`` config setting from "sampler" (default) to a JSON file name (str), a list of JSON files, | ||
or a path name (str) that contains json files. | ||
Alternatively, you can specify a callable that returns a new :py:class:`~ray.rllib.offline.input_reader.InputReader` |
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.
show an example?
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
"s3://bucket/expert.json": 0.2, | ||
} | ||
|
||
.. autoclass:: ray.rllib.offline.mixed_input.MixedInput |
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 think you are missing a reference to IOContext in the docs.
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.
Yeah, good catch. Will add. ...
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
rllib/policy/sample_batch.py
Outdated
|
||
Returns: | ||
MultiAgentBatch: This very MultiAgentBatch. | ||
This very MultiAgentBatch. |
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.
self?
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
@@ -342,11 +338,11 @@ def columns(self, keys: List[str]) -> List[any]: | |||
return out | |||
|
|||
@PublicAPI | |||
def shuffle(self) -> None: | |||
def shuffle(self) -> "SampleBatch": |
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 cleanup!
.. https://docs.google.com/drawings/d/1OewMLAu6KZNon7zpDfZnTh9qiT6m-3M9wnkqWkQQMRc/edit | ||
.. figure:: ../../images/rllib/rollout_worker_class_overview.svg | ||
:align: left | ||
|
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.
this is too big! can you scale it down?
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
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.
:width: 600
:align: left | ||
|
||
**A typical RLlib WorkerSet setup inside an RLlib Trainer:** Each ``WorkerSet`` contains | ||
exactly one local ``RolloutWorker`` object and n @ray.remote ``RolloutWorkers`` (ray actors). |
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.
exactly one local ``RolloutWorker`` object and n @ray.remote ``RolloutWorkers`` (ray actors). | |
exactly one local ``RolloutWorker`` object and n ray remote ``RolloutWorkers`` (ray actors). |
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
**A typical RLlib WorkerSet setup inside an RLlib Trainer:** Each ``WorkerSet`` contains | ||
exactly one local ``RolloutWorker`` object and n @ray.remote ``RolloutWorkers`` (ray actors). | ||
The workers contain a policy map (with one or more policies), and - in case a simulator | ||
(env) is available - a vectorized BaseEnv (containing m sub-environments) and |
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.
link out to BaseEnv?
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.
Links to all mentioned classes added.
.. autoclass:: ray.rllib.evaluation.rollout_worker.RolloutWorker | ||
:special-members: __init__ |
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.
man I would consider hiding the docstring of the constructor; it's super long and not intended for users i think
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 feel like it's important to keep it for consistency. Users may ask: Why is the init docstring visible in the reference pages for e.g. TorchPolicy, but not for RolloutWorker? Like what's the rule?
…_api_reference_pages_3
Docs API reference pages:
rllib/execution
,rllib/evaluation
,rllib/models
,rllib/offline
.In a follow up PR: rllib/utils (this would then complete the API reference pages overhaul).
Why are these changes needed?
Related issue number
Checks
scripts/format.sh
to lint the changes in this PR.