from keras.callbacks import Callback, ModelCheckpoint, CSVLogger


def get_callbacks(name):
    return [
        CSVLogger(name + '.log'),
        ModelCheckpoint(filepath='/tmp/' + name +
                        '_epoch{epoch:02d}_{val_binary_accuracy:.3f}.h5')
    ]

from keras.callbacks import Callback, ModelCheckpoint, CSVLogger


def get_callbacks(name):
    log_path = '{}.log'.format(name)
    weight_path = '/tmp/{}_{epoch:02d}_{val_binary_accuracy:.3f}.h5'.format(name)

    return [
        CSVLogger(log_path),
        ModelCheckpoint(filepath=weight_path)
    ]

Update at 2017-07-14 21-28-58