2.5K Star 8.4K Fork 4.7K

GVPMindSpore/mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mindspore.dataset.SubsetRandomSampler.rst 816 Bytes
一键复制 编辑 原始数据 按行查看 历史
luojianing 提交于 2023-05-04 10:02 . add ` for values

mindspore.dataset.SubsetRandomSampler

.. py:class:: mindspore.dataset.SubsetRandomSampler(indices, num_samples=None)

    给定样本的索引序列,从序列中随机获取索引对数据集进行采样。

    参数:
        - **indices** (Iterable) - 样本索引的序列(除了string类型外的任意Python可迭代对象类型)。
        - **num_samples** (int, 可选) - 获取的样本数,可用于部分获取采样得到的样本。默认值: ``None`` ,获取采样到的所有样本。

    异常:
        - **TypeError** - `indices` 的类型不是int。
        - **TypeError** - `num_samples` 的类型不是int。
        - **ValueError** - `num_samples` 为负值。

    .. include:: mindspore.dataset.BuiltinSampler.rst
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
r2.3.q1

搜索帮助