0
0
TensorFlowml~12 mins

Accuracy and loss monitoring in TensorFlow - Model Pipeline Trace

Choose your learning style9 modes available
Model Pipeline - Accuracy and loss monitoring

This pipeline shows how a simple neural network learns to classify handwritten digits. It tracks accuracy and loss during training to see how well the model improves over time.

Data Flow - 5 Stages
1Load Data
70000 rows x 28 x 28 pixelsLoad MNIST handwritten digits dataset70000 rows x 28 x 28 pixels
Image of digit '5' represented as 28x28 grayscale pixels
2Preprocessing
70000 rows x 28 x 28 pixelsNormalize pixel values from 0-255 to 0-170000 rows x 28 x 28 pixels
Pixel value 150 becomes 0.588
3Train/Test Split
70000 rows x 28 x 28 pixelsSplit dataset into training and testing sets60000 rows x 28 x 28 pixels (train), 10000 rows x 28 x 28 pixels (test)
Training set contains digit images for learning
4Flatten Images
60000 rows x 28 x 28 pixelsConvert 2D images to 1D vectors60000 rows x 784 columns
28x28 image becomes a 784-length vector
5Model Training
60000 rows x 784 columnsTrain neural network with 1 hidden layerModel weights updated
Weights adjust to better classify digits
Training Trace - Epoch by Epoch
Loss: 0.45 |****      |
Loss: 0.30 |*******   |
Loss: 0.22 |********* |
Loss: 0.18 |**********|
Loss: 0.15 |**********|
EpochLoss ↓Accuracy ↑Observation
10.450.85Model starts learning, accuracy is moderate
20.300.91Loss decreases, accuracy improves
30.220.94Model continues to improve
40.180.95Loss decreases steadily, accuracy high
50.150.96Training converges with good accuracy
Prediction Trace - 3 Layers
Layer 1: Input Layer
Layer 2: Hidden Layer (ReLU activation)
Layer 3: Output Layer (Softmax)
Model Quiz - 3 Questions
Test your understanding
What does a decreasing loss during training indicate?
AThe model is learning and improving
BThe model is forgetting data
CThe data is getting corrupted
DThe training stopped
Key Insight
Monitoring accuracy and loss during training helps us understand if the model is learning well. Decreasing loss and increasing accuracy show the model improves its predictions over time.