Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions dataset/mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import os.path
import gzip
import pickle
import os
import numpy as np


Expand Down Expand Up @@ -39,7 +38,7 @@ def _download(file_name):

def download_mnist():
for v in key_file.values():
_download(v)
_download(v)

def _load_label(file_name):
file_path = dataset_dir + "/" + file_name
Expand Down Expand Up @@ -118,7 +117,7 @@ def load_mnist(normalize=True, flatten=True, one_hot_label=False):
dataset['test_label'] = _change_ont_hot_label(dataset['test_label'])

if not flatten:
for key in ('train_img', 'test_img'):
for key in ('train_img', 'test_img'):
dataset[key] = dataset[key].reshape(-1, 1, 28, 28)

return (dataset['train_img'], dataset['train_label']), (dataset['test_img'], dataset['test_label'])
Expand Down