O'Reilly Japan出版の - ゼロから作るDeep Learningを今読んでいるのですが、分からない点があるので質問があります。
コードの14行目(x_train, t_train), (x_test, t_test) のそれぞれxとyの訓練とテストの役割がイメージできないので教えてください。
import sys, os sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定 import numpy as np from dataset.mnist import load_mnist from PIL import Image def img_show(img): pil_img = Image.fromarray(np.uint8(img)) pil_img.show() (x_train, t_train), (x_test, t_test) = load_mnist(flatten=True, normalize=False) img = x_train[0] label = t_train[0] print(label) # 5 print(img.shape) # (784,) img = img.reshape(20, 20) # 形状を元の画像サイズに変形 print(img.shape) # (28, 28) img_show(img)
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/02/13 15:47
2018/02/13 15:57
2018/02/14 11:37