Adds warning message when deterministic training loss stagnates too quickly in partial BNNs #24
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.
Context
Certain deterministic NN hyperparameters may cause overfitting that manifests in the training loss initially decreasing very rapidly and stagnating early. A warning message to the user with suggested solutions would be helpful. Closes #11
Description
After the first epoch, the change in training loss is monitored and any time it drops more than 25% (see figure for justification of choice of 25%), a warning message is printed to the user:
UserWarning: The deterministic training loss is decreasing rapidly - learning and accuracy may be improved by increasing the batch size, adjusting MAP sigma, or modifying the learning rate.
Changes in the codebase
monitor_dnn_loss
inneurobayes/utils/utils.py
that prints warning when loss has decreased by 25% at any epoch.monitor_dnn_loss
inflax_nets/deterministic_nn.py
in the training loop (DeterministicNN.train()
).