[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6MB8K0VSWWHQ0FHRWDGJRWB":3,"skill-same:01M6MB8K0VSWWHQ0FHRWDGJRWB":101},{"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":55,"commitSha":56,"skillDirectory":57,"forksCount":58,"repositoryHtmlUrl":59,"repositoryHomepageUrl":60,"ownerHtmlUrl":61,"ownerBlogUrl":62,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M6MB8K0VSWWHQ0FHRWDGJRWB","tensorboard",null,"Logs and views ML training data in TensorBoard using PyTorch SummaryWriter and TensorFlow\u002FKeras callbacks: scalars, images, text, histograms, model graphs, embedding projector, hyperparameter tables, PR curves, and TensorFlow or PyTorch profiler traces. Use when plotting loss and accuracy curves during training, comparing multiple runs in one dashboard, inspecting weight and gradient distributions, projecting embeddings with PCA or t-SNE, tracking hyperparameter experiments, or finding performance bottlenecks in a training loop. Not for hosted experiment tracking with team collaboration; use a dedicated tracking service for that.","hashgraph-online\u002Fawesome-codex-plugins","hashgraph-online","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160371962?v=4","01M6CNB6NRJVNNGN14TR01Q6D3","HOL (Hashgraph Online)","01M6JT1HSKKG9V68KQAQGBA7XP",1575,"MIT","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fskills\u002Ftensorboard\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000013","分析与可视化","SCENARIO","使用场景",[5,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"team","when","Callbacks","Experiment Tracking","embedding","distributions","images","model","text","loop","performance","performance profiling","data","logs","embeddings","visualization","debugging","training","pytorch","dashboard","2026-11-10 10:12:30",false,"---\nname: tensorboard\ndescription: 'Logs and views ML training data in TensorBoard using PyTorch SummaryWriter and TensorFlow\u002FKeras callbacks: scalars, images, text, histograms, model graphs, embedding projector, hyperparameter tables, PR curves, and TensorFlow or PyTorch profiler traces. Use when plotting loss and accuracy curves during training, comparing multiple runs in one dashboard, inspecting weight and gradient distributions, projecting embeddings with PCA or t-SNE, tracking hyperparameter experiments, or finding performance bottlenecks in a training loop. Not for hosted experiment tracking with team collaboration; use a dedicated tracking service for that.'\nlicense: MIT\nmetadata:\n  version: 1.0.0\n  category: ml-inference-and-ops\n  maintainer: Kalaris Labs\n  tags: MLOps, TensorBoard, Visualization, Training Metrics, Model Debugging, PyTorch, TensorFlow, Experiment Tracking, Performance Profiling\n  dependencies: tensorboard, torch, tensorflow\n---\n\n# TensorBoard: Visualization Toolkit for ML\n\n## When to Use This Skill\n\nUse TensorBoard when you need to:\n- **Visualize training metrics** like loss and accuracy over time\n- **Debug models** with histograms and distributions\n- **Compare experiments** across multiple runs\n- **Visualize model graphs** and architecture\n- **Project embeddings** to lower dimensions (t-SNE, PCA)\n- **Track hyperparameter** experiments\n- **Profile performance** and identify bottlenecks\n- **Visualize images and text** during training\n\n\n## Installation\n\n```bash\n# Install TensorBoard\npip install tensorboard\n\n# PyTorch integration\npip install torch torchvision tensorboard\n\n# TensorFlow integration (TensorBoard included)\npip install tensorflow\n\n# Launch TensorBoard\ntensorboard --logdir=runs\n# Access at http:\u002F\u002Flocalhost:6006\n```\n\n## Quick Start\n\n### PyTorch\n\n```python\nfrom torch.utils.tensorboard import SummaryWriter\n\n# Create writer\nwriter = SummaryWriter('runs\u002Fexperiment_1')\n\n# Training loop\nfor epoch in range(10):\n    train_loss = train_epoch()\n    val_acc = validate()\n\n    # Log metrics\n    writer.add_scalar('Loss\u002Ftrain', train_loss, epoch)\n    writer.add_scalar('Accuracy\u002Fval', val_acc, epoch)\n\n# Close writer\nwriter.close()\n\n# Launch: tensorboard --logdir=runs\n```\n\n### TensorFlow\u002FKeras\n\n```python\nimport tensorflow as tf\n\n# Create callback\ntensorboard_callback = tf.keras.callbacks.TensorBoard(\n    log_dir='logs\u002Ffit',\n    histogram_freq=1\n)\n\n# Train model\nmodel.fit(\n    x_train, y_train,\n    epochs=10,\n    validation_data=(x_val, y_val),\n    callbacks=[tensorboard_callback]\n)\n\n# Launch: tensorboard --logdir=logs\n```\n\n## Core Concepts\n\n### 1. SummaryWriter (PyTorch)\n\n```python\nfrom torch.utils.tensorboard import SummaryWriter\n\n# Default directory: runs\u002FCURRENT_DATETIME\nwriter = SummaryWriter()\n\n# Custom directory\nwriter = SummaryWriter('runs\u002Fexperiment_1')\n\n# Custom comment (appended to default directory)\nwriter = SummaryWriter(comment='baseline')\n\n# Log data\nwriter.add_scalar('Loss\u002Ftrain', 0.5, step=0)\nwriter.add_scalar('Loss\u002Ftrain', 0.3, step=1)\n\n# Flush and close\nwriter.flush()\nwriter.close()\n```\n\n### 2. Logging Scalars\n\n```python\n# PyTorch\nfrom torch.utils.tensorboard import SummaryWriter\nwriter = SummaryWriter()\n\nfor epoch in range(100):\n    train_loss = train()\n    val_loss = validate()\n\n    # Log individual metrics\n    writer.add_scalar('Loss\u002Ftrain', train_loss, epoch)\n    writer.add_scalar('Loss\u002Fval', val_loss, epoch)\n    writer.add_scalar('Accuracy\u002Ftrain', train_acc, epoch)\n    writer.add_scalar('Accuracy\u002Fval', val_acc, epoch)\n\n    # Learning rate\n    lr = optimizer.param_groups[0]['lr']\n    writer.add_scalar('Learning_rate', lr, epoch)\n\nwriter.close()\n```\n\n```python\n# TensorFlow\nimport tensorflow as tf\n\ntrain_summary_writer = tf.summary.create_file_writer('logs\u002Ftrain')\nval_summary_writer = tf.summary.create_file_writer('logs\u002Fval')\n\nfor epoch in range(100):\n    with train_summary_writer.as_default():\n        tf.summary.scalar('loss', train_loss, step=epoch)\n        tf.summary.scalar('accuracy', train_acc, step=epoch)\n\n    with val_summary_writer.as_default():\n        tf.summary.scalar('loss', val_loss, step=epoch)\n        tf.summary.scalar('accuracy', val_acc, step=epoch)\n```\n\n### 3. Logging Multiple Scalars\n\n```python\n# PyTorch: Group related metrics\nwriter.add_scalars('Loss', {\n    'train': train_loss,\n    'validation': val_loss,\n    'test': test_loss\n}, epoch)\n\nwriter.add_scalars('Metrics', {\n    'accuracy': accuracy,\n    'precision': precision,\n    'recall': recall,\n    'f1': f1_score\n}, epoch)\n```\n\n### 4. Logging Images\n\n```python\n# PyTorch\nimport torch\nfrom torchvision.utils import make_grid\n\n# Single image\nwriter.add_image('Input\u002Fsample', img_tensor, epoch)\n\n# Multiple images as grid\nimg_grid = make_grid(images[:64], nrow=8)\nwriter.add_image('Batch\u002Finputs', img_grid, epoch)\n\n# Predictions visualization\npred_grid = make_grid(predictions[:16], nrow=4)\nwriter.add_image('Predictions', pred_grid, epoch)\n```\n\n```python\n# TensorFlow\nimport tensorflow as tf\n\nwith file_writer.as_default():\n    # Encode images as PNG\n    tf.summary.image('Training samples', images, step=epoch, max_outputs=25)\n```\n\n### 5. Logging Histograms\n\n```python\n# PyTorch: Track weight distributions\nfor name, param in model.named_parameters():\n    writer.add_histogram(name, param, epoch)\n\n    # Track gradients\n    if param.grad is not None:\n        writer.add_histogram(f'{name}.grad', param.grad, epoch)\n\n# Track activations\nwriter.add_histogram('Activations\u002Frelu1', activations, epoch)\n```\n\n```python\n# TensorFlow\nwith file_writer.as_default():\n    tf.summary.histogram('weights\u002Flayer1', layer1.kernel, step=epoch)\n    tf.summary.histogram('activations\u002Frelu1', activations, step=epoch)\n```\n\n### 6. Logging Model Graph\n\n```python\n# PyTorch\nimport torch\n\nmodel = MyModel()\ndummy_input = torch.randn(1, 3, 224, 224)\n\nwriter.add_graph(model, dummy_input)\nwriter.close()\n```\n\n```python\n# TensorFlow (automatic with Keras)\ntensorboard_callback = tf.keras.callbacks.TensorBoard(\n    log_dir='logs',\n    write_graph=True\n)\n\nmodel.fit(x, y, callbacks=[tensorboard_callback])\n```\n\n## Advanced Features\n\nDetails, code examples and parameter tables: [references\u002Fadvanced-features.md](references\u002Fadvanced-features.md). Read it when this step applies.\n\n## Integration Examples\n\nDetails, code examples and parameter tables: [references\u002Fintegration-examples.md](references\u002Fintegration-examples.md). Read it when this step applies.\n\n## Comparing Experiments\n\n### Multiple Runs\n\n```bash\n# Run experiments with different configs\npython train.py --lr 0.001 --logdir runs\u002Fexp1\npython train.py --lr 0.01 --logdir runs\u002Fexp2\npython train.py --lr 0.1 --logdir runs\u002Fexp3\n\n# View all runs together\ntensorboard --logdir=runs\n```\n\n**In TensorBoard:**\n- All runs appear in the same dashboard\n- Toggle runs on\u002Foff for comparison\n- Use regex to filter run names\n- Overlay charts to compare metrics\n\n### Organizing Experiments\n\n```python\n# Hierarchical organization\nruns\u002F\n├── baseline\u002F\n│   ├── run_1\u002F\n│   └── run_2\u002F\n├── improved\u002F\n│   ├── run_1\u002F\n│   └── run_2\u002F\n└── final\u002F\n    └── run_1\u002F\n\n# Log with hierarchy\nwriter = SummaryWriter('runs\u002Fbaseline\u002Frun_1')\n```\n\n## Best Practices\n\n### 1. Use Descriptive Run Names\n\n```python\n# ✅ Good: Descriptive names\nfrom datetime import datetime\ntimestamp = datetime.now().strftime('%Y%m%d_%H%M%S')\nwriter = SummaryWriter(f'runs\u002Fresnet50_lr0.001_bs32_{timestamp}')\n\n# ❌ Bad: Auto-generated names\nwriter = SummaryWriter()  # Creates runs\u002FJan01_12-34-56_hostname\n```\n\n### 2. Group Related Metrics\n\n```python\n# ✅ Good: Grouped metrics\nwriter.add_scalar('Loss\u002Ftrain', train_loss, step)\nwriter.add_scalar('Loss\u002Fval', val_loss, step)\nwriter.add_scalar('Accuracy\u002Ftrain', train_acc, step)\nwriter.add_scalar('Accuracy\u002Fval', val_acc, step)\n\n# ❌ Bad: Flat namespace\nwriter.add_scalar('train_loss', train_loss, step)\nwriter.add_scalar('val_loss', val_loss, step)\n```\n\n### 3. Log Regularly but Not Too Often\n\n```python\n# ✅ Good: Log epoch metrics always, batch metrics occasionally\nfor epoch in range(100):\n    for batch_idx, (data, target) in enumerate(train_loader):\n        loss = train_step(data, target)\n\n        # Log every 100 batches\n        if batch_idx % 100 == 0:\n            writer.add_scalar('Loss\u002Fbatch', loss, global_step)\n\n    # Always log epoch metrics\n    writer.add_scalar('Loss\u002Fepoch', epoch_loss, epoch)\n\n# ❌ Bad: Log every batch (creates huge log files)\nfor batch in train_loader:\n    writer.add_scalar('Loss', loss, step)  # Too frequent\n```\n\n### 4. Close Writer When Done\n\n```python\n# ✅ Good: Use context manager\nwith SummaryWriter('runs\u002Fexp1') as writer:\n    for epoch in range(10):\n        writer.add_scalar('Loss', loss, epoch)\n# Automatically closes\n\n# Or manually\nwriter = SummaryWriter('runs\u002Fexp1')\n# ... logging ...\nwriter.close()\n```\n\n### 5. Use Separate Writers for Train\u002FVal\n\n```python\n# ✅ Good: Separate log directories\ntrain_writer = SummaryWriter('runs\u002Fexp1\u002Ftrain')\nval_writer = SummaryWriter('runs\u002Fexp1\u002Fval')\n\ntrain_writer.add_scalar('loss', train_loss, epoch)\nval_writer.add_scalar('loss', val_loss, epoch)\n```\n\n## Performance Profiling\n\n### TensorFlow Profiler\n\n```python\n# Enable profiling\ntensorboard_callback = tf.keras.callbacks.TensorBoard(\n    log_dir='logs',\n    profile_batch='10,20'  # Profile batches 10-20\n)\n\nmodel.fit(x, y, callbacks=[tensorboard_callback])\n\n# View in TensorBoard Profile tab\n# Shows: GPU utilization, kernel stats, memory usage, bottlenecks\n```\n\n### PyTorch Profiler\n\n```python\nimport torch.profiler as profiler\n\nwith profiler.profile(\n    activities=[\n        profiler.ProfilerActivity.CPU,\n        profiler.ProfilerActivity.CUDA\n    ],\n    on_trace_ready=torch.profiler.tensorboard_trace_handler('.\u002Fruns\u002Fprofiler'),\n    record_shapes=True,\n    with_stack=True\n) as prof:\n    for batch in train_loader:\n        loss = train_step(batch)\n        prof.step()\n\n# View in TensorBoard Profile tab\n```\n\n## Resources\n\n- **Documentation**: https:\u002F\u002Fwww.tensorflow.org\u002Ftensorboard\n- **PyTorch Integration**: https:\u002F\u002Fpytorch.org\u002Fdocs\u002Fstable\u002Ftensorboard.html\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Ftensorboard\n- **TensorBoard.dev**: https:\u002F\u002Ftensorboard.dev (share experiments publicly)\n\n## See Also\n\n- `references\u002Fvisualization.md` - Comprehensive visualization guide\n- `references\u002Fprofiling.md` - Performance profiling patterns\n- `references\u002Fintegrations.md` - Framework-specific integration examples\n\n## Agent operating procedure\n\n1. **Check the environment.** Confirm hardware, framework and server versions, model format, and expected load.\n2. **Pin down the inputs.** Confirm formats, identifiers and parameters from the data or the user. Ask rather than guess any value that changes the result.\n3. **Run a small version first.** Serve or log a single request or run end to end before scaling.\n4. **Execute the full task** using the instructions and references above.\n5. **Validate the result.** Measure latency, throughput and output correctness against a reference; check resource usage and costs.\n6. **Report.** State what was run (versions, commands, parameters), what was checked, and what is still uncertain.\n\n| If this happens | Do this |\n|---|---|\n| The server fails to start or OOMs | Check model size versus memory, quantization and parallelism settings. |\n| A function, flag or endpoint in these instructions is missing in the installed version | Check the installed version's own documentation (`help()`, `--help`, official docs), adapt, and tell the user. Never invent an API. |\n| A required input, identifier or parameter is ambiguous | Ask the user, or state the assumption explicitly before running. |\n\n**Integrity rules**\n\n- Never fabricate results, parameters, identifiers, citations or statistics. If something cannot be run or verified, say so plainly.\n- Do not expose services or credentials publicly; confirm cloud costs before provisioning.\n- Treat version-specific details here as possibly outdated: confirm them against the official documentation for the installed version.\n- Ask before actions that cost money, consume shared GPUs or cloud quota, touch personal or patient data, or cannot be undone.\n","# TensorBoard: Visualization Toolkit for ML\n\n## When to Use This Skill\n\nUse TensorBoard when you need to:\n- **Visualize training metrics** like loss and accuracy over time\n- **Debug models** with histograms and distributions\n- **Compare experiments** across multiple runs\n- **Visualize model graphs** and architecture\n- **Project embeddings** to lower dimensions (t-SNE, PCA)\n- **Track hyperparameter** experiments\n- **Profile performance** and identify bottlenecks\n- **Visualize images and text** during training\n\n\n## Installation\n\n```bash\n# Install TensorBoard\npip install tensorboard\n\n# PyTorch integration\npip install torch torchvision tensorboard\n\n# TensorFlow integration (TensorBoard included)\npip install tensorflow\n\n# Launch TensorBoard\ntensorboard --logdir=runs\n# Access at http:\u002F\u002Flocalhost:6006\n```\n\n## Quick Start\n\n### PyTorch\n\n```python\nfrom torch.utils.tensorboard import SummaryWriter\n\n# Create writer\nwriter = SummaryWriter('runs\u002Fexperiment_1')\n\n# Training loop\nfor epoch in range(10):\n    train_loss = train_epoch()\n    val_acc = validate()\n\n    # Log metrics\n    writer.add_scalar('Loss\u002Ftrain', train_loss, epoch)\n    writer.add_scalar('Accuracy\u002Fval', val_acc, epoch)\n\n# Close writer\nwriter.close()\n\n# Launch: tensorboard --logdir=runs\n```\n\n### TensorFlow\u002FKeras\n\n```python\nimport tensorflow as tf\n\n# Create callback\ntensorboard_callback = tf.keras.callbacks.TensorBoard(\n    log_dir='logs\u002Ffit',\n    histogram_freq=1\n)\n\n# Train model\nmodel.fit(\n    x_train, y_train,\n    epochs=10,\n    validation_data=(x_val, y_val),\n    callbacks=[tensorboard_callback]\n)\n\n# Launch: tensorboard --logdir=logs\n```\n\n## Core Concepts\n\n### 1. SummaryWriter (PyTorch)\n\n```python\nfrom torch.utils.tensorboard import SummaryWriter\n\n# Default directory: runs\u002FCURRENT_DATETIME\nwriter = SummaryWriter()\n\n# Custom directory\nwriter = SummaryWriter('runs\u002Fexperiment_1')\n\n# Custom comment (appended to default directory)\nwriter = SummaryWriter(comment='baseline')\n\n# Log data\nwriter.add_scalar('Loss\u002Ftrain', 0.5, step=0)\nwriter.add_scalar('Loss\u002Ftrain', 0.3, step=1)\n\n# Flush and close\nwriter.flush()\nwriter.close()\n```\n\n### 2. Logging Scalars\n\n```python\n# PyTorch\nfrom torch.utils.tensorboard import SummaryWriter\nwriter = SummaryWriter()\n\nfor epoch in range(100):\n    train_loss = train()\n    val_loss = validate()\n\n    # Log individual metrics\n    writer.add_scalar('Loss\u002Ftrain', train_loss, epoch)\n    writer.add_scalar('Loss\u002Fval', val_loss, epoch)\n    writer.add_scalar('Accuracy\u002Ftrain', train_acc, epoch)\n    writer.add_scalar('Accuracy\u002Fval', val_acc, epoch)\n\n    # Learning rate\n    lr = optimizer.param_groups[0]['lr']\n    writer.add_scalar('Learning_rate', lr, epoch)\n\nwriter.close()\n```\n\n```python\n# TensorFlow\nimport tensorflow as tf\n\ntrain_summary_writer = tf.summary.create_file_writer('logs\u002Ftrain')\nval_summary_writer = tf.summary.create_file_writer('logs\u002Fval')\n\nfor epoch in range(100):\n    with train_summary_writer.as_default():\n        tf.summary.scalar('loss', train_loss, step=epoch)\n        tf.summary.scalar('accuracy', train_acc, step=epoch)\n\n    with val_summary_writer.as_default():\n        tf.summary.scalar('loss', val_loss, step=epoch)\n        tf.summary.scalar('accuracy', val_acc, step=epoch)\n```\n\n### 3. Logging Multiple Scalars\n\n```python\n# PyTorch: Group related metrics\nwriter.add_scalars('Loss', {\n    'train': train_loss,\n    'validation': val_loss,\n    'test': test_loss\n}, epoch)\n\nwriter.add_scalars('Metrics', {\n    'accuracy': accuracy,\n    'precision': precision,\n    'recall': recall,\n    'f1': f1_score\n}, epoch)\n```\n\n### 4. Logging Images\n\n```python\n# PyTorch\nimport torch\nfrom torchvision.utils import make_grid\n\n# Single image\nwriter.add_image('Input\u002Fsample', img_tensor, epoch)\n\n# Multiple images as grid\nimg_grid = make_grid(images[:64], nrow=8)\nwriter.add_image('Batch\u002Finputs', img_grid, epoch)\n\n# Predictions visualization\npred_grid = make_grid(predictions[:16], nrow=4)\nwriter.add_image('Predictions', pred_grid, epoch)\n```\n\n```python\n# TensorFlow\nimport tensorflow as tf\n\nwith file_writer.as_default():\n    # Encode images as PNG\n    tf.summary.image('Training samples', images, step=epoch, max_outputs=25)\n```\n\n### 5. Logging Histograms\n\n```python\n# PyTorch: Track weight distributions\nfor name, param in model.named_parameters():\n    writer.add_histogram(name, param, epoch)\n\n    # Track gradients\n    if param.grad is not None:\n        writer.add_histogram(f'{name}.grad', param.grad, epoch)\n\n# Track activations\nwriter.add_histogram('Activations\u002Frelu1', activations, epoch)\n```\n\n```python\n# TensorFlow\nwith file_writer.as_default():\n    tf.summary.histogram('weights\u002Flayer1', layer1.kernel, step=epoch)\n    tf.summary.histogram('activations\u002Frelu1', activations, step=epoch)\n```\n\n### 6. Logging Model Graph\n\n```python\n# PyTorch\nimport torch\n\nmodel = MyModel()\ndummy_input = torch.randn(1, 3, 224, 224)\n\nwriter.add_graph(model, dummy_input)\nwriter.close()\n```\n\n```python\n# TensorFlow (automatic with Keras)\ntensorboard_callback = tf.keras.callbacks.TensorBoard(\n    log_dir='logs',\n    write_graph=True\n)\n\nmodel.fit(x, y, callbacks=[tensorboard_callback])\n```\n\n## Advanced Features\n\nDetails, code examples and parameter tables: [references\u002Fadvanced-features.md](references\u002Fadvanced-features.md). Read it when this step applies.\n\n## Integration Examples\n\nDetails, code examples and parameter tables: [references\u002Fintegration-examples.md](references\u002Fintegration-examples.md). Read it when this step applies.\n\n## Comparing Experiments\n\n### Multiple Runs\n\n```bash\n# Run experiments with different configs\npython train.py --lr 0.001 --logdir runs\u002Fexp1\npython train.py --lr 0.01 --logdir runs\u002Fexp2\npython train.py --lr 0.1 --logdir runs\u002Fexp3\n\n# View all runs together\ntensorboard --logdir=runs\n```\n\n**In TensorBoard:**\n- All runs appear in the same dashboard\n- Toggle runs on\u002Foff for comparison\n- Use regex to filter run names\n- Overlay charts to compare metrics\n\n### Organizing Experiments\n\n```python\n# Hierarchical organization\nruns\u002F\n├── baseline\u002F\n│   ├── run_1\u002F\n│   └── run_2\u002F\n├── improved\u002F\n│   ├── run_1\u002F\n│   └── run_2\u002F\n└── final\u002F\n    └── run_1\u002F\n\n# Log with hierarchy\nwriter = SummaryWriter('runs\u002Fbaseline\u002Frun_1')\n```\n\n## Best Practices\n\n### 1. Use Descriptive Run Names\n\n```python\n# ✅ Good: Descriptive names\nfrom datetime import datetime\ntimestamp = datetime.now().strftime('%Y%m%d_%H%M%S')\nwriter = SummaryWriter(f'runs\u002Fresnet50_lr0.001_bs32_{timestamp}')\n\n# ❌ Bad: Auto-generated names\nwriter = SummaryWriter()  # Creates runs\u002FJan01_12-34-56_hostname\n```\n\n### 2. Group Related Metrics\n\n```python\n# ✅ Good: Grouped metrics\nwriter.add_scalar('Loss\u002Ftrain', train_loss, step)\nwriter.add_scalar('Loss\u002Fval', val_loss, step)\nwriter.add_scalar('Accuracy\u002Ftrain', train_acc, step)\nwriter.add_scalar('Accuracy\u002Fval', val_acc, step)\n\n# ❌ Bad: Flat namespace\nwriter.add_scalar('train_loss', train_loss, step)\nwriter.add_scalar('val_loss', val_loss, step)\n```\n\n### 3. Log Regularly but Not Too Often\n\n```python\n# ✅ Good: Log epoch metrics always, batch metrics occasionally\nfor epoch in range(100):\n    for batch_idx, (data, target) in enumerate(train_loader):\n        loss = train_step(data, target)\n\n        # Log every 100 batches\n        if batch_idx % 100 == 0:\n            writer.add_scalar('Loss\u002Fbatch', loss, global_step)\n\n    # Always log epoch metrics\n    writer.add_scalar('Loss\u002Fepoch', epoch_loss, epoch)\n\n# ❌ Bad: Log every batch (creates huge log files)\nfor batch in train_loader:\n    writer.add_scalar('Loss', loss, step)  # Too frequent\n```\n\n### 4. Close Writer When Done\n\n```python\n# ✅ Good: Use context manager\nwith SummaryWriter('runs\u002Fexp1') as writer:\n    for epoch in range(10):\n        writer.add_scalar('Loss', loss, epoch)\n# Automatically closes\n\n# Or manually\nwriter = SummaryWriter('runs\u002Fexp1')\n# ... logging ...\nwriter.close()\n```\n\n### 5. Use Separate Writers for Train\u002FVal\n\n```python\n# ✅ Good: Separate log directories\ntrain_writer = SummaryWriter('runs\u002Fexp1\u002Ftrain')\nval_writer = SummaryWriter('runs\u002Fexp1\u002Fval')\n\ntrain_writer.add_scalar('loss', train_loss, epoch)\nval_writer.add_scalar('loss', val_loss, epoch)\n```\n\n## Performance Profiling\n\n### TensorFlow Profiler\n\n```python\n# Enable profiling\ntensorboard_callback = tf.keras.callbacks.TensorBoard(\n    log_dir='logs',\n    profile_batch='10,20'  # Profile batches 10-20\n)\n\nmodel.fit(x, y, callbacks=[tensorboard_callback])\n\n# View in TensorBoard Profile tab\n# Shows: GPU utilization, kernel stats, memory usage, bottlenecks\n```\n\n### PyTorch Profiler\n\n```python\nimport torch.profiler as profiler\n\nwith profiler.profile(\n    activities=[\n        profiler.ProfilerActivity.CPU,\n        profiler.ProfilerActivity.CUDA\n    ],\n    on_trace_ready=torch.profiler.tensorboard_trace_handler('.\u002Fruns\u002Fprofiler'),\n    record_shapes=True,\n    with_stack=True\n) as prof:\n    for batch in train_loader:\n        loss = train_step(batch)\n        prof.step()\n\n# View in TensorBoard Profile tab\n```\n\n## Resources\n\n- **Documentation**: https:\u002F\u002Fwww.tensorflow.org\u002Ftensorboard\n- **PyTorch Integration**: https:\u002F\u002Fpytorch.org\u002Fdocs\u002Fstable\u002Ftensorboard.html\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Ftensorboard\n- **TensorBoard.dev**: https:\u002F\u002Ftensorboard.dev (share experiments publicly)\n\n## See Also\n\n- `references\u002Fvisualization.md` - Comprehensive visualization guide\n- `references\u002Fprofiling.md` - Performance profiling patterns\n- `references\u002Fintegrations.md` - Framework-specific integration examples\n\n## Agent operating procedure\n\n1. **Check the environment.** Confirm hardware, framework and server versions, model format, and expected load.\n2. **Pin down the inputs.** Confirm formats, identifiers and parameters from the data or the user. Ask rather than guess any value that changes the result.\n3. **Run a small version first.** Serve or log a single request or run end to end before scaling.\n4. **Execute the full task** using the instructions and references above.\n5. **Validate the result.** Measure latency, throughput and output correctness against a reference; check resource usage and costs.\n6. **Report.** State what was run (versions, commands, parameters), what was checked, and what is still uncertain.\n\n| If this happens | Do this |\n|---|---|\n| The server fails to start or OOMs | Check model size versus memory, quantization and parallelism settings. |\n| A function, flag or endpoint in these instructions is missing in the installed version | Check the installed version's own documentation (`help()`, `--help`, official docs), adapt, and tell the user. Never invent an API. |\n| A required input, identifier or parameter is ambiguous | Ask the user, or state the assumption explicitly before running. |\n\n**Integrity rules**\n\n- Never fabricate results, parameters, identifiers, citations or statistics. If something cannot be run or verified, say so plainly.\n- Do not expose services or credentials publicly; confirm cloud costs before provisioning.\n- Treat version-specific details here as possibly outdated: confirm them against the official documentation for the installed version.\n- Ask before actions that cost money, consume shared GPUs or cloud quota, touch personal or patient data, or cannot be undone.\n",{"name":5,"license":15,"metadata":49,"description":7},{"tags":50,"version":51,"category":52,"maintainer":53,"dependencies":54},"MLOps, TensorBoard, Visualization, Training Metrics, Model Debugging, PyTorch, TensorFlow, Experiment Tracking, Performance Profiling","1.0.0","ml-inference-and-ops","Kalaris Labs","tensorboard, torch, tensorflow","main","2b63f856ce19c2a797929cacabd9e0fc936812fa","plugins\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fskills\u002Ftensorboard",491,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins","https:\u002F\u002Fhol.org\u002Fplugins\u002Fbest-codex-plugins","https:\u002F\u002Fgithub.com\u002Fhashgraph-online","https:\u002F\u002Fhol.org","Open-source standards and developer tools for interoperable AI agents: discovery, identity, communication, payments, privacy and security.","2026-11-14 14:06:13",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add hashgraph-online\u002Fawesome-codex-plugins --skill tensorboard",{"tool":71,"command":72},"bunx","bunx skills add hashgraph-online\u002Fawesome-codex-plugins --skill tensorboard",{"tool":74,"command":75},"pnpm","pnpm dlx skills add hashgraph-online\u002Fawesome-codex-plugins --skill tensorboard","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fskills\u002Ftensorboard\u002FSKILL.md",true,[79,85,89,93,97],{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fadvanced-features.md","REFERENCE","参考文档",2290,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fskills\u002Ftensorboard\u002Freferences\u002Fadvanced-features.md",{"path":86,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fintegration-examples.md",3310,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fskills\u002Ftensorboard\u002Freferences\u002Fintegration-examples.md",{"path":90,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fintegrations.md",16205,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fskills\u002Ftensorboard\u002Freferences\u002Fintegrations.md",{"path":94,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fprofiling.md",13337,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fskills\u002Ftensorboard\u002Freferences\u002Fprofiling.md",{"path":98,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fvisualization.md",14897,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FKalarisLabs\u002Fresearch-agent-skills\u002Fskills\u002Ftensorboard\u002Freferences\u002Fvisualization.md",[102,111,119,127,135,143],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":106,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":110},"01M7DV332YQMGD8WTRJ9DZQXTB","worktable-review-with-annotations","Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":115,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":110},"01M7DV2YGHCZVBEB1AHYB6CGHE","worktable-find-and-synthesize-context","Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":123,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":110},"01M7DV2TQN1H11ME2SAF9MXN7V","worktable-create-or-update-docs","Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":131,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":110},"01M7DV2NE452NEA8TXATKSNAJH","worktable-create-or-manage-records","Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FSKILL.md",[],[],{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":139,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":110},"01M7DV2HENRBR2KSCVM064WH0Y","worktable-create-or-manage-interactive-html","Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FSKILL.md",[],[],{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":147,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":110},"01M7DV2CADR5R7RQFFYPNAGR9Y","worktable-collaborate-threads","Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FSKILL.md",[],[]]