from pathlib import Path

import pickle
import gzip 
from matplotlib import pyplot
import numpy as np

DATA_PATH = Path("data")
PATH = DATA_PATH
FILENAME = "mnist.pkl.gz"

with gzip.open((PATH / FILENAME).as_posix(), "rb") as f:
    ((x_train, y_train), (x_valid, y_valid), _) = pickle.load(f, encoding="latin-1")

    pyplot.imshow(x_train[0].reshape((28, 28)), cmap="gray")
    print(x_train.shape)
