Created
June 18, 2018 15:18
-
-
Save siakon89/40c8ecc71eb6b2f02ac1443575c5b159 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load MNIST data copied by SageMaker | |
def load_data(input_path): | |
# Adapted from https://github.com/keras-team/keras/blob/master/keras/datasets/fashion_mnist.py | |
# Training and validation files | |
files = ['training/train-y', 'training/train-x', | |
'validation/test-y', 'validation/test-x'] | |
# Load training labels | |
with open(input_path+files[0], 'rb') as lbpath: | |
y_train = pickle.load(lbpath, encoding='bytes') | |
# Load training samples | |
with open(input_path+files[1], 'rb') as imgpath: | |
x_train = pickle.load(imgpath, encoding='bytes') | |
# Load validation labels | |
with open(input_path+files[2], 'rb') as lbpath: | |
y_test = pickle.load(lbpath, encoding='bytes') | |
# Load validation samples | |
with open(input_path+files[3], 'rb') as imgpath: | |
x_test = pickle.load(imgpath, encoding='bytes') | |
print("Files loaded") | |
return (x_train, y_train), (x_test, y_test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment