Convert kernel_mask into a constant tensor#74
Open
Larst0 wants to merge 1 commit intoMathiasGruber:masterfrom
Open
Convert kernel_mask into a constant tensor#74Larst0 wants to merge 1 commit intoMathiasGruber:masterfrom
Larst0 wants to merge 1 commit intoMathiasGruber:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When I use the given implementation for training, I always get NaN values at the output. Sometimes this happens after a few training steps and sometimes after a few epochs (depending on the training data used).
While debugging, I noticed that the
kernel_maskwas updated. I think this is becauseK.ones(shape=...)returns a trainable variable if all entries in the passed shape are >0. In the original PyTorch implementation thekernel_maskis initialized usingweight_maskUpdater = torch.ones(...), which by default creates a non-trainable tensor (sincerequires_grad=False).After replacing
K.ones(...)withK.constant(...)the NaN values no longer occur.