MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / getMNISTFormat

Function getMNISTFormat

keras_examples/util.py:22–35  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

20 return getMNISTFormat('../large_files/fashionmnist/fashion-mnist_train.csv')
21
22def getMNISTFormat(path):
23 # MNIST data:
24 # column 0 is labels
25 # column 1-785 is data, with values 0 .. 255
26 # total size of CSV: (42000, 1, 28, 28)
27 train = pd.read_csv(path).values.astype(np.float32)
28 train = shuffle(train)
29
30 Xtrain = train[:-1000,1:] / 255.0
31 Ytrain = train[:-1000,0].astype(np.int32)
32
33 Xtest = train[-1000:,1:] / 255.0
34 Ytest = train[-1000:,0].astype(np.int32)
35 return Xtrain, Ytrain, Xtest, Ytest
36
37def getKaggleMNIST3D():
38 Xtrain, Ytrain, Xtest, Ytest = getKaggleMNIST()

Callers 2

getKaggleMNISTFunction · 0.85
getKaggleFashionMNISTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected