def on_batch_end(self, *args, **kwargs): freeze_modules(self.__modules, invert=True)
def on_sample_end(self, *args, **kwargs): freeze_modules(self.__modules, invert=True)
def on_batch_begin(self, *args, **kwargs): freeze_modules(self.__modules)
def on_sample_begin(self, *args, **kwargs): freeze_modules(self.__modules)