May 2020
Intermediate to advanced
404 pages
10h 52m
English
Remember the loadImageFile and loadLabelFile functions we created during the exploration of the dataset? We will need them again and so we will copy those same functions into this notebook.
Together, they produce two cells of code for each of the functions:
In a new code cell, we create the loadImageFile() function:
def loadImageFile(fileimage): f = open(fileimage, "rb") f.read(16) pixels = 28*28 images_arr = [] while True: try: img = [] for j in range(pixels): pix = ord(f.read(1)) img.append(pix / 255) images_arr.append(img) except: break f.close() image_sets = np.array(images_arr) return image_sets
In another new code cell, the ...
Read now
Unlock full access