facebookresearch / BenchMARL

A collection of MARL benchmarks based on TorchRL
https://benchmarl.readthedocs.io/
MIT License
288 stars 42 forks source link

[BugFix, Feature] GNN `position_key` and `velocity_key` not in `observation_spec` #125

Closed matteobettini closed 2 months ago

matteobettini commented 2 months ago

fixes #124

Previously

GNN position_key and velocity_key needed to be part of the observation_spec

This meant that they could not be used in a squence model where the GNN is not first as they would be accidentally consumed by other models

Now

Now these keys don't need to be in observation_spec.

In fact, it is better that they are not to solve the problem above.

They can be put in the info.

We still support the case of them being in observation_spec for bc-compatibility

The catch

Since now we do not know the shape of these keys (as they are not in the spec) we need to provide it in the model configuration. This is because GNNs need to know the shape of edge_features at init time.