# Summary

> Source: https://aiwiki.ai/wiki/summary
> Updated: 2026-12-01
> Categories: Machine Learning
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) - attribute to "AI Wiki (aiwiki.ai)"
> Cite as: AI Wiki. "Summary." aiwiki.ai, 1 Dec 2026. https://aiwiki.ai/wiki/summary
> From AI Wiki (https://aiwiki.ai), the free encyclopedia of artificial intelligence. Reuse freely with attribution.

In [TensorFlow](https://aiwiki.ai/wiki/tensorflow), a **summary** records a named observation, such as a loss value or a batch of generated images, for display in [TensorBoard](https://aiwiki.ai/wiki/tensorboard). The `tf.summary` module writes observations to an event file as training or evaluation proceeds. Recording the same [scalar](https://aiwiki.ai/wiki/scalar) at successive steps produces a time series. Other summary types preserve information that a single number would discard, such as the distribution of weights in a layer or the sound of a synthesized utterance. [1][2][3][4][5]

The name also appears in other [machine learning terminology](https://aiwiki.ai/wiki/machine_learning_terms). In Keras, `model.summary()` prints the structure of a model. In [text summarization](https://aiwiki.ai/wiki/text_summarization), the output is a shorter account of a document. A TensorFlow event summary has a tag and a value that a program can read back. [1][6][7][8]

## Purpose

A [neural network](https://aiwiki.ai/wiki/neural_network) can produce many observations during training. A [loss curve](https://aiwiki.ai/wiki/loss_curve) shows when an optimizer stopped making progress. Comparing training loss with [validation loss](https://aiwiki.ai/wiki/validation_loss) shows whether progress on the training data carries over to a held-out [validation set](https://aiwiki.ai/wiki/validation_set). Recording the [learning rate](https://aiwiki.ai/wiki/learning_rate) on the same step scale makes it possible to inspect a change in the curve alongside a change in the schedule. TensorBoard can read completed event files or display data while the training process is still running. [2][9][10]

Different questions call for different observations. A histogram of layer activations shows how many values fall in each range and whether that distribution changes over time. For a [generative model](https://aiwiki.ai/wiki/generative_model), images of the same inputs at successive epochs let a reader inspect changes in the predictions. An audio summary preserves a playable sample at its recorded sample rate. Text summaries can store run notes and configuration in Markdown. TensorBoard also has tools for comparing [hyperparameters](https://aiwiki.ai/wiki/hyperparameter), exploring embeddings and profiling execution, each with its own input requirements. [3][4][5][11][12][13][14][15]

## Core API

The TensorFlow 2 summary functions use a `name` to identify the observation, `data` for its value and an integer `step` to position it within a run. An active TensorFlow name scope prefixes the tag, so `loss` recorded under `encoder` appears as `encoder/loss`. An optional `description` can explain what the value measures, including units or a normalization convention. [1][2]

| Function | Data written | Options and interpretation |
|---|---|---|
| `tf.summary.scalar` | One real numeric value convertible to `float32` | A loss, accuracy, gradient norm or learning rate at one step. [2] |
| `tf.summary.histogram` | A histogram over all elements of a tensor, regardless of shape | `buckets` defaults to 30. A layer with many weights produces one distribution per call. [3] |
| `tf.summary.image` | A batch shaped `[batch, height, width, channels]` | Supports one to four channels, including grayscale with alpha. `max_outputs` defaults to three images. [4] |
| `tf.summary.audio` | A batch shaped `[batch, frames, channels]` | Requires a positive `sample_rate` in hertz. The documented encoding is WAV. `max_outputs` defaults to three clips. [5] |
| `tf.summary.text` | A string or string tensor | TensorBoard renders supported Markdown, including links and tables. [11] |
| `tf.summary.write` | A tensor under a specified tag | The signature is `write(tag, tensor, step=None, metadata=None, name=None)`. Plugin authors can supply a `SummaryMetadata` message. [7][16] |

A summary-writing call such as `tf.summary.scalar` returns a boolean tensor indicating whether it recorded a value. With no default writer, it returns false. `tf.summary.record_if(condition)` sets a recording condition for its scope. `tf.summary.should_record_summaries()` reports whether recording is enabled, and `tf.summary.create_noop_writer()` supplies a writer that discards its input. At a lower level, `tf.summary.experimental.write_raw_pb` accepts serialized `Summary` protocol buffers. [1][2][17][18]

### Explicit and default steps

A step can represent a batch, an optimizer update or an epoch. Its meaning comes from the program. For a given run and tag, TensorFlow expects increasing steps. Reusing or reordering them can give an unexpected plot. With an active writer, a scalar call raises `ValueError` if neither the call nor the current context supplies a step. [2][19]

A writer can supply a default step through `as_default(step=...)`. `tf.summary.experimental.set_step` also sets the default for the current thread. When tracing a `tf.function`, TensorFlow captures an ordinary Python value at trace time. A `tf.Variable` can supply a step that advances across calls to the same traced function. An explicit tensor argument to the function also allows the caller to supply a different step on each execution. [19][20][21]

```python
import tensorflow as tf

writer = tf.summary.create_file_writer("logs/default-step")
step = tf.Variable(0, dtype=tf.int64, trainable=False)

@tf.function
def record_loss(loss):
    tf.summary.scalar("loss", loss)
    step.assign_add(1)

with writer.as_default(step=step):
    record_loss(tf.constant(0.8))
    record_loss(tf.constant(0.6))
writer.close()
```

Both calls have the same input shape and type. The first point appears at step 0 and the second at step 1. The default writer is in scope when TensorFlow traces `record_loss`. Changing an outer Python writer or step after tracing can leave the graph referring to the original one. [19][20][21]

## Writers and event files

`tf.summary.create_file_writer(logdir)` creates a `SummaryWriter` for a directory. Its `as_default()` context selects that writer for summary operations in the current thread. A program can reuse one writer across a whole training loop. In the following example, `train_batch`, `generate_samples` and `model` belong to the training application. The scalar is recorded every step and the more detailed observations every hundredth step. [2][3][4][19][22]

```python
writer = tf.summary.create_file_writer("logs/run-01/train")
try:
    with writer.as_default():
        for step, batch in enumerate(train_dataset):
            loss = train_batch(batch)
            tf.summary.scalar("loss", loss, step=step)
            if step % 100 == 0:
                tf.summary.histogram("layer1/weights", model.layers[0].kernel, step=step)
                tf.summary.image("samples", generate_samples(), step=step, max_outputs=4)
finally:
    writer.close()
```

The writer buffers events. The default `max_queue` is 10 summaries, and `flush_millis` defaults to 120,000 milliseconds. Exceeding the queue limit can trigger a flush before the interval elapses. `writer.flush()` sends pending data to storage while keeping the writer open. `close()` flushes and closes it. TensorFlow's writer context also flushes on exit, so entering and leaving it for every scalar has different buffering behavior from keeping it open across a loop. [18][19][22]

TensorBoard identifies a run by its directory. Separate directories such as `logs/run-01/train` and `logs/run-01/validation` can each contain a series tagged `loss`. The viewer can overlay the series. An event filename suffix helps identify a file on disk, but two filenames in one directory do not establish two runs. TensorBoard's file reader normally expects one active writer per directory. [10][22][23]

### Event file format on disk

An event file contains a sequence of TFRecord records. Each record holds a serialized `Event` protocol buffer. TFRecord supplies a byte length and masked CRC-32C checksums for the length and payload. At the next level, `Event` supplies a wall-clock timestamp, an integer step and one of several payloads. These include `file_version`, `summary`, `graph_def` and session metadata. The opening version record identifies the event format as `brain.Event:2`. Its number identifies the file format and is distinct from the TensorFlow package version. [24][25][26]

An event with a `summary` payload contains one or more `Summary.Value` entries. Each entry has a tag and a value. Modern TensorFlow summaries store the data in the `tensor` field. Metadata can identify the TensorBoard plugin that interprets it, specify a display name or provide a description. Older summaries can use type-specific fields such as `simple_value` for a scalar. This distinction matters when a tool reads records directly. [7][21][24]

Filenames commonly begin with `events.out.tfevents.` and include a timestamp and host name. The TensorBoard Python writer also includes the process ID and a unique identifier. TensorFlow 2's file writer uses `.v2` by default as its configurable suffix. New observations are appended to the stream. A reader can examine the file before training finishes, provided the writer has flushed the relevant data. [21][22][26][27]

### Reading events programmatically

`tf.compat.v1.train.summary_iterator(path)` yields `Event` messages from a local event file. The iterator works on TensorFlow 2 output despite the `compat.v1` in its name. To recover a TensorFlow 2 scalar, decode the `TensorProto` with `tf.make_ndarray`. For an older scalar stored directly in `simple_value`, read that field instead. This example reads both representations for the known scalar tag `loss` in the `logs/default-step` example above. [7][21][27]

```python
from pathlib import Path
import tensorflow as tf

for path in sorted(Path("logs/default-step").glob("events.out.tfevents.*")):
    for event in tf.compat.v1.train.summary_iterator(str(path)):
        for entry in event.summary.value:
            if entry.tag != "loss":
                continue
            if entry.HasField("tensor"):
                value = tf.make_ndarray(entry.tensor).item()
            elif entry.HasField("simple_value"):
                value = entry.simple_value
            else:
                continue
            print(event.step, event.wall_time, value)
```

The `.item()` call extracts one number from the [NumPy](https://aiwiki.ai/wiki/numpy) result. For an image or other multidimensional tensor, retain the array and interpret it according to its plugin. A script can also collect `(tag, step, wall_time, value)` rows in a [DataFrame](https://aiwiki.ai/wiki/dataframe). Older notebooks that use `ExperimentFromDev.get_scalars()` depend on the hosted TensorBoard.dev service. That service closed on January 1, 2024. Local event files remain readable with the iterator. [7][21][27][28]

## TensorFlow 1 and TensorFlow 2

In TensorFlow 1 graph mode, a summary operation returned a serialized `Summary` as a string tensor. The program typically added summary operations to a graph collection, combined them with `merge_all()`, fetched the result in `Session.run`, then passed those bytes and a step to `FileWriter.add_summary`. TensorFlow 2 supports [eager execution](https://aiwiki.ai/wiki/eager_execution) and `tf.function`. The summary operation writes when it executes with a default writer and recording enabled. [21]

| Aspect | TensorFlow 1 graph-mode API | TensorFlow 2 API |
|---|---|---|
| Writer | Construct `tf.summary.FileWriter(logdir)`. | Obtain a `tf.summary.SummaryWriter` from `create_file_writer(logdir)`. [21] |
| Recording | Fetch the summary tensor and call `writer.add_summary(...)`. | Execute the summary operation under `writer.as_default()`. [21] |
| Combining values | `merge` or `merge_all` can combine serialized summaries. | Each call writes directly, so merging is unnecessary. [21] |
| Step | The program can pass `global_step` when it calls `add_summary`. | A write takes an explicit `step` or a context default. [19][21] |
| Names and data | Functions such as `scalar` take `tensor`, with `family` and `collections` options. | The second argument is `data`. Name scopes can group related tags. [2][21] |
| Conditional writes | The program decides when to fetch or write a summary. | Use `tf.summary.record_if`, or guard both the computation and the summary operation. [17][21] |
| Record contents | Scalars can use `simple_value`. | Scalar data is in a `TensorProto`. [7][21] |

### History and migration

The TensorFlow 2.0 release on September 30, 2019 included an upgrade tool. `tf_upgrade_v2` can rewrite symbols and identify calls needing review. It can direct old code to `tf.compat.v1.summary`. Converting a session-based logging loop to direct writes also requires changing where its summaries execute. [21][29][30]

## Using summaries from Keras

For a model trained with `model.fit`, the [Keras](https://aiwiki.ai/wiki/keras) `TensorBoard` callback records the losses and metrics that Keras computes. Epoch summaries are the default. With validation data, the callback creates training and validation logs beneath the specified directory. It also records evaluation metrics against the optimizer's iteration count. Selecting a distinct `log_dir` for each fit separates experiments. The callback does not generate a new run name on each fit. [9][31][32]

```python
callback = tf.keras.callbacks.TensorBoard(
    log_dir="logs/fit/baseline",
    histogram_freq=1,
    update_freq="epoch",
)
model.fit(
    x_train, y_train,
    validation_data=(x_val, y_val),
    epochs=10,
    callbacks=[callback],
)
```

### Callback parameters

| Parameter | Keras 3 default | Effect |
|---|---|---|
| `log_dir` | `"logs"` | Parent directory for this callback's output. [31] |
| `histogram_freq` | `0` | Interval in epochs for layer weight histograms. Zero disables them. [31] |
| `write_graph` | `True` | Graph option whose support varies by Keras version. The Keras 3 API page marks it as unsupported. An explicit graph trace is available for a TensorFlow function. [31][33] |
| `write_images` | `False` | Enables image representations of model weights, such as [convolutional filters](https://aiwiki.ai/wiki/convolutional_filter), alongside weight histograms. [31][32] |
| `write_steps_per_second` | `False` | Records training throughput. [31] |
| `update_freq` | `"epoch"` | Accepts `"epoch"`, `"batch"`, or a batch interval given as an integer. Writing on every batch can add synchronization overhead. [31] |
| `profile_batch` | `0` | Zero disables profiling. A positive batch number selects one batch and a pair such as `(500, 520)` selects a range. [31] |
| `embeddings_freq` | `0` | Interval in epochs for logging [embedding layers](https://aiwiki.ai/wiki/embedding_layer) for the Projector. [31] |
| `embeddings_metadata` | `None` | A metadata filename or a mapping from embedding-layer names to filenames. [31] |

### A custom training loop with GradientTape

A custom loop can assign its own step units. This example logs batch loss after each optimizer update. At the end of an epoch it logs the model's validation loss against the same update count. The two series can then share a horizontal axis even though validation runs less often. Here `loss_fn` returns a scalar batch loss, and `validation_loss(model, val_ds)` computes the loss over the validation dataset. [2][9][34]

```python
train_writer = tf.summary.create_file_writer("logs/run-02/train")
val_writer = tf.summary.create_file_writer("logs/run-02/validation")

try:
    with train_writer.as_default():
        for epoch in range(epochs):
            for x, y in train_ds:
                with tf.GradientTape() as tape:
                    predictions = model(x, training=True)
                    loss = loss_fn(y, predictions)
                gradients = tape.gradient(loss, model.trainable_variables)
                optimizer.apply_gradients(zip(gradients, model.trainable_variables))
                tf.summary.scalar("loss", loss, step=optimizer.iterations)

            with val_writer.as_default():
                tf.summary.scalar("loss", validation_loss(model, val_ds),
                                  step=optimizer.iterations)
finally:
    train_writer.close()
    val_writer.close()
```

### Custom callbacks for images and other metrics

Some observations are naturally collected once per epoch. A confusion matrix requires predictions and labels, while an image comparison needs representative inputs. TensorFlow's image tutorial uses a callback to render a confusion matrix with [Matplotlib](https://aiwiki.ai/wiki/matplotlib), encode it as an in-memory PNG, decode the image and add a batch dimension before calling `tf.summary.image`. This allows a reader to see which classes the model confuses alongside its overall accuracy. [12]

The callback below writes model predictions for a fixed sample. It assumes the model emits image batches with a supported pixel range and channel count. Using the same inputs each epoch makes changes in the output easier to compare. The callback has its own run directory, for example `logs/fit/baseline/samples`. [4][12][23][31]

```python
class SampleImageCallback(tf.keras.callbacks.Callback):
    def __init__(self, logdir, sample_inputs):
        super().__init__()
        self.logdir = logdir
        self.sample_inputs = sample_inputs

    def on_train_begin(self, logs=None):
        self.writer = tf.summary.create_file_writer(self.logdir)

    def on_epoch_end(self, epoch, logs=None):
        predictions = self.model(self.sample_inputs, training=False)
        with self.writer.as_default():
            tf.summary.image("predictions", predictions, step=epoch, max_outputs=4)

    def on_train_end(self, logs=None):
        self.writer.close()
```

## TensorBoard dashboards

`tensorboard --logdir logs` starts the viewer on the parent log directory. It ordinarily serves a local web application on port 6006 and discovers runs below that directory. In Jupyter or Colab, `%load_ext tensorboard` loads the extension and `%tensorboard --logdir logs` displays the interface in the notebook. For a run in progress, new points become visible after the writer flushes and the viewer reloads the data. The TensorBoard settings include a **Reload data** option. [10][22][23][35]

| Dashboard or view | Input | What it shows |
|---|---|---|
| Scalars or Time Series | `tf.summary.scalar` | A [time series](https://aiwiki.ai/wiki/time_series) of metric values, with separate colors for selected runs. [2][9] |
| Histograms and Distributions | `tf.summary.histogram` | Different views of the same observations, including how a layer's activation distribution changes with training. [3][23] |
| Images and Audio | Image or audio summaries | Samples that can be inspected or played at the selected step. [4][5] |
| Text | `tf.summary.text` | A rendered string or table, for example an excerpt of generated text. [11] |
| Graphs | An exported graph trace | Operations and their connections within a [computational graph](https://aiwiki.ai/wiki/computational_graph). [33] |
| HParams | Trial settings and matching scalar metrics | Table and plot views for comparing runs in a sweep. [13] |
| Projector | An embedding tensor and optional labels | A low-dimensional view in which a reader can select and search points. [14] |
| Profile | Captured execution profile | Timing of work on the host and device, input processing and memory use. [15] |
| Mesh | Mesh-plugin summaries | An interactive 3D point cloud or a surface defined by triangular faces. [36] |

### Tracing graphs

The Graphs dashboard can display the operations executed by a `tf.function`. The tracing calls run in eager mode and affect the TensorFlow runtime across threads. To obtain a graph for a particular function, a program can start tracing just before the call, run the function, then export from a writer context. `trace_export` stops the trace and writes the result. `trace_off()` stops tracing when the result can be discarded. [33][37][38]

```python
@tf.function
def squared_norm(x):
    return tf.reduce_sum(tf.square(x))

graph_writer = tf.summary.create_file_writer("logs/graph")
with graph_writer.as_default():
    tf.summary.trace_on(graph=True, profiler=False)
    squared_norm(tf.constant([1.0, 2.0]))
    tf.summary.trace_export(name="squared_norm", step=0)
graph_writer.close()
```

### Hyperparameter sweeps and HParams

The HParams plugin associates settings with the outcomes of each trial in a [hyperparameter tuning](https://aiwiki.ai/wiki/hyperparameter_tuning) experiment. `HParam` names a tunable quantity. `Discrete` or `RealInterval` describes its domain, and `Metric` names an outcome such as accuracy. Writing an experiment configuration at the parent directory describes the comparison. Each trial then records its chosen settings and its measured accuracy in a separate run directory. The plugin displays results in a table, parallel coordinates or a scatter plot. [13]

```python
from tensorboard.plugins.hparams import api as hp

units = hp.HParam("num_units", hp.Discrete([16, 32]))
learning_rate = hp.HParam("learning_rate", hp.RealInterval(0.0001, 0.01))

with tf.summary.create_file_writer("logs/sweep").as_default():
    hp.hparams_config(hparams=[units, learning_rate], metrics=[hp.Metric("accuracy")])

for width in (16, 32):
    settings = {units: width, learning_rate: 0.001}
    accuracy = train_and_evaluate(width, 0.001)
    with tf.summary.create_file_writer(f"logs/sweep/units-{width}").as_default():
        hp.hparams(settings)
        tf.summary.scalar("accuracy", accuracy, step=1)
```

Here `train_and_evaluate` is the application's training routine. `hp.hparams` identifies what the trial used, while `tf.summary.scalar` records what it achieved. The metric tag must correspond to the name in `hp.Metric` for the comparison to show that outcome. [13]

## Profiler integration

A scalar such as steps per second can show that a run slowed down. An execution profile can show where it spent the time. Keras can capture selected batches through `profile_batch`. A custom training loop can delimit a profile with `tf.profiler.experimental.start(logdir)` and `tf.profiler.experimental.stop()`. Profiling produces separate files such as `host.xplane.pb` under `plugins/profile/<session>/`. A scalar event file alone does not contain a device execution trace. [15][31][39]

The Profiler's Trace Viewer places host threads and device work on a common timeline. The Input Pipeline Analyzer helps locate delays in `tf.data` stages, and operation statistics show which TensorFlow operations consumed time. The Memory Profile tool shows allocations during the capture. For example, long device idle intervals that coincide with input preparation point to a different bottleneck from a device timeline filled by one expensive kernel. [15]

## Embedding Projector

TensorBoard's Embedding Projector displays vectors after [dimensionality reduction](https://aiwiki.ai/wiki/dimensionality_reduction). In TensorFlow's [word embedding](https://aiwiki.ai/wiki/word_embedding) example, the program saves the embedding weights in a checkpoint and writes one textual label per row to a metadata TSV. It adds the tensor name and metadata path to a `projector.ProjectorConfig` and calls `projector.visualize_embeddings(logdir, config)` to write the configuration. The reader can search for a word and inspect its neighbors. The same arrangement can associate labels with a representation learned by an [autoencoder](https://aiwiki.ai/wiki/autoencoder) or by [contrastive learning](https://aiwiki.ai/wiki/contrastive_learning), provided each label matches the corresponding vector. [14]

## Mesh and 3D summaries

The mesh plugin accepts a batch of 3D vertex coordinates, optional per-vertex colors and optional triangle indices. The TensorFlow 2 entry point is `mesh` in `tensorboard.plugins.mesh.summary_v2`. A set of vertices alone represents a point cloud. Adding a face tensor specifies which triplets of vertices form triangles. A `config_dict` can configure the camera, lights and material used by the three.js viewer. [36]

## Distributed training

In [distributed training](https://aiwiki.ai/wiki/distributed_training), what a number represents depends on where it was measured. One replica's batch loss describes its local data. TensorFlow's custom-loop example uses `strategy.run` for per-replica computation, then `strategy.reduce` to combine the results. A global summary can record the reduced quantity once. The appropriate reduction depends on the loss definition. If each replica has divided its loss by the global batch size, summing the contributions restores the global mean. [40][41]

With multiple workers, TensorFlow describes the chief worker as the usual writer of shared TensorBoard summaries. `tf.summary.should_record_summaries()` can already evaluate to false on some replicas under a distribution strategy. Worker-specific diagnostics can instead go in deliberately separate directories. TensorBoard will display those directories as separate runs. Giving several active writers the same directory can make updates from an earlier file disappear from view when the reader advances to a newer file. [18][23][40]

## PyTorch summaries

[PyTorch](https://aiwiki.ai/wiki/pytorch) provides `torch.utils.tensorboard.SummaryWriter`, which writes event files that TensorBoard can read. Its methods accept a tag, a value or values and, where appropriate, a `global_step`. Its writer updates files asynchronously and has `flush()` and `close()` methods. The same `tensorboard --logdir logs` command can open TensorFlow and PyTorch runs held beneath that directory. [42]

| PyTorch method | Corresponding data or TensorFlow facility |
|---|---|
| `add_scalar`, `add_scalars` | A scalar series, or several named series on a plot. In TensorFlow, `tf.summary.scalar` writes one observation at a time. [2][42] |
| `add_histogram` | A distribution of tensor elements, as in `tf.summary.histogram`. [3][42] |
| `add_image`, `add_images` | Image data. PyTorch's `add_image` defaults to channels-first `CHW`, while TensorFlow's image summary takes a channels-last batch. [4][42] |
| `add_audio`, `add_text` | Audio clips and text summaries. [5][11][42] |
| `add_graph`, `add_embedding` | A model graph or an embedding for the Projector. [14][33][42] |
| `add_pr_curve`, `add_hparams`, `add_mesh` | Precision-recall curves, hyperparameter comparisons or 3D scenes. `add_figure` renders a Matplotlib figure to an image. [42] |

```python
from torch.utils.tensorboard import SummaryWriter

with SummaryWriter("logs/pytorch-run") as writer:
    for step, (x, y) in enumerate(loader):
        loss = train_step(x, y)
        writer.add_scalar("loss", loss.item(), step)
        if step % 100 == 0:
            writer.add_histogram("layer1/weights", model.layer1.weight, step)
```

Here the training code supplies `loader`, `model` and `train_step`. Keeping the tag `loss` and the same step units across frameworks lets the viewer compare the two runs. Comparability also depends on the training code computing the same loss and applying the same aggregation to it. [2][23][42]

## Alternatives and integrations

Event files preserve observations from a [deep learning](https://aiwiki.ai/wiki/deep_learning) run. Experiment trackers can also associate that run with its configuration, artifacts or source code. For example, [MLflow](https://aiwiki.ai/wiki/mlflow) provides `log_param`, `log_metric` and `log_artifact` for three distinct kinds of data. A saved event file can be retained as an artifact. MLflow also supplies automatic logging integrations for libraries including [scikit-learn](https://aiwiki.ai/wiki/scikit_learn), [XGBoost](https://aiwiki.ai/wiki/xgboost) and Keras. [43][44]

| Tool | Relationship to experiment records |
|---|---|
| [Weights & Biases](https://aiwiki.ai/wiki/weights_and_biases) | The Python SDK exposes `sync_tensorboard` to synchronize TensorBoard logs as part of a W&B run. [45] |
| Aim | Stores run metadata and tracked sequences with a Python API and a UI for comparing runs. [46] |
| ClearML | Adds agent and queue management for dispatching training tasks to workers with the required environment. [47] |
| Comet | Provides experiment-logging integrations and examples for TensorFlow, PyTorch and other frameworks. [48] |
| Sacred and Omniboard | Sacred records experiments. Omniboard presents experiments stored by Sacred's MongoDB observer in a web interface. [49] |
| Guild AI | Provides command-line tools for tracking machine learning experiments. [50] |
| DVC | Tracks experiment metrics, parameters and pipeline changes alongside a project's Git history. [51] |
| Neptune | A former hosted tracking service. The operator set March 5, 2026 as its shutdown date. [52] |

## Practical notes and common pitfalls

* **A missing point.** With no default writer, `tf.summary.scalar` returns false. With a writer but no step, the same call can raise `ValueError`. If a point was recorded but has not appeared, flush the writer, reload the viewer and check the log directory and tag. `tensorboard --inspect --logdir logs` lists information about the events on disk. [2][19][23]
* **A stationary or broken curve.** Check whether a Python step was captured when a `tf.function` was traced. A changing `tf.Variable` or an explicit tensor argument avoids recording multiple observations at the captured step. Also check that the batch counter does not reset at the start of each epoch. [2][19][20][21]
* **Logging frequency.** Image and audio writers can limit how many examples are saved with `max_outputs`. Scheduling a costly computation, such as generating samples, inside a conditional also avoids doing it on skipped steps. `record_if` alone controls recording of summaries. [4][5][17][21]
* **Image intensity and audio amplitude.** Floating-point images are clipped to `[0, 1]`. A `uint8` image uses `[0, 255]`. A batch of floating-point audio samples should lie in `[-1, 1]` and carry its sampling rate. An image of raw activations may need rescaling to show small differences. [4][5]
* **Interrupted runs.** Buffered events may not yet have reached storage when a process stops abruptly. `flush()` makes pending values available while training continues. A `finally` block that closes the writer also flushes it on an ordinary Python exception. [19][22]
* **Missing observations on a crowded chart.** TensorBoard samples data for display to bound memory use. A displayed curve can therefore have fewer points than the file contains. Use the event iterator when a calculation requires every recorded point. [23][27]
* **Comparing runs.** Directory names identify runs, and tags identify series. Descriptive directories such as `logs/resnet50/baseline` make runs recognizable. Keeping tag names, step units and evaluation conventions consistent makes the curves interpretable together. [2][9][23]

## Other meanings of summary

A call to `model.summary()` in Keras describes a model's layers, output shapes and parameter counts. It answers a question about the model's structure before or after training. Text summarization is a language task that condenses a document. A histogram or a scalar aggregate is a statistical summary. Any of these outputs can itself become the *content* of a TensorFlow summary if a program records it under a tag and step. [1][3][6][8][11]

## References

1. TensorFlow. [The `tf.summary` module](https://www.tensorflow.org/api_docs/python/tf/summary).
2. TensorFlow. [`tf.summary.scalar`](https://www.tensorflow.org/api_docs/python/tf/summary/scalar).
3. TensorFlow. [`tf.summary.histogram`](https://www.tensorflow.org/api_docs/python/tf/summary/histogram).
4. TensorFlow. [`tf.summary.image`](https://www.tensorflow.org/api_docs/python/tf/summary/image).
5. TensorFlow. [`tf.summary.audio`](https://www.tensorflow.org/api_docs/python/tf/summary/audio).
6. Keras. [The Model class and `Model.summary`](https://keras.io/api/models/model/).
7. TensorFlow. [Protocol buffer definitions for `Summary`, `Summary.Value` and `SummaryMetadata`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/summary.proto).
8. Hugging Face. [Summarization](https://huggingface.co/docs/transformers/tasks/summarization).
9. TensorFlow. [TensorBoard Scalars: Logging training metrics in Keras](https://www.tensorflow.org/tensorboard/scalars_and_keras).
10. TensorFlow. [Get started with TensorBoard](https://www.tensorflow.org/tensorboard/get_started).
11. TensorFlow. [Displaying text data in TensorBoard](https://www.tensorflow.org/tensorboard/text_summaries).
12. TensorFlow. [Displaying image data in TensorBoard](https://www.tensorflow.org/tensorboard/image_summaries).
13. TensorFlow. [Hyperparameter tuning with the HParams dashboard](https://www.tensorflow.org/tensorboard/hyperparameter_tuning_with_hparams).
14. TensorFlow. [Visualizing data using the Embedding Projector](https://www.tensorflow.org/tensorboard/tensorboard_projector_plugin).
15. TensorFlow. [Optimize TensorFlow performance using the Profiler](https://www.tensorflow.org/guide/profiler).
16. TensorFlow. [`tf.summary.write`](https://www.tensorflow.org/api_docs/python/tf/summary/write).
17. TensorFlow. [`tf.summary.record_if`](https://www.tensorflow.org/api_docs/python/tf/summary/record_if).
18. TensorFlow. [Summary operation and writer context implementation](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/summary_ops_v2.py).
19. TensorFlow. [`tf.summary.SummaryWriter`](https://www.tensorflow.org/api_docs/python/tf/summary/SummaryWriter).
20. TensorFlow. [`tf.summary.experimental.set_step`](https://www.tensorflow.org/api_docs/python/tf/summary/experimental/set_step).
21. TensorFlow. [Migrating `tf.summary` usage to TF 2.x](https://www.tensorflow.org/tensorboard/migrate).
22. TensorFlow. [`tf.summary.create_file_writer`](https://www.tensorflow.org/api_docs/python/tf/summary/create_file_writer).
23. TensorBoard. [Usage guide and frequently asked questions](https://github.com/tensorflow/tensorboard/blob/master/README.md).
24. TensorFlow. [Protocol buffer definition for `Event`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/util/event.proto).
25. TensorFlow. [TFRecord and `tf.train.Example`](https://www.tensorflow.org/tutorials/load_data/tfrecord).
26. TensorBoard. [EventFileWriter implementation](https://github.com/tensorflow/tensorboard/blob/master/tensorboard/summary/writer/event_file_writer.py).
27. TensorFlow. [`tf.compat.v1.train.summary_iterator`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/train/summary_iterator).
28. TensorBoard. [TensorBoard.dev shutdown notice](https://tensorboard.dev/).
29. TensorFlow Team. [TensorFlow 2.0 is now available!](https://blog.tensorflow.org/2019/09/tensorflow-20-is-now-available.html), September 30, 2019.
30. TensorFlow. [Automatically rewrite TF 1.x and compat.v1 API symbols](https://www.tensorflow.org/guide/migrate/upgrade).
31. Keras. [TensorBoard callback](https://keras.io/api/callbacks/tensorboard/).
32. Keras. [TensorBoard callback implementation](https://github.com/keras-team/keras/blob/master/keras/src/callbacks/tensorboard.py).
33. TensorFlow. [Examining the TensorFlow graph](https://www.tensorflow.org/tensorboard/graphs).
34. TensorFlow. [Writing a training loop from scratch](https://www.tensorflow.org/guide/keras/writing_a_training_loop_from_scratch).
35. TensorFlow. [Using TensorBoard in notebooks](https://www.tensorflow.org/tensorboard/tensorboard_in_notebooks).
36. TensorBoard. [Mesh plugin documentation](https://github.com/tensorflow/tensorboard/blob/master/tensorboard/plugins/mesh/README.md).
37. TensorFlow. [`tf.summary.trace_on`](https://www.tensorflow.org/api_docs/python/tf/summary/trace_on).
38. TensorFlow. [`tf.summary.trace_export`](https://www.tensorflow.org/api_docs/python/tf/summary/trace_export).
39. OpenXLA. [XProf: Profile collection and directory structure](https://github.com/openxla/xprof).
40. TensorFlow. [Distributed training with TensorFlow](https://www.tensorflow.org/guide/distributed_training).
41. TensorFlow. [Custom training with `tf.distribute.Strategy`](https://www.tensorflow.org/tutorials/distribute/custom_training).
42. PyTorch. [`torch.utils.tensorboard.SummaryWriter`](https://docs.pytorch.org/docs/main/utils/tensorboard.html).
43. MLflow. [ML experiment tracking](https://mlflow.org/docs/latest/ml/tracking/).
44. MLflow. [Automatic logging with MLflow Tracking](https://mlflow.org/docs/latest/ml/tracking/autolog/).
45. Weights & Biases. [Python SDK settings for TensorBoard synchronization](https://github.com/wandb/wandb/blob/main/wandb/sdk/wandb_settings.py).
46. Aim. [Aim open-source experiment tracker](https://github.com/aimhubio/aim).
47. ClearML. [Workers and queues](https://clear.ml/docs/latest/docs/fundamentals/agents_and_queues/).
48. Comet. [Experiment logging examples](https://github.com/comet-ml/comet-examples).
49. Omniboard. [Web-based dashboard for Sacred](https://github.com/vivekratnavel/omniboard).
50. Guild AI. [Experiment tracking and developer tools](https://github.com/guildai/guildai).
51. DVC. [Experiment tracking](https://doc.dvc.org/example-scenarios/experiment-tracking).
52. Neptune. [Neptune service shutdown](https://docs.neptune.ai/).

