Unity-Technologies / ml-agents

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.
https://unity.com/products/machine-learning-agents
Other
17.22k stars 4.16k forks source link

Doubt about brains and agents. #2013

Closed franvf closed 5 years ago

franvf commented 5 years ago

Hi, i don't know if the same agent can have two brains. The problem is that i need one brain continuous for moving and one brain discrete for shooting or not shooting. How can i don? THX.

ervteng commented 5 years ago

Without some re-writing, the Agent class only supports one brain. You can have multiple Agents on one GameObject, however, and do multiple brains that way. You can also have a single continuous brain with thresholds on some of the actions to make them discrete (this is probably the easiest, e.g. if channel 0 is below 0.5 then don't shoot, else shoot).

MarcoMeter commented 5 years ago

You can check my repository for setting up multiagents, using a threshold or using bucketed discrete actions to work with both action space kinds.

https://github.com/MarcoMeter/Action-Space-Compositions-in-Deep-Reinforcement-Learning

roboserg commented 5 years ago

just clamp continuous output between 0 and 1. And you have your discreet output.

harperj commented 5 years ago

Thanks for reaching out to us. Hopefully you were able to resolve your issue. We are closing this due to inactivity, but if you need additional assistance, feel free to reopen the issue.

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.