Handwritten Digit Recognition Using a Neural Network (2)
Handwritten Digit Recognition Using a Neural Network (2)
AIM:
To develop a simple deep learning model using Python to recognize handwritten digits
from the MNIST dataset.
ALGORITHM:
STEP 4: Compile the model with an optimizer (e.g., Adam) and a loss function (e.g.,
sparse categorical crossentropy).
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Flatten
from tensorflow.keras.datasets import mnist
import matplotlib.pyplot as plt