You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TensorDict abstracts away the input / output signatures of the modules, env, collectors, replay buffers and losses of the library, allowing its primitives
164
+
165
+
Using this, TorchRL abstracts away the input / output signatures of the modules, env,
166
+
collectors, replay buffers and losses of the library, allowing all primitives
75
167
to be easily recycled across settings.
76
-
Here's another example of an off-policy training loop in TorchRL (assuming that a data collector, a replay buffer, a loss and an optimizer have been instantiated):
77
168
78
169
<details>
79
170
<summary>Code</summary>
80
171
172
+
Here's another example of an off-policy training loop in TorchRL (assuming
173
+
that a data collector, a replay buffer, a loss and an optimizer have been instantiated):
174
+
81
175
```diff
82
176
- for i, (obs, next_obs, action, hidden_state, reward, done) in enumerate(collector):
83
177
+ for i, tensordict in enumerate(collector):
@@ -92,7 +186,7 @@ Here's another example of an off-policy training loop in TorchRL (assuming that
92
186
optim.step()
93
187
optim.zero_grad()
94
188
```
95
-
Again, this training loop can be re-used across algorithms as it makes a minimal number of assumptions about the structure of the data.
189
+
This training loop can be re-used across algorithms as it makes a minimal number of assumptions about the structure of the data.
96
190
</details>
97
191
98
192
TensorDict supports multiple tensor operations on its device and shape
@@ -120,9 +214,9 @@ Here's another example of an off-policy training loop in TorchRL (assuming that
120
214
```
121
215
</details>
122
216
123
-
Check our TorchRL-specific [TensorDict tutorial](https://pytorch.org/rl/tutorials/tensordict_tutorial.html) for more information.
124
-
125
-
The associated [`SafeModule` class](torchrl/modules/tensordict_module/common.py) which is [functorch](https://github.com/pytorch/functorch)-compatible!
217
+
TensorDict comes with a dedicated [`tensordict.nn`](https://pytorch-labs.github.io/tensordict/reference/nn.html)
218
+
module that contains everything you might need to write your model with it.
219
+
And it is `functorch` and `torch.compile`compatible!
126
220
127
221
<details>
128
222
<summary>Code</summary>
@@ -138,27 +232,27 @@ The associated [`SafeModule` class](torchrl/modules/tensordict_module/common.py)
138
232
+ out = tensordict["out"]
139
233
```
140
234
141
-
The `SafeSequential` class allows to branch sequences of `nn.Module` instances in a highly modular way.
235
+
The `TensorDictSequential` class allows to branch sequences of `nn.Module` instances in a highly modular way.
142
236
For instance, here is an implementation of a transformer using the encoder and decoder blocks:
Depending on the use of functorch that you want to make, you may want to install the latest (nightly) pytorch release or the latest stable version of pytorch.
392
-
See [here](https://pytorch.org/get-started/locally/) for a more detailed list of commands, including `pip3` or windows/OSX compatible installation commands:
`functorch` is included in the nightly PyTorch package, so no need to install it separately.
419
-
420
-
For M1 Mac users, if the above commands do not work, you can build torch from source by following [this guide](https://github.com/pytorch/pytorch#from-source).
492
+
Depending on the use of functorch that you want to make, you may want to
493
+
install the latest (nightly) PyTorch release or the latest stable version of PyTorch.
494
+
See [here](https://pytorch.org/get-started/locally/) for a detailed list of commands,
495
+
including `pip3` or windows/OSX compatible installation commands.
421
496
422
497
**Torchrl**
423
498
@@ -528,22 +603,25 @@ OS: macOS **** (x86_64)
528
603
Versioning issues can cause error message of the type ```undefined symbol``` and such. For these, refer to the [versioning issues document](knowledge_base/VERSIONING_ISSUES.md) for a complete explanation and proposed workarounds.
529
604
530
605
531
-
## Running examples
532
-
Examples are coded in a very similar way but the configuration may change from one algorithm to another (e.g. async/sync data collection, hyperparameters, ratio of model updates / frame etc.)
533
-
534
-
Check the [examples markdown](examples/EXAMPLES.md) directory for more details about handling the various configuration settings.
535
-
606
+
## Asking a question
536
607
537
-
## Upcoming features
608
+
If you spot a bug in the library, please raise an issue in this repo.
538
609
539
-
In the near future, we plan to:
540
-
- provide tutorials on how to design new actors or environment wrappers;
541
-
- implement IMPALA (as a distributed RL example) and Meta-RL algorithms;
542
-
- improve the tests, documentation and nomenclature.
610
+
If you have a more generic question regarding RL in PyTorch, post it on
611
+
the [PyTorch forum](https://discuss.pytorch.org/c/reinforcement-learning/6).
543
612
544
-
We welcome any contribution, should you want to contribute to these new features
545
-
or any other, lister or not, in the issues section of this repository.
613
+
## Citation
546
614
615
+
If you're using TorchRL, please refer to this BibTeX entry to cite this work:
616
+
```
617
+
@software{TorchRL,
618
+
author = {Moens, Vincent},
619
+
title = {{TorchRL: an open-source Reinforcement Learning (RL) library for PyTorch}},
620
+
url = {https://github.com/pytorch/rl},
621
+
version = {0.1.0},
622
+
year = {2023}
623
+
}
624
+
```
547
625
548
626
## Contributing
549
627
@@ -556,9 +634,9 @@ Contributors are recommended to install [pre-commit hooks](https://pre-commit.co
556
634
557
635
## Disclaimer
558
636
559
-
This library is not officially released yet and is subject to change.
560
-
561
-
The features are available before an official release so that users and collaborators can get early access and provide feedback. No guarantee of stability, robustness or backward compatibility is provided.
637
+
This library is released as a PyTorch beta feature.
638
+
BC-breaking changes are likely to happen but they will be introduced with a deprecation
639
+
warranty after a few release cycles.
562
640
563
641
# License
564
642
TorchRL is licensed under the MIT License. See [LICENSE](LICENSE) for details.
0 commit comments