-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b950754
commit d2f99b7
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
为了适应多样化需求,swanlab会触发一些事件,这些事件可以通过回调函数来处理。内部支持的回调函数如下: | ||
|
||
|
||
| name | usage(example) | note | | ||
|----------------------------|------------------------|----------------------------------| | ||
| on_init | 初始化用户文件夹 | 执行`swanlab.init`时调用 | | ||
| before_run | 获取swanlab的一些运行时配置信息 | 在SwanlabRun被初始化之前调用 | | ||
| before_init_experiment | 与本地swanboard交互,生成一些 | 在初始化实验之前调用,此时SwanLabRun准备初始化内部子类 | | ||
| on_run | 云端实验注册、本地相关系统回调注入 | SwanLabRun初始化完毕后调用 | | ||
| on_run_error_from_operator | 之前swanboard的需求,目前没太大用处 | 执行`on_run`错误时被操作员调用(⚠️即将废弃) | | ||
| on_runtime_info_update | config更新、系统信息获取 | 运行时信息更新时调用 | | ||
| on_log | 用户每次log一次数据 | 每次执行swanlab.log时调用 | | ||
| on_column_create | log数据时,首次新增一个key | 列创建回调函数,新增列信息时调用 | | ||
| on_metric_create | 每次log的内部回调 | 指标创建回调函数,新增指标信息时调用 | | ||
| on_stop | 训练结束的一些副作用清理 | 训练结束时的回调函数 | | ||
|
||
|
||
> 可以继承[SwanKitCallback](https://github.com/SwanHubX/SwanLab-Toolkit/blob/main/swankit/callback/__init__.py)来实现自定义回调函数。 | ||
> ⚠️当前自定义回调函数还是实验性功能,可能会有一些breaking change。 |