Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@siakon89
Created July 9, 2018 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siakon89/c1c2ffbaeadd0918c2043f4187a3eb84 to your computer and use it in GitHub Desktop.
Save siakon89/c1c2ffbaeadd0918c2043f4187a3eb84 to your computer and use it in GitHub Desktop.
# Load the test data
def open_test_data(path):
test = []
with open(path, 'r') as f:
reader = csv.reader(f)
lines = list(reader)
image_number = 1
for line in tqdm(lines[1:]):
image = np.array([x for x in line])
image = image.astype('float32')
image = np.reshape(image, (28, 28, 1))
test.append([image, image_number])
image_number += 1
return np.array(test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment