skrl icon indicating copy to clipboard operation
skrl copied to clipboard

Is there examples about using multiple Inputs observations?

Open akux2021 opened this issue 3 years ago • 1 comments

Hi @Toni-SM ,

Are there examples of using multiple Inputs observations?

For example, one input is an image and another input is a vector.

Something similar in stablebaseline3 here https://stable-baselines3.readthedocs.io/en/master/guide/custom_policy.html#multiple-inputs-and-dictionary-observations

akux2021 avatar Oct 23 '22 00:10 akux2021

Hi @akux2021

Yes, skrl allows using complex spaces like gym.spaces.Dict.

The observations are automatically converted to flatten tensors to store them in memory. The flattened tensor is forward to the models .compute() method. Models have a method to convert the flattened tensor to the original spaces: Model.tensor_to_space.

You can see the method documentation example code for more details. Also, you can see its usage in the DeepMind's reach_site_vision example. Specifically, this feature is highlighted and commented in this example

Toni-SM avatar Oct 23 '22 10:10 Toni-SM

Thanks, it`s very helpful!

akux2021 avatar Oct 24 '22 13:10 akux2021