Skip to content

Conversation

kites262
Copy link
Member

Description

Add OpenAPI endpoint: Get experiment summary

This OpenAPI provides a summary of metrics for a given experiment, including the maximum and minimum values observed during training when tracked with SwanLab.

e.g:

Get the min value

my_api.get_exp_summary(project=project, exp_cuid=cuid).data.get("loss").get("min").get("value")
"""
0.1745886406861026
"""

Get the max info

my_api.get_exp_summary(project=project, exp_cuid=cuid).data.get("loss").get("max")
"""
"max": {
  "step": 0,
  "value": 0.7108771095136294
}
"""

Related PR: #969

@kites262 kites262 requested a review from SAKURA-CAT May 14, 2025 10:46
@Zeyi-Lin
Copy link
Member

Zeyi-Lin commented May 14, 2025

Tested and there were no issues.
BTW, there is a type of interaction to consider whether it is feasible.

import swanlab

my_api = swanlab.OpenApi()
project1 = my_api.get_project(...)
exp1 = project1.get_experiment(...)
exp1.get_metadata()
exp1.get_summary()

@SAKURA-CAT SAKURA-CAT merged commit 8494cef into main May 14, 2025
5 checks passed
@SAKURA-CAT SAKURA-CAT deleted the feature/openapi-exp-summary branch May 14, 2025 14:46
@SAKURA-CAT SAKURA-CAT added the 💪 enhancement New feature or request label May 14, 2025
@kites262
Copy link
Member Author

kites262 commented May 14, 2025

Tested and there were no issues. BTW, there is a type of interaction to consider whether it is feasible.

import swanlab

my_api = swanlab.OpenApi()
project1 = my_api.get_project(...)
exp1 = project1.get_experiment(...)
exp1.get_metadata()
exp1.get_summary()

Feasible, but it may require significant refactoring / architectural discussion.
A ISSUE will be created to consider how to add this feature in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants