Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Modified from: https://forums.fast.ai/t/confused-by-output-of-hook-output/29514/4
class StoreHook(HookCallback):
def on_train_begin(self, **kwargs):
super().on_train_begin(**kwargs)
self.hists = []
def hook(self, m, i, o):
return o
def on_batch_end(self, train, **kwargs):
if (train):
self.hists.append(self.hooks.stored[0].cpu().histc(40,0,10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.