Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NaN #5

Open
farice opened this issue Dec 20, 2017 · 5 comments
Open

NaN #5

farice opened this issue Dec 20, 2017 · 5 comments

Comments

@farice
Copy link

farice commented Dec 20, 2017

After a sufficient number of steps, I'll get an array full of nans when running your sample script. Have you seen this before?

Action: [array([ nan,  nan,  nan,  nan,  nan]), array([ nan,  nan,  nan,  nan,  nan]), array([ nan,  nan,  nan,  nan,  nan]), array([ nan,  nan,  nan,  nan,  nan])] 
@agakshat
Copy link
Owner

Yes, that's a list of the actions going to each agent, which I printed out for debugging purposes. I have seen the actions all go to NaN values, and haven't yet found a reason (or solution) to that. If you do, please update this thread!

@farice
Copy link
Author

farice commented Dec 20, 2017

I determined that something is going wrong with the numerical computation of relu.

Change all instances of relu to tanh or sigmoid as hidden layer neurons and you won’t see that error any longer.

@emanuelepesce
Copy link

Did you try to use the relu with the batch normalization?

It looks that now NaN have disappeared.

@agakshat
Copy link
Owner

@farice Changing relu to tanh does not improve the situation for me, rewards still go to NaN after a while. Did you make any other changes as well?

@emanuelepesce
Copy link

If I change relu to tanh, the training has been running for almost 3 days and NaN have not appeared (neither in the actions or rewards).

Looks like it also works when I use the relu, but it needs adding the batch normalization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants