MCPcopy Create free account
hub / github.com/easy-tensorflow/easy-tensorflow / load_data

Function load_data

3_Neural_Network/code/utils.py:5–19  ·  view source on GitHub ↗

Function to (download and) load the MNIST data :param mode: train or test :return: images and the corresponding labels

(mode='train')

Source from the content-addressed store, hash-verified

3
4
5def load_data(mode='train'):
6 """
7 Function to (download and) load the MNIST data
8 :param mode: train or test
9 :return: images and the corresponding labels
10 """
11 from tensorflow.examples.tutorials.mnist import input_data
12 mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
13 if mode == 'train':
14 x_train, y_train, x_valid, y_valid = mnist.train.images, mnist.train.labels, \
15 mnist.validation.images, mnist.validation.labels
16 return x_train, y_train, x_valid, y_valid
17 elif mode == 'test':
18 x_test, y_test = mnist.test.images, mnist.test.labels
19 return x_test, y_test
20
21
22def randomize(x, y):

Callers 1

main.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected