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
import numpy as np | |
from keras import backend as K | |
from keras.callbacks import Callback | |
class ReinitWeightOnFalseStart(Callback): | |
"""Reinitializes model weights when model is not improving right after beginning. | |
Stops training after number of trials. | |
If model starts improving then behave like |