forked from fastai/fastai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
callbacks.hooks.html
805 lines (575 loc) · 68.1 KB
/
callbacks.hooks.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
---
title: callbacks.hooks
keywords: fastai
sidebar: home_sidebar
summary: "Implement callbacks using hooks"
---
<!--
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: docs_src/callbacks.hooks.ipynb
# instructions: https://docs.fast.ai/gen_doc_main.html
-->
<div class="container" id="notebook-container">
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Hook-callbacks">Hook callbacks<a class="anchor-link" href="#Hook-callbacks">¶</a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>This provides both a standalone class and a callback for registering and automatically deregistering <a href="https://pytorch.org/tutorials/beginner/former_torchies/nn_tutorial.html#forward-and-backward-function-hooks">PyTorch hooks</a>, along with some pre-defined hooks. Hooks can be attached to any <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module"><code>nn.Module</code></a>, for either the forward or the backward pass.</p>
<p>We'll start by looking at the pre-defined hook <a href="/callbacks.hooks.html#ActivationStats"><code>ActivationStats</code></a>, then we'll see how to create our own.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h2 id="ActivationStats" class="doc_header"><code>class</code> <code>ActivationStats</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L83" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ActivationStats-pytest" style="float:right; padding-right:10px">[test]</a></h2><blockquote><p><code>ActivationStats</code>(<strong><code>learn</code></strong>:<a href="/basic_train.html#Learner"><code>Learner</code></a>, <strong><code>modules</code></strong>:<code>Sequence</code>[<a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module"><code>Module</code></a>]=<strong><em><code>None</code></em></strong>, <strong><code>do_remove</code></strong>:<code>bool</code>=<strong><em><code>True</code></em></strong>) :: <a href="/callbacks.hooks.html#HookCallback"><code>HookCallback</code></a></p>
</blockquote>
<div class="collapse" id="ActivationStats-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ActivationStats-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>ActivationStats</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Callback that record the mean and std of activations.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><a href="/callbacks.hooks.html#ActivationStats"><code>ActivationStats</code></a> saves the layer activations in <code>self.stats</code> for all <code>modules</code> passed to it. By default it will save activations for <em>all</em> modules. For instance:</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">path</span> <span class="o">=</span> <span class="n">untar_data</span><span class="p">(</span><span class="n">URLs</span><span class="o">.</span><span class="n">MNIST_SAMPLE</span><span class="p">)</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">ImageDataBunch</span><span class="o">.</span><span class="n">from_folder</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>
<span class="c1">#learn = cnn_learner(data, models.resnet18, callback_fns=ActivationStats)</span>
<span class="n">learn</span> <span class="o">=</span> <span class="n">Learner</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">simple_cnn</span><span class="p">((</span><span class="mi">3</span><span class="p">,</span><span class="mi">16</span><span class="p">,</span><span class="mi">16</span><span class="p">,</span><span class="mi">2</span><span class="p">)),</span> <span class="n">callback_fns</span><span class="o">=</span><span class="n">ActivationStats</span><span class="p">)</span>
<span class="n">learn</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_html rendered_html output_subarea ">
Total time: 00:02 <p><table style='width:300px; margin-bottom:10px'>
<tr>
<th>epoch</th>
<th>train_loss</th>
<th>valid_loss</th>
</tr>
<tr>
<th>1</th>
<th>0.112384</th>
<th>0.083544</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>The saved <code>stats</code> is a <code>FloatTensor</code> of shape <code>(2,num_modules,num_batches)</code>. The first axis is <code>(mean,stdev)</code>.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="nb">len</span><span class="p">(</span><span class="n">learn</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">train_dl</span><span class="p">),</span><span class="nb">len</span><span class="p">(</span><span class="n">learn</span><span class="o">.</span><span class="n">activation_stats</span><span class="o">.</span><span class="n">modules</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_text output_subarea output_execute_result">
<pre>(193, 3)</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">learn</span><span class="o">.</span><span class="n">activation_stats</span><span class="o">.</span><span class="n">stats</span><span class="o">.</span><span class="n">shape</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_text output_subarea output_execute_result">
<pre>torch.Size([2, 3, 193])</pre>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>So this shows the standard deviation (<code>axis0==1</code>) of 2th last layer (<code>axis1==-2</code>) for each batch (<code>axis2</code>):</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">plt</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">learn</span><span class="o">.</span><span class="n">activation_stats</span><span class="o">.</span><span class="n">stats</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">.</span><span class="n">numpy</span><span class="p">());</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_png output_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oEYlxP8ZqRNyLdd5usQ+7BfibP+Kz9boLC5Rz52Wgc7UR+KzdU2MV0Oguuo8nEVkHfA+4yhjT5rU9RUQc9uN8YBZQNM6xDfS/3AjcICJhIpJnx/bheMbm5TLgoDGmxL1hvM/dQNcRRvO9N16t3OPQir4eq+X8KHBnAMRzPlYxbDew0/5aD/wZ2GNv3whk+Cm+fKxeGLuAfe5zBiQBrwNH7O+JfoovEqgF4ry2+e3cYSWjcqAb627riwOdK6wi+f32e3EPsMJP8RVi1Q+7338P2Mdeb//PdwHbgSv9ENuA/0vgTvvcHQKu8Me5s7f/Efhqn2PH+9wNdB0ZtfeejhhWSqkpbLJUBymllBoBTQJKKTWFaRJQSqkpTJOAUkpNYZoElFJqCtMkoJRSU5gmAaWUmsI0CSil1BT2/wHR7xc3djC91gAAAABJRU5ErkJggg==
"
>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="Internal-implementation">Internal implementation<a class="anchor-link" href="#Internal-implementation">¶</a></h3>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ActivationStats.hook" class="doc_header"><code>hook</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L91" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ActivationStats-hook-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>hook</code>(<strong><code>m</code></strong>:<a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module"><code>Module</code></a>, <strong><code>i</code></strong>:<code>Tensors</code>, <strong><code>o</code></strong>:<code>Tensors</code>) → <code>Tuple</code>[<code>Rank0Tensor</code>, <code>Rank0Tensor</code>]</p>
</blockquote>
<div class="collapse" id="ActivationStats-hook-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ActivationStats-hook-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>Tests found for <code>hook</code>:</p><p>Some other tests where <code>hook</code> is used:</p><ul><li><code>pytest -sv tests/test_callbacks_hooks.py::test_hook_output_basics</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_callbacks_hooks.py#L74" class="source_link" style="float:right">[source]</a></li></ul><p>To run tests please refer to this <a href="/dev/test.html#quick-guide">guide</a>.</p></div></div><p>Take the mean and std of <code>o</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="Callback-methods">Callback methods<a class="anchor-link" href="#Callback-methods">¶</a></h3>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>You don't call these yourself - they're called by fastai's <a href="/callback.html#Callback"><code>Callback</code></a> system automatically to enable the class's functionality.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ActivationStats.on_train_begin" class="doc_header"><code>on_train_begin</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L86" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ActivationStats-on_train_begin-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>on_train_begin</code>(<strong>**<code>kwargs</code></strong>)</p>
</blockquote>
<div class="collapse" id="ActivationStats-on_train_begin-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ActivationStats-on_train_begin-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>on_train_begin</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Initialize stats.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ActivationStats.on_batch_end" class="doc_header"><code>on_batch_end</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L94" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ActivationStats-on_batch_end-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>on_batch_end</code>(<strong><code>train</code></strong>, <strong>**<code>kwargs</code></strong>)</p>
</blockquote>
<div class="collapse" id="ActivationStats-on_batch_end-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ActivationStats-on_batch_end-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>on_batch_end</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Take the stored results and puts it in <code>self.stats</code></p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="ActivationStats.on_train_end" class="doc_header"><code>on_train_end</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L97" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#ActivationStats-on_train_end-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>on_train_end</code>(<strong>**<code>kwargs</code></strong>)</p>
</blockquote>
<div class="collapse" id="ActivationStats-on_train_end-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#ActivationStats-on_train_end-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>on_train_end</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Polish the final result.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h2 id="Hook" class="doc_header"><code>class</code> <code>Hook</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L10" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#Hook-pytest" style="float:right; padding-right:10px">[test]</a></h2><blockquote><p><code>Hook</code>(<strong><code>m</code></strong>:<a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module"><code>Module</code></a>, <strong><code>hook_func</code></strong>:<code>HookFunc</code>, <strong><code>is_forward</code></strong>:<code>bool</code>=<strong><em><code>True</code></em></strong>, <strong><code>detach</code></strong>:<code>bool</code>=<strong><em><code>True</code></em></strong>)</p>
</blockquote>
<div class="collapse" id="Hook-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#Hook-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>Hook</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Create a hook on <code>m</code> with <code>hook_func</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Registers and manually deregisters a <a href="https://pytorch.org/tutorials/beginner/former_torchies/nn_tutorial.html#forward-and-backward-function-hooks">PyTorch hook</a>. Your <code>hook_func</code> will be called automatically when forward/backward (depending on <code>is_forward</code>) for your module <code>m</code> is run, and the result of that function is placed in <code>self.stored</code>.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="Hook.remove" class="doc_header"><code>remove</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L25" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#Hook-remove-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>remove</code>()</p>
</blockquote>
<div class="collapse" id="Hook-remove-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#Hook-remove-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>remove</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Remove the hook from the model.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Deregister the hook, if not called already.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h2 id="Hooks" class="doc_header"><code>class</code> <code>Hooks</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L34" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#Hooks-pytest" style="float:right; padding-right:10px">[test]</a></h2><blockquote><p><code>Hooks</code>(<strong><code>ms</code></strong>:<code>ModuleList</code>, <strong><code>hook_func</code></strong>:<code>HookFunc</code>, <strong><code>is_forward</code></strong>:<code>bool</code>=<strong><em><code>True</code></em></strong>, <strong><code>detach</code></strong>:<code>bool</code>=<strong><em><code>True</code></em></strong>)</p>
</blockquote>
<div class="collapse" id="Hooks-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#Hooks-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>Hooks</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Create several hooks on the modules in <code>ms</code> with <code>hook_func</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Acts as a <code>Collection</code> (i.e. <code>len(hooks)</code> and <code>hooks[i]</code>) and an <code>Iterator</code> (i.e. <code>for hook in hooks</code>) of a group of hooks, one for each module in <code>ms</code>, with the ability to remove all as a group. Use <code>stored</code> to get all hook results. <code>hook_func</code> and <code>is_forward</code> behavior is the same as <a href="/callbacks.hooks.html#Hook"><code>Hook</code></a>. See the source code for <a href="/callbacks.hooks.html#HookCallback"><code>HookCallback</code></a> for a simple example.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="Hooks.remove" class="doc_header"><code>remove</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L45" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#Hooks-remove-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>remove</code>()</p>
</blockquote>
<div class="collapse" id="Hooks-remove-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#Hooks-remove-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>remove</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Remove the hooks from the model.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Deregister all hooks created by this class, if not previously called.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Convenience-functions-for-hooks">Convenience functions for hooks<a class="anchor-link" href="#Convenience-functions-for-hooks">¶</a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="hook_output" class="doc_header"><code>hook_output</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L54" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#hook_output-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>hook_output</code>(<strong><code>module</code></strong>:<a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module"><code>Module</code></a>, <strong><code>detach</code></strong>:<code>bool</code>=<strong><em><code>True</code></em></strong>, <strong><code>grad</code></strong>:<code>bool</code>=<strong><em><code>False</code></em></strong>) → <a href="/callbacks.hooks.html#Hook"><code>Hook</code></a></p>
</blockquote>
<div class="collapse" id="hook_output-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#hook_output-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>Tests found for <code>hook_output</code>:</p><ul><li><code>pytest -sv tests/test_callbacks_hooks.py::test_hook_output_basics</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_callbacks_hooks.py#L74" class="source_link" style="float:right">[source]</a></li></ul><p>To run tests please refer to this <a href="/dev/test.html#quick-guide">guide</a>.</p></div></div><p>Return a <a href="/callbacks.hooks.html#Hook"><code>Hook</code></a> that stores activations of <code>module</code> in <code>self.stored</code></p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Function that creates a <a href="/callbacks.hooks.html#Hook"><code>Hook</code></a> for <code>module</code> that simply stores the output of the layer.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="hook_outputs" class="doc_header"><code>hook_outputs</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L58" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#hook_outputs-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>hook_outputs</code>(<strong><code>modules</code></strong>:<code>ModuleList</code>, <strong><code>detach</code></strong>:<code>bool</code>=<strong><em><code>True</code></em></strong>, <strong><code>grad</code></strong>:<code>bool</code>=<strong><em><code>False</code></em></strong>) → <a href="/callbacks.hooks.html#Hooks"><code>Hooks</code></a></p>
</blockquote>
<div class="collapse" id="hook_outputs-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#hook_outputs-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>hook_outputs</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Return <a href="/callbacks.hooks.html#Hooks"><code>Hooks</code></a> that store activations of all <code>modules</code> in <code>self.stored</code></p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Function that creates a <a href="/callbacks.hooks.html#Hook"><code>Hook</code></a> for all passed <code>modules</code> that simply stores the output of the layers. For example, the (slightly simplified) source code of <a href="/callbacks.hooks.html#model_sizes"><code>model_sizes</code></a> is:</p>
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">model_sizes</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">size</span><span class="p">):</span>
<span class="n">x</span> <span class="o">=</span> <span class="n">m</span><span class="p">(</span><span class="n">torch</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">in_channels</span><span class="p">(</span><span class="n">m</span><span class="p">),</span> <span class="o">*</span><span class="n">size</span><span class="p">))</span>
<span class="k">return</span> <span class="p">[</span><span class="n">o</span><span class="o">.</span><span class="n">stored</span><span class="o">.</span><span class="n">shape</span> <span class="k">for</span> <span class="n">o</span> <span class="ow">in</span> <span class="n">hook_outputs</span><span class="p">(</span><span class="n">m</span><span class="p">)]</span>
</pre></div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="model_sizes" class="doc_header"><code>model_sizes</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L111" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#model_sizes-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>model_sizes</code>(<strong><code>m</code></strong>:<a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module"><code>Module</code></a>, <strong><code>size</code></strong>:<code>tuple</code>=<strong><em><code>(64, 64)</code></em></strong>) → <code>Tuple</code>[<code>Sizes</code>, <code>Tensor</code>, <a href="/callbacks.hooks.html#Hooks"><code>Hooks</code></a>]</p>
</blockquote>
<div class="collapse" id="model_sizes-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#model_sizes-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>model_sizes</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Pass a dummy input through the model <code>m</code> to get the various sizes of activations.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="model_summary" class="doc_header"><code>model_summary</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L166" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#model_summary-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>model_summary</code>(<strong><code>m</code></strong>:<a href="/basic_train.html#Learner"><code>Learner</code></a>, <strong><code>n</code></strong>:<code>int</code>=<strong><em><code>70</code></em></strong>)</p>
</blockquote>
<div class="collapse" id="model_summary-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#model_summary-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>Tests found for <code>model_summary</code>:</p><ul><li><code>pytest -sv tests/test_basic_train.py::test_export_load_learner</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_basic_train.py#L230" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_callbacks_hooks.py::test_model_summary_collab</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_callbacks_hooks.py#L48" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_callbacks_hooks.py::test_model_summary_tabular</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_callbacks_hooks.py#L33" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_callbacks_hooks.py::test_model_summary_text</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_callbacks_hooks.py#L26" class="source_link" style="float:right">[source]</a></li><li><code>pytest -sv tests/test_callbacks_hooks.py::test_model_summary_vision</code> <a href="https://github.com/fastai/fastai/blob/master/tests/test_callbacks_hooks.py#L18" class="source_link" style="float:right">[source]</a></li></ul><p>To run tests please refer to this <a href="/dev/test.html#quick-guide">guide</a>.</p></div></div><p>Print a summary of <code>m</code> using a output text width of <code>n</code> chars</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>This method only works on a <a href="/basic_train.html#Learner"><code>Learner</code></a> object with <code>train_ds</code> in it. If it was created as a result of <a href="/basic_train.html#load_learner"><code>load_learner</code></a>, there is no <a href="/vision.data.html#vision.data"><code>data</code></a> to run through the model and therefore it's not possible to create such summary.</p>
<p>A sample <code>summary</code> looks like:</p>
<pre><code>======================================================================
Layer (type) Output Shape Param # Trainable
======================================================================
Conv2d [64, 176, 176] 9,408 False
______________________________________________________________________
BatchNorm2d [64, 176, 176] 128 True
______________________________________________________________________
ReLU [64, 176, 176] 0 False
______________________________________________________________________
MaxPool2d [64, 88, 88] 0 False
______________________________________________________________________
Conv2d [64, 88, 88] 36,864 False
...</code></pre>
<p>Column definition:</p>
<ol>
<li><p><strong>Layer (type)</strong> is the name of the corresponding <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module"><code>nn.Module</code></a>.</p>
</li>
<li><p><strong>Output Shape</strong> is the shape of the output of the corresponding layer (minus the batch dimension, which is always the same and has no impact on the model params).</p>
</li>
<li><p><strong>Param #</strong> is the number of weights (and optionally bias), and it will vary for each layer.</p>
<p>The number of params is calculated differently for each layer type. Here is how it's calculated for some of the most common layer types:</p>
<ul>
<li>Conv: <code>kernel_size*kernel_size*ch_in*ch_out</code></li>
<li>Linear: <code>(n_in+bias) * n_out</code></li>
<li>Batchnorm: <code>2 * n_out</code></li>
<li>Embeddings: <code>n_embed * emb_sz</code></li>
</ul>
</li>
<li><p><strong>Trainable</strong> indicates whether a layer is trainable or not.</p>
<ul>
<li>Layers with <code>0</code> parameters are always Untrainable (e.g., <code>ReLU</code> and <code>MaxPool2d</code>).</li>
<li>Other layers are either Trainable or not, usually depending on whether they are frozen or not. See <a href="https://docs.fast.ai/basic_train.html#Discriminative-layer-training">Discriminative layer training</a>.</li>
</ul>
</li>
</ol>
<p>To better understand this summary it helps to also execute <code>learn.model</code> and correlate the two outputs.</p>
<p>Example:</p>
<p>Let's feed to a <a href="/basic_train.html#Learner"><code>Learner</code></a> a dataset of 3-channel images size 352x352 and look at the model and its summary:</p>
<pre><code>data.train_ds[0][0].data.shape
learn = cnn_learner(data, models.resnet34, ...)
print(learn.model)
print(learn.summary())</code></pre>
<p>Here are the outputs with everything but the relevant to the example lines removed:</p>
<pre><code>torch.Size([3, 352, 352])
[...]
(0): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
(1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
[...]
(3): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
[...]
(conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(8): Linear(in_features=512, out_features=37, bias=True)
======================================================================
Layer (type) Output Shape Param # Trainable
======================================================================
Conv2d [64, 176, 176] 9,408 False
______________________________________________________________________
BatchNorm2d [64, 176, 176] 128 True
______________________________________________________________________
[...]
MaxPool2d [64, 88, 88] 0 False
______________________________________________________________________
Conv2d [64, 88, 88] 36,864 False
[...]
______________________________________________________________________
Linear [37] 18,981 True</code></pre>
<p><strong>So let's calculate some params:</strong></p>
<p>For the <code>Conv2d</code> layers, multiply the first 4 numbers from the corresponding layer definition:</p>
<pre><code>Conv2d(3, 64, kernel_size=(7, 7), ...)
3*64*7*7 = 9,408
Conv2d(64, 64, kernel_size=(3, 3), ...)
64*64*3*3 = 36,864</code></pre>
<p>For the <code>BatchNorm2d</code> layer, multiply the first number by 2:</p>
<pre><code>BatchNorm2d(64, ...)
64*2 = 128</code></pre>
<p>For <code>Linear</code> we multiply the first 2 and include the bias if it's <code>True</code>:</p>
<pre><code>Linear(in_features=512, out_features=37, bias=True)
(512+1)*37 = 18,981</code></pre>
<p><strong>Now let's calculate some output shapes:</strong></p>
<p>We started with 3x352x352 image and run it through this layer:</p>
<p><code>Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)</code></p>
<p>How did we get: <code>[64, 176, 176]</code></p>
<p>The number of output channels is <code>64</code>, that's the first dimension in the number above. And then our image of <code>352x352</code> got convolved into <code>176x176</code> because of stride <code>2x2</code> (<code>352/2</code>).</p>
<p>Then we had:</p>
<p><code>MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)</code></p>
<p>which reduced <code>[64, 176, 176]</code> to <code>[64, 88, 88]</code> again because of stride 2.</p>
<p>And so on, finishing with:</p>
<p><code>Linear(in_features=512, out_features=37, bias=True)</code></p>
<p>which reduced everything to just <code>[37]</code>.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="num_features_model" class="doc_header"><code>num_features_model</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L117" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#num_features_model-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>num_features_model</code>(<strong><code>m</code></strong>:<a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module"><code>Module</code></a>) → <code>int</code></p>
</blockquote>
<div class="collapse" id="num_features_model-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#num_features_model-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>num_features_model</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Return the number of output features for <code>model</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>It can be useful to get the size of each layer of a model (e.g. for printing a summary, or for generating cross-connections for a <a href="/vision.models.unet.html#DynamicUnet"><code>DynamicUnet</code></a>), however they depend on the size of the input. This function calculates the layer sizes by passing in a minimal tensor of <code>size</code>.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="dummy_batch" class="doc_header"><code>dummy_batch</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L102" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#dummy_batch-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>dummy_batch</code>(<strong><code>m</code></strong>:<a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module"><code>Module</code></a>, <strong><code>size</code></strong>:<code>tuple</code>=<strong><em><code>(64, 64)</code></em></strong>) → <code>Tensor</code></p>
</blockquote>
<div class="collapse" id="dummy_batch-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#dummy_batch-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>dummy_batch</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Create a dummy batch to go through <code>m</code> with <code>size</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="dummy_eval" class="doc_header"><code>dummy_eval</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L107" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#dummy_eval-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>dummy_eval</code>(<strong><code>m</code></strong>:<a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module"><code>Module</code></a>, <strong><code>size</code></strong>:<code>tuple</code>=<strong><em><code>(64, 64)</code></em></strong>)</p>
</blockquote>
<div class="collapse" id="dummy_eval-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#dummy_eval-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>dummy_eval</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Pass a <a href="/callbacks.hooks.html#dummy_batch"><code>dummy_batch</code></a> in evaluation mode in <code>m</code> with <code>size</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h2 id="HookCallback" class="doc_header"><code>class</code> <code>HookCallback</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L62" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#HookCallback-pytest" style="float:right; padding-right:10px">[test]</a></h2><blockquote><p><code>HookCallback</code>(<strong><code>learn</code></strong>:<a href="/basic_train.html#Learner"><code>Learner</code></a>, <strong><code>modules</code></strong>:<code>Sequence</code>[<a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module"><code>Module</code></a>]=<strong><em><code>None</code></em></strong>, <strong><code>do_remove</code></strong>:<code>bool</code>=<strong><em><code>True</code></em></strong>) :: <a href="/basic_train.html#LearnerCallback"><code>LearnerCallback</code></a></p>
</blockquote>
<div class="collapse" id="HookCallback-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#HookCallback-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>HookCallback</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Callback that can be used to register hooks on <code>modules</code>. Implement the corresponding function in <code>self.hook</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>For all <code>modules</code>, uses a callback to automatically register a method <code>self.hook</code> (that you must define in an inherited class) as a hook. This method must have the signature:</p>
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">hook</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">m</span><span class="p">:</span><span class="n">Model</span><span class="p">,</span> <span class="nb">input</span><span class="p">:</span><span class="n">Tensors</span><span class="p">,</span> <span class="n">output</span><span class="p">:</span><span class="n">Tensors</span><span class="p">)</span>
</pre></div>
<p>If <code>do_remove</code> then the hook is automatically deregistered at the end of training. See <a href="/callbacks.hooks.html#ActivationStats"><code>ActivationStats</code></a> for a simple example of inheriting from this class.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="Callback-methods">Callback methods<a class="anchor-link" href="#Callback-methods">¶</a></h3>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>You don't call these yourself - they're called by fastai's <a href="/callback.html#Callback"><code>Callback</code></a> system automatically to enable the class's functionality.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="HookCallback.on_train_begin" class="doc_header"><code>on_train_begin</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L68" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#HookCallback-on_train_begin-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>on_train_begin</code>(<strong>**<code>kwargs</code></strong>)</p>
</blockquote>
<div class="collapse" id="HookCallback-on_train_begin-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#HookCallback-on_train_begin-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>on_train_begin</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Register the <a href="/callbacks.hooks.html#Hooks"><code>Hooks</code></a> on <code>self.modules</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="HookCallback.on_train_end" class="doc_header"><code>on_train_end</code><a href="https://github.com/fastai/fastai/blob/master/fastai/callbacks/hooks.py#L75" class="source_link" style="float:right">[source]</a><a class="source_link" data-toggle="collapse" data-target="#HookCallback-on_train_end-pytest" style="float:right; padding-right:10px">[test]</a></h4><blockquote><p><code>on_train_end</code>(<strong>**<code>kwargs</code></strong>)</p>
</blockquote>
<div class="collapse" id="HookCallback-on_train_end-pytest"><div class="card card-body pytest_card"><a type="button" data-toggle="collapse" data-target="#HookCallback-on_train_end-pytest" class="close" aria-label="Close"><span aria-hidden="true">×</span></a><p>No tests found for <code>on_train_end</code>. To contribute a test please refer to <a href="/dev/test.html">this guide</a> and <a href="https://forums.fast.ai/t/improving-expanding-functional-tests/32929">this discussion</a>.</p></div></div><p>Remove the <a href="/callbacks.hooks.html#Hooks"><code>Hooks</code></a>.</p>
</div>
</div>
</div>
</div>
</div>
</div>