diff --git a/examples/task_conditional_language_model.py b/examples/task_conditional_language_model.py index 5729748e..a72ce2ed 100644 --- a/examples/task_conditional_language_model.py +++ b/examples/task_conditional_language_model.py @@ -143,7 +143,7 @@ def just_show(): print(random_sentiment.generate(0, 5, 5), '\n') -class Evaluate(keras.callbacks.Callback): +class Evaluator(keras.callbacks.Callback): def __init__(self): self.lowest = 1e10 @@ -158,7 +158,7 @@ def on_epoch_end(self, epoch, logs=None): if __name__ == '__main__': - evaluator = Evaluate() + evaluator = Evaluator() train_generator = data_generator(data, batch_size) model.fit_generator( diff --git a/examples/task_image_caption.py b/examples/task_image_caption.py index b3e3a9b7..09fdd66e 100644 --- a/examples/task_image_caption.py +++ b/examples/task_image_caption.py @@ -194,7 +194,7 @@ def just_show(): print() -class Evaluate(keras.callbacks.Callback): +class Evaluator(keras.callbacks.Callback): def __init__(self): self.lowest = 1e10 @@ -209,7 +209,7 @@ def on_epoch_end(self, epoch, logs=None): if __name__ == '__main__': - evaluator = Evaluate() + evaluator = Evaluator() train_generator = data_generator(train_data, batch_size) model.fit_generator( diff --git a/examples/task_language_model.py b/examples/task_language_model.py index f43a655c..a2e2e803 100644 --- a/examples/task_language_model.py +++ b/examples/task_language_model.py @@ -147,7 +147,7 @@ def just_show(): print(u'结果: %s\n' % ('\n'.join(t))) -class Evaluate(keras.callbacks.Callback): +class Evaluator(keras.callbacks.Callback): def __init__(self): self.lowest = 1e10 @@ -162,7 +162,7 @@ def on_epoch_end(self, epoch, logs=None): if __name__ == '__main__': - evaluator = Evaluate() + evaluator = Evaluator() train_generator = data_generator(data, batch_size) model.fit_generator( diff --git a/examples/task_reading_comprehension_by_mlm.py b/examples/task_reading_comprehension_by_mlm.py index 3d410a95..5080f941 100644 --- a/examples/task_reading_comprehension_by_mlm.py +++ b/examples/task_reading_comprehension_by_mlm.py @@ -199,7 +199,7 @@ def predict_to_file(data, filename): f.flush() -class Evaluate(keras.callbacks.Callback): +class Evaluator(keras.callbacks.Callback): def __init__(self): self.lowest = 1e10 @@ -212,7 +212,7 @@ def on_epoch_end(self, epoch, logs=None): if __name__ == '__main__': - evaluator = Evaluate() + evaluator = Evaluator() train_generator = data_generator(train_data, batch_size) model.fit_generator( diff --git a/examples/task_reading_comprehension_by_seq2seq.py b/examples/task_reading_comprehension_by_seq2seq.py index c38097dd..a2bb1e54 100644 --- a/examples/task_reading_comprehension_by_seq2seq.py +++ b/examples/task_reading_comprehension_by_seq2seq.py @@ -229,7 +229,7 @@ def predict_to_file(data, filename, topk=1): f.flush() -class Evaluate(keras.callbacks.Callback): +class Evaluator(keras.callbacks.Callback): def __init__(self): self.lowest = 1e10 @@ -242,7 +242,7 @@ def on_epoch_end(self, epoch, logs=None): if __name__ == '__main__': - evaluator = Evaluate() + evaluator = Evaluator() train_generator = data_generator(train_data, batch_size) model.fit_generator( diff --git a/examples/task_seq2seq_autotitle.py b/examples/task_seq2seq_autotitle.py index a5beb713..9b44471b 100644 --- a/examples/task_seq2seq_autotitle.py +++ b/examples/task_seq2seq_autotitle.py @@ -116,7 +116,7 @@ def just_show(): print() -class Evaluate(keras.callbacks.Callback): +class Evaluator(keras.callbacks.Callback): def __init__(self): self.lowest = 1e10 @@ -131,7 +131,7 @@ def on_epoch_end(self, epoch, logs=None): if __name__ == '__main__': - evaluator = Evaluate() + evaluator = Evaluator() train_generator = data_generator(txts, batch_size) model.fit_generator( diff --git a/examples/task_seq2seq_autotitle_csl.py b/examples/task_seq2seq_autotitle_csl.py index 51a35ec0..1942e673 100644 --- a/examples/task_seq2seq_autotitle_csl.py +++ b/examples/task_seq2seq_autotitle_csl.py @@ -118,7 +118,7 @@ def generate(self, text, topk=1): autotitle = AutoTitle(start_id=None, end_id=tokenizer._token_end_id, maxlen=32) -class Evaluate(keras.callbacks.Callback): +class Evaluator(keras.callbacks.Callback): def __init__(self): self.rouge = Rouge() self.smooth = SmoothingFunction().method1 @@ -163,7 +163,7 @@ def evaluate(self, data, topk=1): if __name__ == '__main__': - evaluator = Evaluate() + evaluator = Evaluator() train_generator = data_generator(train_data, batch_size) model.fit_generator( diff --git a/examples/task_sequence_labeling_cws_crf.py b/examples/task_sequence_labeling_cws_crf.py index a9c750ea..183b623d 100644 --- a/examples/task_sequence_labeling_cws_crf.py +++ b/examples/task_sequence_labeling_cws_crf.py @@ -184,7 +184,7 @@ def predict_to_file(in_file, out_file): fw.close() -class Evaluate(keras.callbacks.Callback): +class Evaluator(keras.callbacks.Callback): def __init__(self): self.best_val_acc = 0 @@ -202,7 +202,7 @@ def on_epoch_end(self, epoch, logs=None): if __name__ == '__main__': - evaluator = Evaluate() + evaluator = Evaluator() train_generator = data_generator(train_data, batch_size) model.fit_generator( diff --git a/examples/task_sequence_labeling_ner_crf.py b/examples/task_sequence_labeling_ner_crf.py index 8d266c50..56d5d96d 100644 --- a/examples/task_sequence_labeling_ner_crf.py +++ b/examples/task_sequence_labeling_ner_crf.py @@ -181,7 +181,7 @@ def evaluate(data): return f1, precision, recall -class Evaluate(keras.callbacks.Callback): +class Evaluator(keras.callbacks.Callback): def __init__(self): self.best_val_f1 = 0 @@ -207,7 +207,7 @@ def on_epoch_end(self, epoch, logs=None): if __name__ == '__main__': - evaluator = Evaluate() + evaluator = Evaluator() train_generator = data_generator(train_data, batch_size) model.fit_generator(