from fastai.gen_doc.nbdoc import * from fastai.callbacks.hooks import * from fastai.train import * from fastai.vision import * show_doc(ActivationStats) path = untar_data(URLs.MNIST_SAMPLE) data = ImageDataBunch.from_folder(path) #learn = create_cnn(data, models.resnet18, callback_fns=ActivationStats) learn = Learner(data, simple_cnn((3,16,16,2)), callback_fns=ActivationStats) learn.fit(1) len(learn.data.train_dl),len(learn.activation_stats.modules) learn.activation_stats.stats.shape plt.plot(learn.activation_stats.stats[1][-2].numpy()); show_doc(ActivationStats.hook) show_doc(ActivationStats.on_train_begin) show_doc(ActivationStats.on_batch_end) show_doc(ActivationStats.on_train_end) show_doc(Hook) show_doc(Hook.remove) show_doc(Hooks) show_doc(Hooks.remove) show_doc(hook_output) show_doc(hook_outputs) show_doc(model_sizes) show_doc(model_summary) show_doc(num_features_model) show_doc(dummy_batch) show_doc(dummy_eval) show_doc(HookCallback) show_doc(HookCallback.on_train_begin) show_doc(HookCallback.on_train_end) show_doc(HookCallback.remove) show_doc(Hook.hook_fn)