Comments (1)
We can document this better.
In general the idea is that your composite spec has the shape of the batch size (it can be empty) and the leaves have that size plus their feature size.
Examples:
Your env has a single agent, no batch-size.
full_composite_spec
has shape []
Its leaf has the shape of the feature (eg [3, 64, 64] if you have an image of 64 pixels width/height).
If you have a batched env with 2 agents it could have a batch size [2]. This is what will happen with a ParallelEnv for instance. All its specs will have a leading shape of [2, *]
, meaning that your full_composite_spec
will have a shape of [2]
and the leaf will have shape [2, 3, 64, 64]
.
Final case: your env has no batch size but it simulates several groups of agents (MARL setting). A first group named agents1 has 3 identical members and a second, agents2 has 4. The first outputs images from its steps and the second outputs a state vector of shape 5.
Here's how to build it:
full_observation_spec = CompositeSpec(
agents1=CompositeSpec(pixels=SomeSpec(3, 3, 64, 64), shape=[3]),
agents2=CompositeSpec(state=SomeOtherSpec(4, 5), shape=[4]),
shape=[])
I hope that clarifies things a tiny bit
from rl.
Related Issues (20)
- [BUG] Incorrect default value for `normalize_advantage`.
- [Feature Request] Return depth from RoboHiveEnv
- [BUG?] How to handle next with custom environment and check_env_specs() HOT 2
- [QUESTION] How to reset only certain nested parts of a key with TensorDictPrimer? HOT 3
- [Feature Request] DDPG with discrete actions HOT 4
- Achieving Episode-Based Sampling with SliceSampler in TorchRL HOT 2
- [BUG] Documentation Error: `MaskedEnv` Example Under ActionMask Transform Throws TypeError HOT 1
- [BUG] Buffer crashes on `extend` HOT 4
- Tutorial of implementing learning using torchrl in a PettingZoo environment HOT 2
- [BUG] default snapshot backend doesn't match docs HOT 1
- [Feature Request] Move `sota-check` inside `sota-implementations` HOT 8
- Errors reported in this section of USING PRETRAINED MODELS HOT 1
- [Feature Request] Handling of unserializable policies HOT 8
- In the Doc “RECURRENT DQN: TRAINING RECURRENT POLICIES” HOT 1
- [BUG] `DTypeCastTransform` changes arbitrary keys HOT 5
- [BUG] Transpose bug in `reward2go` when the last dim is not 1
- [BUG] VSCode automcompletions don't work HOT 2
- [BUG] `ConvNet` memory issues HOT 5
- [Bug/Question] Target workflow for LSTM Modules?
- [Docs] - Clarify multi collector HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rl.