Skip to content

NaN problem fix#3

Open
aregic wants to merge 1 commit into
camigord:masterfrom
aregic:NaN_fix
Open

NaN problem fix#3
aregic wants to merge 1 commit into
camigord:masterfrom
aregic:NaN_fix

Conversation

@aregic
Copy link
Copy Markdown

@aregic aregic commented Aug 14, 2017

The problem was the sharpening function in memory.py which had a division with no guarantee that the denominator is not zero.

I have tested it by starting to learn from a checkpoint which was very close to outputting NaNs (it always happened in a couple of hundred iterations) and with this fix it worked fine for 300k more iterations.

Of course the result of the loss function changed a little at first, so this is not a 100% guarantee, but I'm confident this patch removes one possibility for the NaN problem.

The problem was the sharpening function in memory.py which had a division with no guarantee that the denominator is not zero.

I have tested it by starting to learn from a checkpoint which was very close to outputting NaNs (it always happened in a couple of hundred iterations) and with this fix it worked fine for 300k more iterations.

Of course the result of the loss function changed a little at first, so this is not a 100% guarantee, but I'm confident this patch removes one possibility for the NaN problem.
Copy link
Copy Markdown
Owner

@camigord camigord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the fix and sorry for the huge delay... I would like to approve the pull request, but I would like to keep the current README given that the problem may still not be solved. Could you send a new pull request with only the changes in memory.py?

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

Successfully merging this pull request may close these issues.

2 participants