keunwoochoi / keras_callbacks_example

Keras callback example
56 stars 17 forks source link

Why do I get the results are different from you, and I can not understand? #2

Open zhouhao-learning opened 7 years ago

zhouhao-learning commented 7 years ago

I want to get all the acc, but the result is this, can you tell me which troops? 2017-04-08 16-59-04

This is my code

import keras
from mock.mock import self
from sklearn.metrics import roc_auc_score

class Histories(keras.callbacks.Callback):
    def on_train_begin(self, logs={}):
        self.acc = []
        return

    def on_train_end(self, logs={}):
        return

    def on_epoch_begin(self, epoch, logs={}):
        return

    def on_epoch_end(self, epoch, logs={}):

        return

    def on_batch_begin(self, batch, logs={}):
        return

    def on_batch_end(self, batch, logs={}):
        self.acc.append(logs.get('acc'))
        return
keunwoochoi commented 7 years ago

Mine was on keras 1.x, probably that's the reason?