> For the complete documentation index, see [llms.txt](https://docs.tensorleap.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tensorleap.ai/examples/mnist-project-walkthrough.md).

# MNIST Project Walkthrough

The MNIST project, included in the [**Free Trial**](broken://pages/reHfp80krQ2R6gWEaNyr)**,** uses the [**MNIST database**](http://yann.lecun.com/exdb/mnist/) (handwritten digits) with a simple classification model.

In the following steps, you will train the model, view the analytics, and perform basic analyses. For a more in-depth guide to the MNIST use-case, see the [**MNIST Guide**](/guides/full-guides/mnist-guide.md).

To open the project, in the Welcome screen, go to *Projects* and click `MNIST`:

![](/files/pDYfgY1xLaIeg7DINoCS)

The [**Network**](/user-interface/project/network.md) tab displays the model's nodes and connections in a simple convolutional neural network (CNN) model:

![](/files/QDzVDZQVsca02UpOraxe)

You can **zoom** in and out using the scroll wheel, and **pan** by dragging the background. Click on a node to view its details.

The orange node on the left relates to the MNIST dataset (the script can be viewed in the [**Resources Management**](/user-interface/resources-management.md)**)**.

The light blue nodes seen in the center of the model represent the model's layers, and the colored nodes at the end of the model represent the [**Loss and Optimizer**](/user-interface/project/network/network-mapping/create-a-mapping-deprecated/loss-node.md).

The model includes Tensorleap [**Visualizer**](/user-interface/project/network/network-mapping/create-a-mapping-deprecated/visualizer-node.md) nodes (dark blue) to extract visualizations from different outputs.

## Training

The pre-saved projects provided are not yet trained. They **must** be trained before viewing the analytics and analyses.

To train the model for one epoch, on the top bar, click <img src="/files/Nn62uo2iqbsf0ktto6If" alt="" data-size="line"> and <img src="/files/dAwEfcHEyqMU3AsPHnIx" alt="" data-size="line"> in the training dialog:

![Training (click-to-zoom)](/files/4AEHDY4Ofd4uqsrvrLeN)

Once training has initiated, a `PENDING` notification will appear indicating that the training process is initializing. This could take a minute or so. Once the training begins you will see a `STARTED` notification.

Training will take somewhere between 10 to 45 minutes, depending on your system resources. You can track the status by clicking <img src="/files/KRNhyA1vp5Sspp4PlJV9" alt="" data-size="line">.

## Metrics and Analytics

To display the model's analytics on the dashboard, on the top left of the dashboard, click <img src="/files/DIDpjjdNuVwZa9XqdZfC" alt="" data-size="line"> to open the Versions view. Expand the version and **make sure** that the current model is selected, as shown in the video below:

![Metrics and Analytics](/files/lsMWndN03yv019ZWGarR)

This [**Dashboard**](/user-interface/dashboards/dashlets/metrics-dashboard.md) includes the following [**Dashlets**](/user-interface/dashboards/dashlets/metrics-dashboard.md#dashlet):

* Loss (error) vs Batch - decreases as training progresses
* Accuracy vs Batch - increases as training progresses
* List of samples ordered by loss, from high to low
* Image Mean (a.k.a brightness) vs Loss - validation samples with high loss values tend to fail
* Distance from the Class Centroid vs Loss (the class centroid is the averaged image of all the images within the class) - the more unique the samples are, the more they tend to fail

## Population Exploration

Tensorleap creates a latent space that is relatively close to the entire model's latent space. This latent space is composed of feature activations from **all** of the model's layers in order to distribute the data in the most informative way.

Using this information, Tensorleap creates a similarity map between samples as they are interpreted by the model. A more intuitive explanation would be that similar samples would activate similar learned features within the model.&#x20;

This similarity map is called a [**Population Exploration**](/user-interface/dashboards/dashlets/sample-analysis.md#population-exploration) analysis, and it is performed automatically after each epoch.

To find patterns in the similarity map that correlate with selected metrics and metadata, perform the following steps (also shown in the video below):

{% hint style="info" %}
Perform the following steps only after training has finished
{% endhint %}

1. On the top left click <img src="/files/1z4Gb30eHCsuE2F46EbU" alt="" data-size="line">.
2. Resize the Population Exploration analysis panel, by dragging the bottom right corner.
3. Color the dots by their ground-truth label, clicking <img src="/files/jy1gesuvXd2wv7BuSo6R" alt="" data-size="line">, where the `loss` is currently selected, and change it to <img src="/files/rLAZU9BNu8yg6Tw1L5gB" alt="" data-size="line"> (ground truth label).

![Population Exploration (click-to-zoom)](/files/QMerbj5U7JqT4tTdoNQ8)

Notice that clusters are formed when projecting the samples onto the latent space. The clusters represent how the model perceives the data. When coloring the dots according to the ground truth label, we can see that each cluster correlates to a class. Large dots represent high loss values for these samples. Hover over the dots to see a preview of the sample.

Note how the model misinterpreted some of the samples - shown by the large dots and multi-colored samples within clusters.

{% hint style="info" %}
To learn more about the [**Population Exploration**](/user-interface/dashboards/dashlets/sample-analysis.md#population-exploration) analysis, see the [**Full Guides**](/guides/full-guides.md).&#x20;
{% endhint %}

Click each sample to show its preview, metadata, and metrics. To analyze a sample, select it and click <img src="/files/jYd8FiJyj20JfxF5Si89" alt="" data-size="line"> on the right panel, as shown below:

![](/files/RqgpvLexXXsaQMleQ3lW)

Tensorleap analyzes the sample and displays the results in the **Analyzer** panel. This process should take a few moments. The next section describes the **Sample Analysis**.

## Sample Root Cause Analysis

The Sample Analysis tool runs explainability algorithms on selected samples and displays the visualizations correlated with the [**Visualizer**](/user-interface/project/network/network-mapping/create-a-mapping-deprecated/visualizer-node.md) blocks.

In the example shown below, a sample from the `validation` subset is analyzed. The horizontal bar graph reveals that the ground truth for the sample is `8,` while the model interprets it as `6.`

![Sample Analysis](/files/3DkPKu1DZPwl16Fr2ePc)

![Ground Truth](/files/Qg0hdt2BQrNvLdMRqt8a) ![Prediction](/files/mmymMvDbt9Oq0kbMqVZF)

Next, the `Loss Analysis` shows a heat-map of the features that were correlated with the wrong prediction. In this case, a corner on the top left.

![Sample Loss Analysis](/files/EEPE77DkMBHdH8gIbQll)

Moreover, you can access the heat-maps corresponding to each of the output classes by clicking the heat-map on the right.

## Summary

Congratulations on completing this short MNIST walkthrough for the Free Trial. This is a rather simple use-case and model, which achieves more than `98%` accuracy on the `Validation` subset.

Next, you can follow the **full guide** at [**MNIST Guide**](/guides/full-guides/mnist-guide.md),  which takes you through dataset integration, model building, and importing, as well as reviewing and analyzing additional metrics.

You can also check our [**Full Guides**](/guides.md) for more advanced use cases.

To learn about **integrating** **your custom data** into the platform, see the [**Integration Script**](/tensorleap-integration/writing-integration-code.md).

For more information about the Standalone Trial, see [**Quickstart Standalone Trial**](broken://pages/reHfp80krQ2R6gWEaNyr).&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tensorleap.ai/examples/mnist-project-walkthrough.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
