ml-agents icon indicating copy to clipboard operation
ml-agents copied to clipboard

Getting stable training results/reusing already trained models

Open ZephyrRaine opened this issue 8 years ago • 6 comments

Hello everyone, thanks for putting such efforts in ml-agents and allowing mere mortals using such advanced AI technologies within a friendly engine 👍

I trained a model from scratch twice, with the same hyperparameters and Unity build, and got these results:

image

I kinda understand how the high entropy correlates with the increase of reward in pink training, and how it also may have done nothing with green, because of random and stuff.

Problem is, this training was an intermediary training towards the goal I want to achieve.
Is there any way I can either make sure it will always train correctly?

If not, is this a bad idea to load the pink saved model to train on a (slightly) different environment? Is there a way for me to change the number of state variables sent by the agents?

Thanks in advance :smile:

ZephyrRaine avatar Dec 14 '17 08:12 ZephyrRaine

Concerning your last question. If you refer to the agent's input (i.e. state space), this cannot be extended or shrunk dynamically. The topology of the neural network cannot be adjusted on the fly. Any modification has to be trained from scratch again.

MarcoMeter avatar Dec 14 '17 09:12 MarcoMeter

Thanks for the quick reply,

I assume feeding constant values instead of variables in order to "silence" them is not a viable solution either...

Guess I'll just tweak hyperparameters and do a lot of trainings in order to get stable training results before complexifying my environment, then.

ZephyrRaine avatar Dec 14 '17 09:12 ZephyrRaine

You could set some inputs bluntly to 0. I assume that would work.

MarcoMeter avatar Dec 14 '17 10:12 MarcoMeter

HI @ZephyrRaine,

As @MarcoMeter mentioned, you could keep placeholder state variables around and simply set them to zero when they are not relevant.

There are a number of reasons why you would get different results from different training runs. If there is some randomness in your environment, this can lead to an agent happening to "find" the right thing to do on one run and simply not discovering it on another. Another source of randomness is in the training process itself. When training begins the neural network's weights are randomly initialized, and these initial parameters can "accidentally" be better than others for your problem, simply by chance. I would recommend doing a few more runs to get a sense of the spread of outcomes.

awjuliani avatar Dec 14 '17 21:12 awjuliani

Hi @ZephyrRaine , 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.

vladimiroster avatar Mar 28 '18 21:03 vladimiroster

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.

lock[bot] avatar Jan 03 '20 14:01 lock[bot]