335 Star 1.5K Fork 865

MindSpore / docs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
cifar10.md 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
俞涵 提交于 2023-01-29 16:21 . add mindquantum and modify url

Function Differences with tf.keras.datasets.cifar10

tf.keras.datasets.cifar10

class tf.keras.datasets.cifar10()

For more information, see tf.keras.datasets.cifar10.

mindspore.dataset.Cifar10Dataset

class mindspore.dataset.Cifar10Dataset(
    dataset_dir,
    usage=None,
    num_samples=None,
    num_parallel_workers=None,
    shuffle=None,
    sampler=None,
    num_shards=None,
    shard_id=None,
    cache=None
)

For more information, see mindspore.dataset.Cifar10Dataset.

Differences

TensorFlow: The Cifar10 dataset can be downloaded and loaded using the load_data method within this class.

MindSpore: Load the Cifar10 dataset file from the specified path and return the Dataset.

Code Example

# The following implements Cifar10Dataset with MindSpore.
import mindspore.dataset as ds

cifar10_dataset_dir = "/path/to/cifar10_dataset_directory"
dataset = ds.Cifar10Dataset(dataset_dir=cifar10_dataset_dir)

# The following implements cifar10 with TensorFlow.
import tensorflow as tf

(x_train, y_train), (x_test, y_test) = tf.keras.datasets.cifar10.load_data()
1
https://gitee.com/mindspore/docs.git
git@gitee.com:mindspore/docs.git
mindspore
docs
docs
r2.0.0-alpha

搜索帮助