Skip to content

Instantly share code, notes, and snippets.

@DavidGeorge528
Created May 9, 2017 14:50
Show Gist options
  • Save DavidGeorge528/1b456de01bc1be2bcb4b70632cf91f75 to your computer and use it in GitHub Desktop.
Save DavidGeorge528/1b456de01bc1be2bcb4b70632cf91f75 to your computer and use it in GitHub Desktop.
class Histories(Callback):
def on_train_begin(self, logs={}):
self.epoch = []
self.history = {}
def on_train_end(self, logs={}):
return
def on_epoch_begin(self, epoch, logs={}):
self.batch = []
self.history["Batch"] = {}
def on_epoch_end(self, epoch, logs={}):
self.epoch.append(epoch)
for k, v in logs.items():
self.history.setdefault(k, []).append(v)
def on_batch_begin(self, batch, logs={}):
return
def on_batch_end(self, batch, logs={}):
self.batch.append(epoch)
for k, v in logs.items():
self.history["Batches"].setdefault(k, []).append(v)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment