Created
March 29, 2019 05:19
-
-
Save edwardeasling/eb7848aa113523c25a0cc9631d4741e7 to your computer and use it in GitHub Desktop.
BP1 - 02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BatchCounter(Callback): | |
def begin_epoch(self, epoch): | |
self.epoch=epoch | |
self.batch_counter = 1 | |
return True | |
def after_step(self): | |
self.batch_counter += 1 | |
if self.batch_counter % 200 == 0: print(f'Batch {self.batch_counter} completed') | |
return True | |
class TimeCheck(Callback): | |
def begin_fit(self, learn): | |
self.learn = learn | |
self.epoch_counter = 1 | |
return True | |
def begin_epoch(self, epoch): | |
self.epoch=epoch | |
print(f'Epoch {self.epoch_counter} started at {time.strftime("%H:%M:%S", time.gmtime())}') | |
self.epoch_counter += 1 | |
return True | |
class PrintLoss(Callback): | |
def after_epoch(self): | |
print(f'Loss: {self.loss}') | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment