joint_optimisation.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:ActiveBoundary 作者: MiriamHu 项目源码 文件源码
def on_epoch_end(self, epoch, logs={}):
        current = self.monitor(self.previous_weights, self.model.get_weights())
        self.previous_weights = self.model.get_weights()
        if current is None:
            warnings.warn('Early stopping requires %s available!' %
                          (self.monitor), RuntimeWarning)

        if np.less(current, self.threshold_value):
            if current == 0:
                self.model.stop_training = True
                if self.verbose > 0:
                    print('Epoch %05d: early stopping: ratio weights = 0' % (epoch))
            elif self.wait >= self.patience:
                if self.verbose > 0:
                    print('Epoch %05d: early stopping: ratio weights below %.4f' % (epoch, self.threshold_value))
                self.model.stop_training = True
            self.wait += 1
        else:
            self.wait = 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号