[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QM4FZRJ78VYTSP5BKQE4VT":3,"skill-same:01M6QM4FZRJ78VYTSP5BKQE4VT":97},{"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":64,"commitSha":65,"skillDirectory":66,"forksCount":14,"repositoryHtmlUrl":67,"repositoryHomepageUrl":68,"ownerHtmlUrl":69,"ownerBlogUrl":70,"ownerDescription":71,"updatedAt":72,"install":73,"resources":86},"01M6QM4FZRJ78VYTSP5BKQE4VT","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.","Tashima-Tarsh\u002FDisha6.6","Tashima-Tarsh","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F269906498?v=4","01M6PBH98X03XERH0HFT4PFB1P","NITISH KUMAR","01M6PBH9DA0M6KM3Z12P848F0K",0,"MIT","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Forch-swanlab\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]\ncategory: \"ai-research\"\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,"category":59,"description":7,"dependencies":60},[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","ai-research",[61,62,63],"swanlab>=0.7.11","pillow>=9.0.0","soundfile>=0.12.0","main","0da4485785ee599388900be50db1635489d53056",".agents\u002Fskills\u002Forch-swanlab","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6","https:\u002F\u002Fdisha6.6.thenitishkr.in\u002F","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh","www.thenitishkr","thenitishkr | AI • Cyber-security • Research\r\n","2026-11-08 03:33:25",{"source":8,"skillName":5,"commands":74,"prompt":84,"zipAvailable":85},[75,78,81],{"tool":76,"command":77},"npx","npx skills add Tashima-Tarsh\u002FDisha6.6 --skill experiment-tracking-swanlab",{"tool":79,"command":80},"bunx","bunx skills add Tashima-Tarsh\u002FDisha6.6 --skill experiment-tracking-swanlab",{"tool":82,"command":83},"pnpm","pnpm dlx skills add Tashima-Tarsh\u002FDisha6.6 --skill experiment-tracking-swanlab","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Forch-swanlab\u002FSKILL.md",true,[87,93],{"path":88,"resourceType":89,"resourceTypeDesc":90,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fintegrations.md","REFERENCE","参考文档",8017,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Forch-swanlab\u002Freferences\u002Fintegrations.md",{"path":94,"resourceType":89,"resourceTypeDesc":90,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fvisualization.md",5796,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Forch-swanlab\u002Freferences\u002Fvisualization.md",[98,128,153,180,203,226],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":107,"publishedAt":44},"01M6QRD07D4TGNDK6VJ4EHF8BV","youtube-full","Use when the user needs YouTube transcripts, video search, channel browsing, playlist extraction, or content monitoring. Trigger phrases: 'get the transcript for', 'search YouTube for', 'what are the latest videos on', 'list this playlist', 'monitor this channel', or any request involving a YouTube URL, video ID, or @handle. Do NOT use for downloading video or audio files, YouTube engagement data (likes, comments), or private\u002Fage-restricted videos.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fyoutube-full\u002FSKILL.md",[104],{"categoryNo":105,"categoryName":106,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",[108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127],"youtube full","youtube","full","transcript","search","monitoring","data","Video","Audio","list","files","do","get","age","trigger","URL","for","browsing","request","youtube transcripts",{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":44},"01M6QRCJ3112VYPA97YG7KGMC2","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fx-twitter-growth\u002FSKILL.md",[],[135,136,137,138,112,139,140,141,142,143,144,145,146,147,148,149,150,151,152,124],"twitter","x twitter growth","growth","research","content","engineering","plan","web search","competitors","analyze","engine","write","strategy","use","platform","grow","posting","competitive",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":162,"publishedAt":44},"01M6QRBN3EHQNJY42RERP7A149","write-a-skill","Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, build, or author a new skill.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrite-a-skill\u002FSKILL.md",[159],{"categoryNo":160,"categoryName":161,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[163,146,164,165,166,167,168,169,148,170,171,64,172,173,174,175,176,177,178,179],"write a skill","github","create","https","productivity","matt pocock","direct","example","build","new skill","structure","new agent","resources","with","tree","progressive disclosure","author",{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":44},"01M6QRB6G8P33PNGAF9Y69EJ9T","wrap-up","Close out a launched Claude Managed Agent — recap every primitive the founder now owns, regenerate the single-file overview page, and suggest the next 1-2 upgrades. Use when the user says \"wrap up\", \"close this out\", \"what do I own now\", \"give me the summary\", \"recap the agent\", or when the orchestrator routes phase=wrap-up. primitives_inventory.py tables everything owned (agent, environment, session, memory, outcome, deployment); overview_page.py regenerates a self-contained .\u002Fmy-agent\u002Fagent-overview.html; upgrade_suggester.py ranks the next moves from recorded deferrals plus standing hardening steps. Companion to run-without-you; the last stop before phase=done.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrap-up\u002FSKILL.md",[],[187,188,189,190,191,42,192,193,194,148,195,119,196,197,198,199,32,200,201,202],"wrap up","up","wrap","gemini","deployment","file","hardening","closeout","stop","upgrade","founder","close","companion","tables","directions","phase",{"skillNo":204,"name":205,"nameZh":6,"description":206,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":207,"categories":208,"keywords":210,"publishedAt":44},"01M6QRA5AYC1RBFZ39GTWGS3N8","workflow-builder","Design and write deterministic multi-agent workflow scripts (.js files in .claude\u002Fworkflows\u002F) for Claude Code's Workflow tool. Use when a user wants to build, create, author, scaffold, or run a custom Claude Code workflow, orchestrate sub-agents (fan-out, pipeline, loop, judge-panel), or automate a repeatable multi-step task across fresh-context agents.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworkflow-builder\u002FSKILL.md",[209],{"categoryNo":160,"categoryName":161,"taxonomyType":21,"taxonomyTypeDesc":22},[211,212,213,214,30,165,42,215,216,217,218,219,146,220,118,221,222,223,224,225],"workflow","workflow builder","builder","design","code","orchestrate","pipeline","loop","multi-agent","context","across","fresh","scripts","judge","claude code workflow",{"skillNo":227,"name":228,"nameZh":6,"description":229,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":230,"categories":231,"keywords":232,"publishedAt":44},"01M6QR7QMCZESKQA0ERW1E657M","weekly-review","Use when someone wants to run a weekly review, close open loops, audit stalled projects and commitments, get their system back to trusted, restart a lapsed review habit, or says \"\u002Fcs:weekly-review\". Walks David Allen's three-phase loop — GET CLEAR, GET CURRENT, GET CREATIVE — with deterministic scripts that inventory open loops, gate the checklist with named gaps, and score commitment health 0-100.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fweekly-review\u002FSKILL.md",[],[233,234,235,236,237,238,239,35,240,218,241,242,243,244,245,246,120,247,248,202],"review","weekly review","weekly","deterministic scripts","reflect","feeds","inventory","team","projects","project-management","scanner","conversation","back","project","sprint","cadence"]