def __init__(self, monitor='val_loss', cut_ratio=0.5, patience=2, scheduled_start_epoch=1, scheduled_cut_ratio=1.):
"""
Args:
monitor: quantity to be monitored.
cut_ratio: cut the learning rate by this percent.
patience: number of epochs with no improvement
after which training will be stopped.
scheduled_start_epoch: from which epoch to do scheduled learning rate discount
scheduled_cut_ratio: learning rate discount ratio.
"""
super(Callback, self).__init__()
self.monitor = monitor
self.patience = patience
self.best = np.Inf
self.wait = 0
self.cut_ratio = cut_ratio
self.monitor_decrease = False
self.scheduled_start_epoch = scheduled_start_epoch
self.scheduled_cut_ratio = scheduled_cut_ratio
评论列表
文章目录