Implement Your Callback
Callbacks are exactly Lightning callbacks object, which work in each task of continual learning, before, during, or after training, validating, or testing process. All you need to do is override the hooks for different moments (like on_train_start()
, on_train_batch_end()
, on_test_start()
) to custom your own additional actions. These hooks take 2 arguments: trainer
and pl_module
, which are the PyTorch Lightning trainer and the CLAlgorithm module in your experiment respectively, where you can get the information like current task ID and so on.
Please find the API documentation (both CLArena and Lightning) for detailed information about implementation, and remember you can always take implemented callbacks in package source codes clarena/callbacks/ as examples, like PyLoggerCallback
!