Feat/define metric - #1733
Open
Nexisato wants to merge 1 commit into
Open
Conversation
Nexisato
force-pushed
the
feat/define-metric
branch
2 times, most recently
from
August 19, 2026 09:53
1c086b6 to
7c8e63d
Compare
Nexisato
force-pushed
the
feat/define-metric
branch
from
August 21, 2026 07:00
7c8e63d to
b05f4b3
Compare
Nexisato
force-pushed
the
feat/define-metric
branch
from
August 21, 2026 07:08
b05f4b3 to
218fa2c
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
新增
swanlab.define_metric()API,在 log 之前定义指标的图表行为(自定义 X 轴、图表分组、隐藏)API
示例:
语义要点:
(class, key)全项目共享一张图,仅首个引入该 key 的 run 的定义生效x_axis仅对 scalar 生效,media 一律回退_stepChanges
DefinitionResolver组件(run/components/resolver/):exact/glob 规则注册、首次 log 时物化定义、custom X 缓存与 step 同步注入、X 值去重ScalarDefineEvent→MetricDefineEvent,新增UNSET哨兵区分"未提供"与NoneColumnRecord新增x_axis、hidden可选字段(含重新生成的 Python/Go 代码)encode_column按 presence 编码,仅发送已设置的字段ColumnRecord时保留x_axis/hidden,同 key first-writer-wins