官术网_书友最值得收藏!

  • Keras Deep Learning Cookbook
  • Rajdeep Dua Manpreet Singh Ghotra
  • 92字
  • 2021-06-10 19:38:52

How to do it...

Let's look at the code on how to load MNIST data into numpy arrays using the keras.datasets.mnist class:

from keras.datasets import mnist
(X_train, y_train), (X_test, y_test) = mnist.load_data()
print("X_train shape: " + str(X_train.shape))
print("y_train shape: " + str(y_train.shape))
print("X_test shape: " + str(X_test.shape))
print("y_test shape: " + str(y_test.shape))

The output of the preceding list shows the following dataset shape:

X_train shape: (60000, 28, 28)
y_train shape: (60000,)
X_test shape: (10000, 28, 28)
y_test shape: (10000,)

Next, let's look at how to load data from a .csv file.

主站蜘蛛池模板: 中牟县| 徐汇区| 阳曲县| 甘德县| 西峡县| 依安县| 汉阴县| 宁城县| 濉溪县| 莎车县| 容城县| 安新县| 肥乡县| 连城县| 商水县| 沙洋县| 德昌县| 马山县| 于都县| 龙门县| 宁明县| 英山县| 利津县| 襄樊市| 鸡东县| 瓦房店市| 富民县| 江阴市| 江孜县| 衡阳市| 永城市| 札达县| 古蔺县| 东源县| 策勒县| 涞源县| 新河县| 文化| 隆德县| 海晏县| 竹山县|