class CompletionCB(Callback):
def before_fit(self, pipeline): self.count = 0
def after_batch(self, pipeline): self.count += 1
def after_fit(self, pipeline): print(f'Completed {self.count} batches')Callbacks
Base
CancelEpochException
def CancelEpochException(
args:VAR_POSITIONAL, kwargs:VAR_KEYWORD
):
Common base class for all non-exit exceptions.
CancelBatchException
def CancelBatchException(
args:VAR_POSITIONAL, kwargs:VAR_KEYWORD
):
Common base class for all non-exit exceptions.
CancelFitException
def CancelFitException(
args:VAR_POSITIONAL, kwargs:VAR_KEYWORD
):
Common base class for all non-exit exceptions.
Callback
def Callback(
args:VAR_POSITIONAL, kwargs:VAR_KEYWORD
):
Initialize self. See help(type(self)) for accurate signature.
run_cbs
def run_cbs(
cbs, method_nm, pipeline:NoneType=None
):
cbs = [CompletionCB()]
run_cbs(cbs, 'before_fit')
run_cbs(cbs, 'after_batch')
run_cbs(cbs, 'after_fit')Completed 1 batches