[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NB893AXJQ4BA1KQBJ40X47":3,"skill-same:01M6NB893AXJQ4BA1KQBJ40X47":94},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":63,"commitSha":64,"skillDirectory":65,"forksCount":14,"repositoryHtmlUrl":66,"repositoryHomepageUrl":6,"ownerHtmlUrl":67,"ownerBlogUrl":6,"ownerDescription":68,"updatedAt":69,"install":70,"resources":83},"01M6NB893AXJQ4BA1KQBJ40X47","experiment-tracking-swanlab",null,"Provides guidance for experiment tracking with SwanLab. Use when you need open-source run tracking, local or self-hosted dashboards, and lightweight media logging for ML workflows.","zhengliangliahu-cloud\u002Fskills","zhengliangliahu-cloud","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F248268067?v=4","01M6NAQ109P2Y11XSV5D9QJFFY","Lin","01M6NAQ15R1M4E18CA2KPJHC06",1,"MIT","https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud\u002Fskills\u002Fblob\u002Fmain\u002FAI-Research-SKILLs\u002F13-mlops\u002Fswanlab\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000013","分析与可视化","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"experiment tracking swanlab","SwanLab","Experiment Tracking","experiment","tracking","source","workflows","pillow","you","local","self","open","Media","pytorch lightning","Transformers","open source","logging","visualization","run","pytorch","2026-11-10 10:12:30",false,"---\nname: experiment-tracking-swanlab\ndescription: Provides guidance for experiment tracking with SwanLab. Use when you need open-source run tracking, local or self-hosted dashboards, and lightweight media logging for ML workflows.\nversion: 1.0.0\nauthor: Orchestra Research\nlicense: MIT\ntags: [MLOps, SwanLab, Experiment Tracking, Open Source, Visualization, PyTorch, Transformers, PyTorch Lightning, Fastai, Self-Hosted]\ndependencies: [swanlab>=0.7.11, pillow>=9.0.0, soundfile>=0.12.0]\n---\n\n# SwanLab: Open-Source Experiment Tracking\n\n## When to Use This Skill\n\nUse SwanLab when you need to:\n- **Track ML experiments** with metrics, configs, tags, and descriptions\n- **Visualize training** with scalar charts and logged media\n- **Compare runs** across seeds, checkpoints, and hyperparameters\n- **Work locally or self-hosted** instead of depending on managed SaaS\n- **Integrate** with PyTorch, Transformers, PyTorch Lightning, or Fastai\n\n**Deployment**: Cloud, local, or self-hosted | **Media**: images, audio, text, GIFs, point clouds, molecules | **Integrations**: PyTorch, Transformers, PyTorch Lightning, Fastai\n\n## Installation\n\n```bash\n# Install SwanLab plus the media dependencies used in this skill\npip install \"swanlab>=0.7.11\" \"pillow>=9.0.0\" \"soundfile>=0.12.0\"\n\n# Add local dashboard support for mode=\"local\" and swanlab watch\npip install \"swanlab[dashboard]>=0.7.11\"\n\n# Optional framework integrations\npip install transformers pytorch-lightning fastai\n\n# Login for cloud or self-hosted usage\nswanlab login\n```\n\n`pillow` and `soundfile` are the media dependencies used by the Image and Audio examples in this skill. `swanlab[dashboard]` adds the local dashboard dependency required by `mode=\"local\"` and `swanlab watch`.\n\n## Quick Start\n\n### Basic Experiment Tracking\n\n```python\nimport swanlab\n\nrun = swanlab.init(\n    project=\"my-project\",\n    experiment_name=\"baseline\",\n    config={\n        \"learning_rate\": 1e-3,\n        \"epochs\": 10,\n        \"batch_size\": 32,\n        \"model\": \"resnet18\",\n    },\n)\n\nfor epoch in range(run.config.epochs):\n    train_loss = train_epoch()\n    val_loss = validate()\n\n    swanlab.log(\n        {\n            \"train\u002Floss\": train_loss,\n            \"val\u002Floss\": val_loss,\n            \"epoch\": epoch,\n        }\n    )\n\nrun.finish()\n```\n\n### With PyTorch\n\n```python\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport swanlab\n\nrun = swanlab.init(\n    project=\"pytorch-demo\",\n    experiment_name=\"mnist-mlp\",\n    config={\n        \"learning_rate\": 1e-3,\n        \"batch_size\": 64,\n        \"epochs\": 10,\n        \"hidden_size\": 128,\n    },\n)\n\nmodel = nn.Sequential(\n    nn.Flatten(),\n    nn.Linear(28 * 28, run.config.hidden_size),\n    nn.ReLU(),\n    nn.Linear(run.config.hidden_size, 10),\n)\noptimizer = optim.Adam(model.parameters(), lr=run.config.learning_rate)\ncriterion = nn.CrossEntropyLoss()\n\nfor epoch in range(run.config.epochs):\n    model.train()\n    for batch_idx, (data, target) in enumerate(train_loader):\n        optimizer.zero_grad()\n        logits = model(data)\n        loss = criterion(logits, target)\n        loss.backward()\n        optimizer.step()\n\n        if batch_idx % 100 == 0:\n            swanlab.log(\n                {\n                    \"train\u002Floss\": loss.item(),\n                    \"train\u002Fepoch\": epoch,\n                    \"train\u002Fbatch\": batch_idx,\n                }\n            )\n\nrun.finish()\n```\n\n## Core Concepts\n\n### 1. Projects and Experiments\n\n**Project**: Collection of related experiments  \n**Experiment**: Single execution of a training or evaluation workflow\n\n```python\nimport swanlab\n\nrun = swanlab.init(\n    project=\"image-classification\",\n    experiment_name=\"resnet18-seed42\",\n    description=\"Baseline run on ImageNet subset\",\n    tags=[\"baseline\", \"resnet18\"],\n    config={\n        \"model\": \"resnet18\",\n        \"seed\": 42,\n        \"batch_size\": 64,\n        \"learning_rate\": 3e-4,\n    },\n)\n\nprint(run.id)\nprint(run.config.learning_rate)\n```\n\n### 2. Configuration Tracking\n\n```python\nconfig = {\n    \"model\": \"resnet18\",\n    \"seed\": 42,\n    \"batch_size\": 64,\n    \"learning_rate\": 3e-4,\n    \"epochs\": 20,\n}\n\nrun = swanlab.init(project=\"my-project\", config=config)\n\nlearning_rate = run.config.learning_rate\nbatch_size = run.config.batch_size\n```\n\n### 3. Metric Logging\n\n```python\n# Log scalars\nswanlab.log({\"loss\": 0.42, \"accuracy\": 0.91})\n\n# Log multiple metrics\nswanlab.log(\n    {\n        \"train\u002Floss\": train_loss,\n        \"train\u002Faccuracy\": train_acc,\n        \"val\u002Floss\": val_loss,\n        \"val\u002Faccuracy\": val_acc,\n        \"lr\": current_lr,\n        \"epoch\": epoch,\n    }\n)\n\n# Log with custom step\nswanlab.log({\"loss\": loss}, step=global_step)\n```\n\n### 4. Media and Chart Logging\n\n```python\nimport numpy as np\nimport swanlab\n\n# Image\nimage = np.random.randint(0, 255, (224, 224, 3), dtype=np.uint8)\nswanlab.log({\"examples\u002Fimage\": swanlab.Image(image, caption=\"Augmented sample\")})\n\n# Audio\nwave = np.sin(np.linspace(0, 8 * np.pi, 16000)).astype(\"float32\")\nswanlab.log({\"examples\u002Faudio\": swanlab.Audio(wave, sample_rate=16000)})\n\n# Text\nswanlab.log({\"examples\u002Ftext\": swanlab.Text(\"Training notes for this run.\")})\n\n# GIF video\nswanlab.log({\"examples\u002Fvideo\": swanlab.Video(\"predictions.gif\", caption=\"Validation rollout\")})\n\n# Point cloud\npoints = np.random.rand(128, 3).astype(\"float32\")\nswanlab.log({\"examples\u002Fpoint_cloud\": swanlab.Object3D(points, caption=\"Point cloud sample\")})\n\n# Molecule\nswanlab.log({\"examples\u002Fmolecule\": swanlab.Molecule.from_smiles(\"CCO\", caption=\"Ethanol\")})\n```\n\n```python\n# Custom chart with swanlab.echarts\nline = swanlab.echarts.Line()\nline.add_xaxis([\"epoch-1\", \"epoch-2\", \"epoch-3\"])\nline.add_yaxis(\"train\u002Floss\", [0.92, 0.61, 0.44])\nline.set_global_opts(\n    title_opts=swanlab.echarts.options.TitleOpts(title=\"Training Loss\")\n)\n\nswanlab.log({\"charts\u002Floss_curve\": line})\n```\n\nSee [references\u002Fvisualization.md](references\u002Fvisualization.md) for more chart and media patterns.\n\n### 5. Local and Self-Hosted Workflows\n\n```python\nimport os\nimport swanlab\n\n# Self-hosted or cloud login\nswanlab.login(\n    api_key=os.environ[\"SWANLAB_API_KEY\"],\n    host=\"http:\u002F\u002Fyour-server:5092\",\n)\n\n# Local-only logging\nrun = swanlab.init(\n    project=\"offline-demo\",\n    mode=\"local\",\n    logdir=\".\u002Fswanlog\",\n)\n\nswanlab.log({\"loss\": 0.35, \"epoch\": 1})\nrun.finish()\n```\n\n```bash\n# View local logs\nswanlab watch -l .\u002Fswanlog\n\n# Sync local logs later\nswanlab sync .\u002Fswanlog\n```\n\n## Integration Examples\n\n### HuggingFace Transformers\n\n```python\nfrom transformers import Trainer, TrainingArguments\n\ntraining_args = TrainingArguments(\n    output_dir=\".\u002Fresults\",\n    per_device_train_batch_size=8,\n    evaluation_strategy=\"epoch\",\n    logging_steps=50,\n    report_to=\"swanlab\",\n    run_name=\"bert-finetune\",\n)\n\ntrainer = Trainer(\n    model=model,\n    args=training_args,\n    train_dataset=train_dataset,\n    eval_dataset=eval_dataset,\n)\n\ntrainer.train()\n```\n\nSee [references\u002Fintegrations.md](references\u002Fintegrations.md) for callback-based setups and additional framework patterns.\n\n### PyTorch Lightning\n\n```python\nimport pytorch_lightning as pl\nfrom swanlab.integration.pytorch_lightning import SwanLabLogger\n\nswanlab_logger = SwanLabLogger(\n    project=\"lightning-demo\",\n    experiment_name=\"mnist-classifier\",\n    config={\"batch_size\": 64, \"max_epochs\": 10},\n)\n\ntrainer = pl.Trainer(\n    logger=swanlab_logger,\n    max_epochs=10,\n    accelerator=\"auto\",\n)\n\ntrainer.fit(model, train_loader, val_loader)\n```\n\n### Fastai\n\n```python\nfrom fastai.vision.all import accuracy, resnet34, vision_learner\nfrom swanlab.integration.fastai import SwanLabCallback\n\nlearn = vision_learner(dls, resnet34, metrics=accuracy)\nlearn.fit(\n    5,\n    cbs=[\n        SwanLabCallback(\n            project=\"fastai-demo\",\n            experiment_name=\"pets-classification\",\n            config={\"arch\": \"resnet34\", \"epochs\": 5},\n        )\n    ],\n)\n```\n\nSee [references\u002Fintegrations.md](references\u002Fintegrations.md) for fuller framework examples.\n\n## Best Practices\n\n### 1. Use Stable Metric Names\n\n```python\n# Good: grouped metric namespaces\nswanlab.log({\n    \"train\u002Floss\": train_loss,\n    \"train\u002Faccuracy\": train_acc,\n    \"val\u002Floss\": val_loss,\n    \"val\u002Faccuracy\": val_acc,\n})\n\n# Avoid mixing flat and grouped names for the same metric family\n```\n\n### 2. Initialize Early and Capture Config Once\n\n```python\nrun = swanlab.init(\n    project=\"image-classification\",\n    experiment_name=\"resnet18-baseline\",\n    config={\n        \"model\": \"resnet18\",\n        \"learning_rate\": 3e-4,\n        \"batch_size\": 64,\n        \"seed\": 42,\n    },\n)\n```\n\n### 3. Save Checkpoints Locally\n\n```python\nimport torch\nimport swanlab\n\ncheckpoint_path = \"checkpoints\u002Fbest.pth\"\ntorch.save(model.state_dict(), checkpoint_path)\n\nswanlab.log(\n    {\n        \"best\u002Fval_accuracy\": best_val_accuracy,\n        \"artifacts\u002Fcheckpoint_path\": swanlab.Text(checkpoint_path),\n    }\n)\n```\n\n### 4. Use Local Mode for Offline-First Workflows\n\n```python\nrun = swanlab.init(project=\"offline-demo\", mode=\"local\", logdir=\".\u002Fswanlog\")\n# ... training code ...\nrun.finish()\n\n# Inspect later with: swanlab watch -l .\u002Fswanlog\n```\n\n### 5. Keep Advanced Patterns in References\n\n- Use [references\u002Fvisualization.md](references\u002Fvisualization.md) for advanced chart and media patterns\n- Use [references\u002Fintegrations.md](references\u002Fintegrations.md) for callback-based and framework-specific integration details\n\n## Resources\n\n- [Official docs (Chinese)](https:\u002F\u002Fdocs.swanlab.cn)\n- [Official docs (English)](https:\u002F\u002Fdocs.swanlab.cn\u002Fen)\n- [GitHub repo](https:\u002F\u002Fgithub.com\u002FSwanHubX\u002FSwanLab)\n- [Self-hosted repo](https:\u002F\u002Fgithub.com\u002FSwanHubX\u002Fself-hosted)\n\n## See Also\n\n- [references\u002Fintegrations.md](references\u002Fintegrations.md) - Framework-specific examples\n- [references\u002Fvisualization.md](references\u002Fvisualization.md) - Charts and media logging patterns\n","# SwanLab: Open-Source Experiment Tracking\n\n## When to Use This Skill\n\nUse SwanLab when you need to:\n- **Track ML experiments** with metrics, configs, tags, and descriptions\n- **Visualize training** with scalar charts and logged media\n- **Compare runs** across seeds, checkpoints, and hyperparameters\n- **Work locally or self-hosted** instead of depending on managed SaaS\n- **Integrate** with PyTorch, Transformers, PyTorch Lightning, or Fastai\n\n**Deployment**: Cloud, local, or self-hosted | **Media**: images, audio, text, GIFs, point clouds, molecules | **Integrations**: PyTorch, Transformers, PyTorch Lightning, Fastai\n\n## Installation\n\n```bash\n# Install SwanLab plus the media dependencies used in this skill\npip install \"swanlab>=0.7.11\" \"pillow>=9.0.0\" \"soundfile>=0.12.0\"\n\n# Add local dashboard support for mode=\"local\" and swanlab watch\npip install \"swanlab[dashboard]>=0.7.11\"\n\n# Optional framework integrations\npip install transformers pytorch-lightning fastai\n\n# Login for cloud or self-hosted usage\nswanlab login\n```\n\n`pillow` and `soundfile` are the media dependencies used by the Image and Audio examples in this skill. `swanlab[dashboard]` adds the local dashboard dependency required by `mode=\"local\"` and `swanlab watch`.\n\n## Quick Start\n\n### Basic Experiment Tracking\n\n```python\nimport swanlab\n\nrun = swanlab.init(\n    project=\"my-project\",\n    experiment_name=\"baseline\",\n    config={\n        \"learning_rate\": 1e-3,\n        \"epochs\": 10,\n        \"batch_size\": 32,\n        \"model\": \"resnet18\",\n    },\n)\n\nfor epoch in range(run.config.epochs):\n    train_loss = train_epoch()\n    val_loss = validate()\n\n    swanlab.log(\n        {\n            \"train\u002Floss\": train_loss,\n            \"val\u002Floss\": val_loss,\n            \"epoch\": epoch,\n        }\n    )\n\nrun.finish()\n```\n\n### With PyTorch\n\n```python\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport swanlab\n\nrun = swanlab.init(\n    project=\"pytorch-demo\",\n    experiment_name=\"mnist-mlp\",\n    config={\n        \"learning_rate\": 1e-3,\n        \"batch_size\": 64,\n        \"epochs\": 10,\n        \"hidden_size\": 128,\n    },\n)\n\nmodel = nn.Sequential(\n    nn.Flatten(),\n    nn.Linear(28 * 28, run.config.hidden_size),\n    nn.ReLU(),\n    nn.Linear(run.config.hidden_size, 10),\n)\noptimizer = optim.Adam(model.parameters(), lr=run.config.learning_rate)\ncriterion = nn.CrossEntropyLoss()\n\nfor epoch in range(run.config.epochs):\n    model.train()\n    for batch_idx, (data, target) in enumerate(train_loader):\n        optimizer.zero_grad()\n        logits = model(data)\n        loss = criterion(logits, target)\n        loss.backward()\n        optimizer.step()\n\n        if batch_idx % 100 == 0:\n            swanlab.log(\n                {\n                    \"train\u002Floss\": loss.item(),\n                    \"train\u002Fepoch\": epoch,\n                    \"train\u002Fbatch\": batch_idx,\n                }\n            )\n\nrun.finish()\n```\n\n## Core Concepts\n\n### 1. Projects and Experiments\n\n**Project**: Collection of related experiments  \n**Experiment**: Single execution of a training or evaluation workflow\n\n```python\nimport swanlab\n\nrun = swanlab.init(\n    project=\"image-classification\",\n    experiment_name=\"resnet18-seed42\",\n    description=\"Baseline run on ImageNet subset\",\n    tags=[\"baseline\", \"resnet18\"],\n    config={\n        \"model\": \"resnet18\",\n        \"seed\": 42,\n        \"batch_size\": 64,\n        \"learning_rate\": 3e-4,\n    },\n)\n\nprint(run.id)\nprint(run.config.learning_rate)\n```\n\n### 2. Configuration Tracking\n\n```python\nconfig = {\n    \"model\": \"resnet18\",\n    \"seed\": 42,\n    \"batch_size\": 64,\n    \"learning_rate\": 3e-4,\n    \"epochs\": 20,\n}\n\nrun = swanlab.init(project=\"my-project\", config=config)\n\nlearning_rate = run.config.learning_rate\nbatch_size = run.config.batch_size\n```\n\n### 3. Metric Logging\n\n```python\n# Log scalars\nswanlab.log({\"loss\": 0.42, \"accuracy\": 0.91})\n\n# Log multiple metrics\nswanlab.log(\n    {\n        \"train\u002Floss\": train_loss,\n        \"train\u002Faccuracy\": train_acc,\n        \"val\u002Floss\": val_loss,\n        \"val\u002Faccuracy\": val_acc,\n        \"lr\": current_lr,\n        \"epoch\": epoch,\n    }\n)\n\n# Log with custom step\nswanlab.log({\"loss\": loss}, step=global_step)\n```\n\n### 4. Media and Chart Logging\n\n```python\nimport numpy as np\nimport swanlab\n\n# Image\nimage = np.random.randint(0, 255, (224, 224, 3), dtype=np.uint8)\nswanlab.log({\"examples\u002Fimage\": swanlab.Image(image, caption=\"Augmented sample\")})\n\n# Audio\nwave = np.sin(np.linspace(0, 8 * np.pi, 16000)).astype(\"float32\")\nswanlab.log({\"examples\u002Faudio\": swanlab.Audio(wave, sample_rate=16000)})\n\n# Text\nswanlab.log({\"examples\u002Ftext\": swanlab.Text(\"Training notes for this run.\")})\n\n# GIF video\nswanlab.log({\"examples\u002Fvideo\": swanlab.Video(\"predictions.gif\", caption=\"Validation rollout\")})\n\n# Point cloud\npoints = np.random.rand(128, 3).astype(\"float32\")\nswanlab.log({\"examples\u002Fpoint_cloud\": swanlab.Object3D(points, caption=\"Point cloud sample\")})\n\n# Molecule\nswanlab.log({\"examples\u002Fmolecule\": swanlab.Molecule.from_smiles(\"CCO\", caption=\"Ethanol\")})\n```\n\n```python\n# Custom chart with swanlab.echarts\nline = swanlab.echarts.Line()\nline.add_xaxis([\"epoch-1\", \"epoch-2\", \"epoch-3\"])\nline.add_yaxis(\"train\u002Floss\", [0.92, 0.61, 0.44])\nline.set_global_opts(\n    title_opts=swanlab.echarts.options.TitleOpts(title=\"Training Loss\")\n)\n\nswanlab.log({\"charts\u002Floss_curve\": line})\n```\n\nSee [references\u002Fvisualization.md](references\u002Fvisualization.md) for more chart and media patterns.\n\n### 5. Local and Self-Hosted Workflows\n\n```python\nimport os\nimport swanlab\n\n# Self-hosted or cloud login\nswanlab.login(\n    api_key=os.environ[\"SWANLAB_API_KEY\"],\n    host=\"http:\u002F\u002Fyour-server:5092\",\n)\n\n# Local-only logging\nrun = swanlab.init(\n    project=\"offline-demo\",\n    mode=\"local\",\n    logdir=\".\u002Fswanlog\",\n)\n\nswanlab.log({\"loss\": 0.35, \"epoch\": 1})\nrun.finish()\n```\n\n```bash\n# View local logs\nswanlab watch -l .\u002Fswanlog\n\n# Sync local logs later\nswanlab sync .\u002Fswanlog\n```\n\n## Integration Examples\n\n### HuggingFace Transformers\n\n```python\nfrom transformers import Trainer, TrainingArguments\n\ntraining_args = TrainingArguments(\n    output_dir=\".\u002Fresults\",\n    per_device_train_batch_size=8,\n    evaluation_strategy=\"epoch\",\n    logging_steps=50,\n    report_to=\"swanlab\",\n    run_name=\"bert-finetune\",\n)\n\ntrainer = Trainer(\n    model=model,\n    args=training_args,\n    train_dataset=train_dataset,\n    eval_dataset=eval_dataset,\n)\n\ntrainer.train()\n```\n\nSee [references\u002Fintegrations.md](references\u002Fintegrations.md) for callback-based setups and additional framework patterns.\n\n### PyTorch Lightning\n\n```python\nimport pytorch_lightning as pl\nfrom swanlab.integration.pytorch_lightning import SwanLabLogger\n\nswanlab_logger = SwanLabLogger(\n    project=\"lightning-demo\",\n    experiment_name=\"mnist-classifier\",\n    config={\"batch_size\": 64, \"max_epochs\": 10},\n)\n\ntrainer = pl.Trainer(\n    logger=swanlab_logger,\n    max_epochs=10,\n    accelerator=\"auto\",\n)\n\ntrainer.fit(model, train_loader, val_loader)\n```\n\n### Fastai\n\n```python\nfrom fastai.vision.all import accuracy, resnet34, vision_learner\nfrom swanlab.integration.fastai import SwanLabCallback\n\nlearn = vision_learner(dls, resnet34, metrics=accuracy)\nlearn.fit(\n    5,\n    cbs=[\n        SwanLabCallback(\n            project=\"fastai-demo\",\n            experiment_name=\"pets-classification\",\n            config={\"arch\": \"resnet34\", \"epochs\": 5},\n        )\n    ],\n)\n```\n\nSee [references\u002Fintegrations.md](references\u002Fintegrations.md) for fuller framework examples.\n\n## Best Practices\n\n### 1. Use Stable Metric Names\n\n```python\n# Good: grouped metric namespaces\nswanlab.log({\n    \"train\u002Floss\": train_loss,\n    \"train\u002Faccuracy\": train_acc,\n    \"val\u002Floss\": val_loss,\n    \"val\u002Faccuracy\": val_acc,\n})\n\n# Avoid mixing flat and grouped names for the same metric family\n```\n\n### 2. Initialize Early and Capture Config Once\n\n```python\nrun = swanlab.init(\n    project=\"image-classification\",\n    experiment_name=\"resnet18-baseline\",\n    config={\n        \"model\": \"resnet18\",\n        \"learning_rate\": 3e-4,\n        \"batch_size\": 64,\n        \"seed\": 42,\n    },\n)\n```\n\n### 3. Save Checkpoints Locally\n\n```python\nimport torch\nimport swanlab\n\ncheckpoint_path = \"checkpoints\u002Fbest.pth\"\ntorch.save(model.state_dict(), checkpoint_path)\n\nswanlab.log(\n    {\n        \"best\u002Fval_accuracy\": best_val_accuracy,\n        \"artifacts\u002Fcheckpoint_path\": swanlab.Text(checkpoint_path),\n    }\n)\n```\n\n### 4. Use Local Mode for Offline-First Workflows\n\n```python\nrun = swanlab.init(project=\"offline-demo\", mode=\"local\", logdir=\".\u002Fswanlog\")\n# ... training code ...\nrun.finish()\n\n# Inspect later with: swanlab watch -l .\u002Fswanlog\n```\n\n### 5. Keep Advanced Patterns in References\n\n- Use [references\u002Fvisualization.md](references\u002Fvisualization.md) for advanced chart and media patterns\n- Use [references\u002Fintegrations.md](references\u002Fintegrations.md) for callback-based and framework-specific integration details\n\n## Resources\n\n- [Official docs (Chinese)](https:\u002F\u002Fdocs.swanlab.cn)\n- [Official docs (English)](https:\u002F\u002Fdocs.swanlab.cn\u002Fen)\n- [GitHub repo](https:\u002F\u002Fgithub.com\u002FSwanHubX\u002FSwanLab)\n- [Self-hosted repo](https:\u002F\u002Fgithub.com\u002FSwanHubX\u002Fself-hosted)\n\n## See Also\n\n- [references\u002Fintegrations.md](references\u002Fintegrations.md) - Framework-specific examples\n- [references\u002Fvisualization.md](references\u002Fvisualization.md) - Charts and media logging patterns\n",{"name":5,"tags":49,"author":57,"license":15,"version":58,"description":7,"dependencies":59},[50,25,26,51,52,53,38,54,55,56],"MLOps","Open Source","Visualization","PyTorch","PyTorch Lightning","Fastai","Self-Hosted","Orchestra Research","1.0.0",[60,61,62],"swanlab>=0.7.11","pillow>=9.0.0","soundfile>=0.12.0","main","75c7c92896e878938460f0bceb23b6ab4a787286","AI-Research-SKILLs\u002F13-mlops\u002Fswanlab","https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud\u002Fskills","https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud","A postgraduate student majoring in mathematics.","2026-06-03 19:04:43",{"source":8,"skillName":5,"commands":71,"prompt":81,"zipAvailable":82},[72,75,78],{"tool":73,"command":74},"npx","npx skills add zhengliangliahu-cloud\u002Fskills --skill experiment-tracking-swanlab",{"tool":76,"command":77},"bunx","bunx skills add zhengliangliahu-cloud\u002Fskills --skill experiment-tracking-swanlab",{"tool":79,"command":80},"pnpm","pnpm dlx skills add zhengliangliahu-cloud\u002Fskills --skill experiment-tracking-swanlab","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud\u002Fskills\u002Fblob\u002Fmain\u002FAI-Research-SKILLs\u002F13-mlops\u002Fswanlab\u002FSKILL.md",true,[84,90],{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fintegrations.md","REFERENCE","参考文档",8017,"https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud\u002Fskills\u002Fblob\u002Fmain\u002FAI-Research-SKILLs\u002F13-mlops\u002Fswanlab\u002Freferences\u002Fintegrations.md",{"path":91,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fvisualization.md",5796,"https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud\u002Fskills\u002Fblob\u002Fmain\u002FAI-Research-SKILLs\u002F13-mlops\u002Fswanlab\u002Freferences\u002Fvisualization.md",[95,125,159,183,210,230],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":104,"publishedAt":44},"01M6NBV8V36BCHZ1K9F7EMRJP1","ara-rigor-reviewer","Performs ARA Seal Level 2 semantic epistemic review on Agent-Native Research Artifacts, scoring six dimensions (evidence relevance, falsifiability, scope calibration, argument coherence, exploration integrity, methodological rigor) and producing a constructive, severity-ranked report with a Strong Accept-to-Reject recommendation. Use after Level 1 structural validation passes, when an ARA needs an objective epistemic critique before publication or release.","https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud\u002Fskills\u002Fblob\u002Fmain\u002FAI-Research-SKILLs\u002F22-agent-native-research-artifact\u002Frigor-reviewer\u002FSKILL.md",[101],{"categoryNo":102,"categoryName":103,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",[105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124],"reviewer","ara rigor reviewer","ARA","review","release","audit","integrity","peer review","critique","exploration","scoring","dimensions","coherence","structural","scope","native","argument","epistemic","calibration","Research Artifacts",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":140,"publishedAt":44},"01M6NBTQTZ5G21FFPMEKHQZ3R3","ara-research-manager","Records research provenance as a post-task epilogue, scanning conversation history at the end of a coding or research session to extract decisions, experiments, dead ends, claims, heuristics, and pivots, and writing them into the ara\u002F directory with user-vs-AI provenance tags. Use as a session epilogue — never during execution — to maintain a faithful, auditable trace of how a research project actually evolved.","https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud\u002Fskills\u002Fblob\u002Fmain\u002FAI-Research-SKILLs\u002F22-agent-native-research-artifact\u002Fresearch-manager\u002FSKILL.md",[131,134,135],{"categoryNo":132,"categoryName":133,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":102,"categoryName":103,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":136,"categoryName":137,"taxonomyType":138,"taxonomyTypeDesc":139},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[141,142,143,144,145,146,147,148,149,150,151,152,114,153,154,155,156,157,158,107],"research","manager","ara research manager","writing","directory","heuristics","how","knowledge","knowledge management","never","scanning","conversation","maintain","project","end","recording","at","claims",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":169,"publishedAt":44},"01M6NBTCRK24WXZYKBD19RAV09","ara-compiler","Compiles any research input — PDF papers, GitHub repositories, experiment logs, code directories, or raw notes — into a complete Agent-Native Research Artifact (ARA) with cognitive layer (claims, concepts, heuristics), physical layer (configs, code stubs), exploration graph, and grounded evidence. Use when ingesting a paper or codebase into a structured, machine-executable knowledge package, building an ARA from scratch, or converting research outputs into a falsifiable, agent-traversable form.","https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud\u002Fskills\u002Fblob\u002Fmain\u002FAI-Research-SKILLs\u002F22-agent-native-research-artifact\u002Fcompiler\u002FSKILL.md",[165,168],{"categoryNo":166,"categoryName":167,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理",{"categoryNo":102,"categoryName":103,"taxonomyType":21,"taxonomyTypeDesc":22},[170,171,172,173,174,175,146,148,176,114,177,178,120,179,180,181,158,107,124,182],"compiler","ara compiler","PDF","notes","code","logs","ingestion","artifact","input","papers","directories","layer","Knowledge Extraction",{"skillNo":184,"name":185,"nameZh":6,"description":186,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":187,"categories":188,"keywords":190,"publishedAt":44},"01M6NBSXGH49PE13PF1H9P7F8N","creative-thinking-for-research","Applies cognitive science frameworks for creative thinking to CS and AI research ideation. Use when seeking genuinely novel research directions by leveraging combinatorial creativity, analogical reasoning, constraint manipulation, and other empirically grounded creative strategies.","https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud\u002Fskills\u002Fblob\u002Fmain\u002FAI-Research-SKILLs\u002F21-research-ideation\u002Fcreative-thinking-for-research\u002FSKILL.md",[189],{"categoryNo":102,"categoryName":103,"taxonomyType":21,"taxonomyTypeDesc":22},[141,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209],"creative","thinking","Creative Thinking","creative thinking for research","for","reasoning","science","use","ideation","frameworks","research ideation","strategies","problem","Analogical Reasoning","Problem Reformulation","novel","directions","orchestra","constraint",{"skillNo":211,"name":212,"nameZh":6,"description":213,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":214,"categories":215,"keywords":217,"publishedAt":44},"01M6NBSNHZYM70ZAFXQNESYYBG","brainstorming-research-ideas","Guides researchers through structured ideation frameworks to discover high-impact research directions. Use when exploring new problem spaces, pivoting between projects, or seeking novel angles on existing work.","https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud\u002Fskills\u002Fblob\u002Fmain\u002FAI-Research-SKILLs\u002F21-research-ideation\u002Fbrainstorming-research-ideas\u002FSKILL.md",[216],{"categoryNo":102,"categoryName":103,"taxonomyType":21,"taxonomyTypeDesc":22},[141,218,219,220,221,222,223,224,192,200,225,203,226,227,193,228,229,206,207,208],"brainstorming","ideas","brainstorming research ideas","discovery","projects","work","strategy","discover","impact","guides","Problem Discovery","Research Strategy",{"skillNo":231,"name":232,"nameZh":6,"description":233,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":234,"categories":235,"keywords":242,"publishedAt":44},"01M6NBS3Z3CJYH5225X73AZN3S","systems-paper-writing","Comprehensive guide for writing systems papers targeting OSDI, SOSP, ASPLOS, NSDI, and EuroSys. Provides paragraph-level structural blueprints, writing patterns, venue-specific checklists, reviewer guidelines, LaTeX templates, and conference deadlines. Use this skill for all systems conference paper writing.","https:\u002F\u002Fgithub.com\u002Fzhengliangliahu-cloud\u002Fskills\u002Fblob\u002Fmain\u002FAI-Research-SKILLs\u002F20-ml-paper-writing\u002Fsystems-paper-writing\u002FSKILL.md",[236,237,238,241],{"categoryNo":132,"categoryName":133,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":102,"categoryName":103,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":239,"categoryName":240,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":136,"categoryName":137,"taxonomyType":138,"taxonomyTypeDesc":139},[144,243,244,245,246,105,247,248,249,118,250,251,252,253,179,254,208,195,255,256],"Paper Writing","systems","paper","Systems Paper Writing","guide","Blueprint","patterns","OSDI","NSDI","ASPLOS","SOSP","targeting","EuroSys","Structural Blueprint"]