ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 100种物体分类(cifar100) 50,000 张 32x32 彩色训练图像数据,以及 10,000 张测试图像数据,总共分为 100 个类别。 用法: ~~~ import numpy as np import matplotlib.pyplot as plt from AADeepLearning.datasets import cifar100 (x_train, y_train), (x_test, y_test) = cifar100.load_data(label_mode='fine') print('x_train shape:', x_train.shape) print('y_train shape:', y_train.shape) print('x_test shape:', x_test.shape) print('y_test shape:', y_test.shape) x_train = np.transpose(x_train, (0,2,3,1)) plt.figure(figsize=(1,1)) plt.imshow(x_train[0]) plt.show() ~~~ ``` #输出 x_train shape: (50000, 3, 32, 32) y_train shape: (50000, 1) x_test shape: (10000, 3, 32, 32) y_test shape: (10000, 1) ``` * **返回:** * 2 个元组: * **x\_train, x\_test**: uint8 数组表示的 RGB 图像数据,尺寸为 (num\_samples, 3, 32, 32) 或 (num\_samples, 32, 32, 3),基于`image_data_format`后端设定的`channels_first`或`channels_last`。 * **y\_train, y\_test**: uint8 数组表示的类别标签(范围在 0-9 之间的整数),尺寸为 (num\_samples,)。