# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import numpy as np
from tensorflow.keras.datasets import mnist
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.optimizers import Adam
from keras.utils.np_utils import to_categorical
import random
import matplotlib.pyplot as plt

np.random.seed(0)

(X_train, y_train), (X_test, y_test) = mnist.load_data()

print(X_train.shape)
print(X_test.shape)

plt.imshow(X_train[y_train == 9][0], cmap='gray')

plt.imshow(X_train[y_train == 1][0], cmap='gray')

samples = []
for i in range(10):
    samples.append((X_train[y_train==i]).shape[0])

samples



StarcoderdataJupyterScriptsDedupFiltered