()
| 34 | |
| 35 | |
| 36 | def load_dataset(): |
| 37 | train_x_path = '/tmp/train-images-idx3-ubyte.gz' # need to change to local disk |
| 38 | train_y_path = '/tmp/train-labels-idx1-ubyte.gz' # need to change to local disk |
| 39 | valid_x_path = '/tmp/t10k-images-idx3-ubyte.gz' # need to change to local disk |
| 40 | valid_y_path = '/tmp/t10k-labels-idx1-ubyte.gz' # need to change to local disk |
| 41 | |
| 42 | train_x = read_image_file(check_dataset_exist(train_x_path)).astype( |
| 43 | np.float32) |
| 44 | train_y = read_label_file(check_dataset_exist(train_y_path)).astype( |
| 45 | np.float32) |
| 46 | valid_x = read_image_file(check_dataset_exist(valid_x_path)).astype( |
| 47 | np.float32) |
| 48 | valid_y = read_label_file(check_dataset_exist(valid_y_path)).astype( |
| 49 | np.float32) |
| 50 | return train_x, train_y, valid_x, valid_y |
| 51 | |
| 52 | |
| 53 | def read_label_file(path): |
no test coverage detected