[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QG5Z3TTKDYJN3T98V6SQ3F":3,"skill-same:01M6QG5Z3TTKDYJN3T98V6SQ3F":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":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":14,"repositoryHtmlUrl":52,"repositoryHomepageUrl":53,"ownerHtmlUrl":54,"ownerBlogUrl":55,"ownerDescription":56,"updatedAt":57,"install":58,"resources":71},"01M6QG5Z3TTKDYJN3T98V6SQ3F","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.","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\u002Fkal-tensorboard\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"use","profiler","accuracy","gradient","for","tables","Model Debugging","Training Metrics","PCA","experiments","profiling","text","loop","team","logs","embeddings","mlops","training","collaboration","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":43,"description":7},{"tags":44,"version":45,"category":46,"maintainer":47,"dependencies":48},"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","0da4485785ee599388900be50db1635489d53056",".agents\u002Fskills\u002Fkal-tensorboard","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":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add Tashima-Tarsh\u002FDisha6.6 --skill tensorboard",{"tool":64,"command":65},"bunx","bunx skills add Tashima-Tarsh\u002FDisha6.6 --skill tensorboard",{"tool":67,"command":68},"pnpm","pnpm dlx skills add Tashima-Tarsh\u002FDisha6.6 --skill tensorboard","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-tensorboard\u002FSKILL.md",true,[72,78,82,86,90],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fadvanced-features.md","REFERENCE","参考文档",2290,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-tensorboard\u002Freferences\u002Fadvanced-features.md",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fintegration-examples.md",3310,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-tensorboard\u002Freferences\u002Fintegration-examples.md",{"path":83,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fintegrations.md",16205,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-tensorboard\u002Freferences\u002Fintegrations.md",{"path":87,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fprofiling.md",13337,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-tensorboard\u002Freferences\u002Fprofiling.md",{"path":91,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fvisualization.md",14897,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-tensorboard\u002Freferences\u002Fvisualization.md",[95,121,145,169,193,215],{"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":101,"publishedAt":38},"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",[],[102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,23,118,119,120],"youtube full","youtube","full","transcript","search","monitoring","data","Video","Audio","list","files","do","get","age","trigger","URL","browsing","request","youtube transcripts",{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":38},"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",[],[128,129,130,131,106,132,133,134,135,136,137,138,139,140,19,141,142,143,144,23],"twitter","x twitter growth","growth","research","content","engineering","plan","web search","competitors","analyze","engine","write","strategy","platform","grow","posting","competitive",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":38},"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",[],[152,139,153,154,155,156,157,158,19,159,160,49,161,162,163,164,165,166,167,168],"write a skill","github","create","https","productivity","matt pocock","direct","example","build","new skill","structure","new agent","resources","with","tree","progressive disclosure","author",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":38},"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",[],[176,177,178,179,180,181,182,183,184,19,185,113,186,187,188,189,190,24,191,192],"wrap up","up","wrap","gemini","deployment","run","file","hardening","closeout","stop","upgrade","founder","close","companion","you","directions","phase",{"skillNo":194,"name":195,"nameZh":6,"description":196,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":197,"categories":198,"keywords":199,"publishedAt":38},"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",[],[200,201,202,203,204,154,181,205,206,207,31,208,139,209,112,210,211,212,213,214],"workflow","workflow builder","builder","design","workflows","code","orchestrate","pipeline","multi-agent","context","across","fresh","scripts","judge","claude code workflow",{"skillNo":216,"name":217,"nameZh":6,"description":218,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":219,"categories":220,"keywords":221,"publishedAt":38},"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",[],[222,223,224,225,226,227,228,229,32,31,230,231,232,233,234,235,114,236,237,192],"review","weekly review","weekly","deterministic scripts","reflect","feeds","inventory","open","projects","project-management","scanner","conversation","back","project","sprint","cadence"]