Skip to content

BaseCallback

BaseCallback

Base class for callbacks.

Defines methods for all the various callback points in the trainer.

Source code in sequel/utils/callbacks/base_callback.py
 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
class BaseCallback:
    """Base class for callbacks.

    Defines methods for all the various callback points in the trainer.
    """

    def __init__(self):
        pass

    def connect(self, *args, **kwargs):
        pass

    def on_before_setup(self, *args, **kwargs):
        pass

    def on_after_setup(self, *args, **kwargs):
        pass

    def on_before_teardown(self, *args, **kwargs):
        pass

    def on_after_teardown(self, *args, **kwargs):
        pass

    def on_before_fit(self, *args, **kwargs):
        pass

    def on_after_fit(self, *args, **kwargs):
        pass

    def on_before_training_epoch(self, *args, **kwargs):
        pass

    def on_after_training_epoch(self, *args, **kwargs):
        pass

    def on_before_val_epoch(self, *args, **kwargs):
        pass

    def on_after_val_epoch(self, *args, **kwargs):
        pass

    def on_before_testing_epoch(self, *args, **kwargs):
        pass

    def on_after_testing_epoch(self, *args, **kwargs):
        pass

    def on_before_training_step(self, *args, **kwargs):
        pass

    def on_after_training_step(self, *args, **kwargs):
        pass

    def on_before_backward(self, *args, **kwargs):
        pass

    def on_after_backward(self, *args, **kwargs):
        pass

    def on_before_forward(self, *args, **kwargs):
        pass

    def on_after_forward(self, *args, **kwargs):
        pass

    def on_before_optimizer_step(self, *args, **kwargs):
        pass

    def on_after_optimizer_step(self, *args, **kwargs):
        pass

    def on_before_val_step(self, *args, **kwargs):
        pass

    def on_after_val_step(self, *args, **kwargs):
        pass

    def on_before_testing_step(self, *args, **kwargs):
        pass

    def on_after_testing_step(self, *args, **kwargs):
        pass

    def on_before_training_task(self, *args, **kwargs):
        pass

    def on_after_training_task(self, *args, **kwargs):
        pass

    def on_before_validating_algorithm_on_all_tasks(self, *args, **kwargs):
        pass

    def on_after_validating_algorithm_on_all_tasks(self, *args, **kwargs):
        pass