加載 CIFAR100 數據集。
用法
tf.keras.datasets.cifar100.load_data(
label_mode='fine'
)
參數
-
label_mode
"fine"、"coarse" 之一。如果是"fine",則類別標簽是細粒度標簽,如果是"coarse",則輸出標簽是coarse-grained 超類。
返回
-
NumPy 數組元組:
(x_train, y_train), (x_test, y_test)
。
這是一個包含 50,000 個 32x32 顏色訓練圖像和 10,000 個測試圖像的數據集,標記了 100 多個細粒度類,這些類被分組為 20 個coarse-grained 類。在 CIFAR 主頁上查看更多信息。
x_train:uint8 具有形狀的灰度圖像數據的 NumPy 數組(50000, 32, 32, 3)
,包含訓練數據。像素值範圍從 0 到 255。
y_train:uint8 NumPy 形狀的標簽數組(0-99 範圍內的整數)(50000, 1)
對於訓練數據。
x_test:uint8 具有形狀的灰度圖像數據的 NumPy 數組(10000, 32, 32, 3)
,包含測試數據。像素值範圍從 0 到 255。
y_test:uint8 NumPy 形狀的標簽數組(0-99 範圍內的整數)(10000, 1)
為測試數據。
例子:
(x_train, y_train), (x_test, y_test) = keras.datasets.cifar100.load_data()
assert x_train.shape == (50000, 32, 32, 3)
assert x_test.shape == (10000, 32, 32, 3)
assert y_train.shape == (50000, 1)
assert y_test.shape == (10000, 1)
相關用法
- Python tf.keras.datasets.cifar10.load_data用法及代碼示例
- Python tf.keras.datasets.fashion_mnist.load_data用法及代碼示例
- Python tf.keras.datasets.mnist.load_data用法及代碼示例
- Python tf.keras.datasets.imdb.get_word_index用法及代碼示例
- Python tf.keras.applications.inception_resnet_v2.preprocess_input用法及代碼示例
- Python tf.keras.metrics.Mean.merge_state用法及代碼示例
- Python tf.keras.layers.InputLayer用法及代碼示例
- Python tf.keras.callbacks.ReduceLROnPlateau用法及代碼示例
- Python tf.keras.layers.serialize用法及代碼示例
- Python tf.keras.metrics.Hinge用法及代碼示例
- Python tf.keras.experimental.WideDeepModel.compute_loss用法及代碼示例
- Python tf.keras.metrics.SparseCategoricalAccuracy.merge_state用法及代碼示例
- Python tf.keras.metrics.RootMeanSquaredError用法及代碼示例
- Python tf.keras.applications.resnet50.preprocess_input用法及代碼示例
- Python tf.keras.metrics.SparseCategoricalCrossentropy.merge_state用法及代碼示例
- Python tf.keras.metrics.sparse_categorical_accuracy用法及代碼示例
- Python tf.keras.layers.Dropout用法及代碼示例
- Python tf.keras.activations.softplus用法及代碼示例
- Python tf.keras.utils.custom_object_scope用法及代碼示例
- Python tf.keras.optimizers.Optimizer.set_weights用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.keras.datasets.cifar100.load_data。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。