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.18k stars 4.16k forks source link

Doubt about cumulate the rewards #2762

Closed franvf closed 4 years ago

franvf commented 5 years ago

Hi everyone, I work a little with mlagents for make a game where an agent touch one cube, if touch the correct cube done() and reward +1, but if touch the incorrect cube (there is mor than one cube) I call AgentReset() and reward -1.

Well, the problem it's that my agent "dont learn" he touch the incorrect cube 9/10 times, but when touch the correct cube the final reward is positive, I guess that AgentReset() not only reset the scenario of game, but also reset the rewards, and when touch the bad cube 9 times don't acumulate in the total of reward.

How can I acumulate this total rewards?

THX!

chriselion commented 5 years ago

Hi, This is pretty similar to the setup in the Basic scene (with slightly different reward values): https://github.com/Unity-Technologies/ml-agents/blob/a6e8a64fd80ccd7a8040252695ff6575a88eb8bb/UnitySDK/Assets/ML-Agents/Examples/Basic/Scripts/BasicAgent.cs#L50-L62 So you might want to check that you're doing the same thing there.

You might also want to check the tensorboard results https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Using-Tensorboard.md to track that the reward gradually increases over time.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had activity in the last 14 days. It will be closed in the next 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically closed because it has not had activity in the last 28 days. If this issue is still valid, please ping a maintainer. Thank you for your contributions.

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.