Created
April 17, 2019 02:31
-
-
Save JoshVarty/5526fbfc4912d91c319732cd746378d1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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