Skip to content

adjust indent and remove no-necessary import statements on mnist.py #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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