Created by: qingqing01
- Add ProgressBar
- Add callback
- Add fit
callback example:
class ModelCheckpoint(Callback):
def __init__(self, save_freq=1, save_file='output'):
self.save_freq = save_freq
self.save_file = save_file
def on_epoch_begin(self, epoch=None, logs=None):
self.epoch = epoch
def on_epoch_end(self, step, logs=None):
if self.model and self.epoch % self.save_freq == 0:
path = '{}/{}'.format(self.save_file, step)
print('save checkpoint at {}'.format(path))
self.model.save(path)
def on_train_end(self, logs=None):
if self.model:
path = '{}/final'.format(self.save_file)
print('save checkpoint at {}'.format(path))
self.model.save(path)