question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Network gives NaN after 30k trainings?

See original GitHub issue

Motivating the network

What is wrong?

I am working on a neural network, which implements reinforcement learning to play tetris. At one point during the training process with the learning rate set to 0.3 the network after 30k trainings gives the result 0 and then goes to NaN. Tried to figure out why Nan, but can’t seem to.

Where does it happen?

During the training process, when running a network with:

50 - input neurons
700 - first hidden
200 - second hidden
1 - output

How do we replicate the issue?

Just run the network with the [700, 200] neurons and learning rate of 0.3.

How important is this (1-5)?

2

Expected behavior (i.e. solution)

It should give at least 0 if nothing else

Other Comments

The entire code is here https://github.com/PetarIvancevic/node-neural-tetris . The code is run with:

node index.js -g NUM_GAMES -n NAME_OF_FOLDER

Ou yeah…the network LEARNS how to play…but it gives NaN xD…just weird. The blocks are fixated to always be OBlocks for testing and comparison.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mubaidrcommented, Jul 27, 2018

Sure, will do some testing.

1reaction
PetarIvanceviccommented, Jul 27, 2018

You should “play” around 30k games, then it breaks. My latest guess is that it might be somehow node related, but I have no idea how 😕

Read more comments on GitHub >

github_iconTop Results From Across the Web

NaN loss when training regression network - Stack Overflow
I was running into my loss function suddenly returning a nan after it go so far into the training process. I checked the...
Read more >
Common Causes of NANs During Training
Common Causes of NANs During Training · Gradient blow up · Bad learning rate policy and params · Faulty Loss function · Faulty...
Read more >
Cost function turning into nan after a certain number of iterations
Well, if you get NaN values in your cost function, it means that the input is outside of the function domain. E.g. the...
Read more >
SVI: nans from guide when Trace_ELBO drops
During training, I'm getting nans when the loss drops. lr=1e-6 svi ... The neural net returns NaNs in every element of the tensor....
Read more >
PYTHON : NaN loss when training regression network
PYTHON : NaN loss when training regression network [ Gift : Animated Search Engine : https://www.hows.tech/p/recommended.html ] PYTHON : NaN ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found