Balint-H / modular-agents

Extensions to the ML-Agents toolkit, focusing on humanoid control in Unity
Apache License 2.0
18 stars 2 forks source link

Seeking Advice on Incorporating GAIL with Modular-Agent #2

Open HYS-5 opened 1 month ago

HYS-5 commented 1 month ago

Hello, thank you very much for your contribution. The Modular-Agent has been incredibly useful and powerful for completing RL/IL training in the Unity.

I have been using the Modular-Agent for an interactive task where the agent reaches its hand to the target while imitating the demo's behavior. I am considering incorporating GAIL into the training process to train the agent with a demo dataset, where the demonstrator completes the tasks with different poses to fit the changing environment.

Do you have any advice on using GAIL in this context? Additionally, is the GAIL function in the ML-Agent toolkit useful in this case? Or would it be better to wrap it as a GYM environment?

Balint-H commented 1 month ago

Hello, thanks for the kind words. The GAIL implementation is pretty solid in ML-Agents and should be the first thing you try if you are interested in it and are already using ML-Agents. There some limitations, such as having your discriminator be restricted to the same observations as your agent, but for many cases the features that exist will be sufficient.

Take a look at the DemonstrationRecorder component: https://github.com/Unity-Technologies/ml-agents/blob/release_2_verified_docs/docs//Learning-Environment-Design-Agents.md#recording-demonstrations

After recording demonstrations you just need to update your config file to point to them, and enable the GAIL reward.

Let me know if you have specific questions as you experiment!