You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
719 B
42 lines
719 B
2 years ago
|
def before_train(trainer):
|
||
|
# Initialize tensorboard logger
|
||
|
pass
|
||
|
|
||
|
|
||
|
def on_epoch_start(trainer):
|
||
|
pass
|
||
|
|
||
|
|
||
|
def on_batch_start(trainer):
|
||
|
pass
|
||
|
|
||
|
|
||
|
def on_val_start(trainer):
|
||
|
pass
|
||
|
|
||
|
|
||
|
def on_val_end(trainer):
|
||
|
pass
|
||
|
|
||
|
|
||
|
def on_model_save(trainer):
|
||
|
pass
|
||
|
|
||
|
|
||
|
default_callbacks = {
|
||
|
"before_train": before_train,
|
||
|
"on_epoch_start": on_epoch_start,
|
||
|
"on_batch_start": on_batch_start,
|
||
|
"on_val_start": on_val_start,
|
||
|
"on_val_end": on_val_end,
|
||
|
"on_model_save": on_model_save}
|
||
2 years ago
|
|
||
|
|
||
|
def add_integration_callbacks(trainer):
|
||
|
callbacks = {}
|
||
|
|
||
|
from .clearml import callbacks, clearml
|
||
|
if clearml:
|
||
|
for callback, func in callbacks.items():
|
||
|
trainer.add_callback(callback, func)
|