-
Notifications
You must be signed in to change notification settings - Fork 53
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
[FAQ] GNNs frequent questions #157
Comments
The gnn model can take 2 special arguments: positions and velocities (which it uses to build edge features). If you do not pass them, then all of the agent observations will be node features and there will be no edge features. The topology can be: full, empty or from_pos. The default is “full” as in a fully connected graph. This can be applied to any environmnent |
BenchMARL has 4 ways a model can be used https://benchmarl.readthedocs.io/en/latest/concepts/components.html#models
BenchMARL will automatically construct the GNN in the right way for the different uses based on your algorithm and env (e.g. avaiability of a global state). If it can't, it will tell you |
The algorithms and models are completely decoupled in benchmarl, so each component will always be agnostic of each other. This is the core tenet of the library.
|
Teams (groups in benchmarl) are separate (different loss class, buffer, models, etc). All the gnn stuff , parameter sharing, and topology is within a group. |
You are right. If you want to use the position key and the velocity key in the GNN model, your observations need to be a dictionary and those need to be keys in it. In vmas you need an def observation(self, agent: Agent):
return {"obs": you_other_obs, "pos": agent.state.pos, "vel": agent.state.vel} and then set
You are right that normal vmas scnearios do not do this so you need to either (1) edit their observation function or (2) make your own
normal shape of an observations just with the last dimension being equal to in general, don't overthink it, just return it as any other obs in your simulator .
original positions (and velocities), benchmarl will automatically compute relatives
int, just the number of features of your position (1 in 1D, 2 in 2D, 3 in 3D, and so on) (configurations in benchmarl are hard-typed, so you can always check the type of what you need to pass in the respective dataclass, e.g., https://benchmarl.readthedocs.io/en/latest/generated/benchmarl.models.GnnConfig.html#benchmarl.models.GnnConfig) EDIT: Here is an example of how to do it in VMAS #161 |
Here is a collection of frequent questions about GNN models in BenchMARL
Here #161 is an example of using a GNN with a dynamic topology in VMAS
The text was updated successfully, but these errors were encountered: