Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
8c6dae88
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8c6dae88
编写于
7月 20, 2020
作者:
Z
Zirui Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docstring for compose/randomAppply/randomChoice to stay consistent with py_transforms
address review cmts address review cmts
上级
b091f74c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
9 deletion
+29
-9
mindspore/dataset/transforms/c_transforms.py
mindspore/dataset/transforms/c_transforms.py
+14
-9
mindspore/dataset/transforms/vision/c_transforms.py
mindspore/dataset/transforms/vision/c_transforms.py
+15
-0
未找到文件。
mindspore/dataset/transforms/c_transforms.py
浏览文件 @
8c6dae88
...
@@ -240,42 +240,47 @@ class Compose(cde.ComposeOp):
...
@@ -240,42 +240,47 @@ class Compose(cde.ComposeOp):
Args:
Args:
transforms (list): List of transformations to be applied.
transforms (list): List of transformations to be applied.
Example:
Examples:
>>> compose = Compose([vision.Decode(), vision.RandomCrop()])
>>> compose = Compose([vision.Decode(), vision.RandomCrop()])
>>> dataset = ds.map(operations=compose)
>>> dataset = ds.map(operations=compose)
"""
"""
@
check_random_transform_ops
@
check_random_transform_ops
def
__init__
(
self
,
op_list
):
def
__init__
(
self
,
transforms
):
super
().
__init__
(
op_list
)
super
().
__init__
(
transforms
)
class
RandomApply
(
cde
.
RandomApplyOp
):
class
RandomApply
(
cde
.
RandomApplyOp
):
"""
"""
Randomly performs a series of transforms with a given probability.
Randomly performs a series of transforms with a given probability.
Args:
Args:
transforms (list): List of transformations to be applied.
transforms (list): List of transformations to be applied.
prob (float, optional): The probability to apply the transformation list (default=0.5)
prob (float, optional): The probability to apply the transformation list (default=0.5)
Example:
Examples:
>>> rand_apply = RandomApply([vision.RandomCrop()])
>>> rand_apply = RandomApply([vision.RandomCrop()])
>>> dataset = ds.map(operations=rand_apply)
>>> dataset = ds.map(operations=rand_apply)
"""
"""
@
check_random_transform_ops
@
check_random_transform_ops
def
__init__
(
self
,
op_list
,
prob
=
0.5
):
def
__init__
(
self
,
transforms
,
prob
=
0.5
):
super
().
__init__
(
prob
,
op_list
)
super
().
__init__
(
prob
,
transforms
)
class
RandomChoice
(
cde
.
RandomChoiceOp
):
class
RandomChoice
(
cde
.
RandomChoiceOp
):
"""
"""
Randomly selects one transform from a list of transforms to perform operation.
Randomly selects one transform from a list of transforms to perform operation.
Args:
Args:
transforms (list): List of transformations to be chosen from to apply.
transforms (list): List of transformations to be chosen from to apply.
Example:
Examples:
>>> rand_choice = RandomChoice([vision.CenterCrop(), vision.RandomCrop()])
>>> rand_choice = RandomChoice([vision.CenterCrop(), vision.RandomCrop()])
>>> dataset = ds.map(operations=rand_choice)
>>> dataset = ds.map(operations=rand_choice)
"""
"""
@
check_random_transform_ops
@
check_random_transform_ops
def
__init__
(
self
,
op_list
):
def
__init__
(
self
,
transforms
):
super
().
__init__
(
op_list
)
super
().
__init__
(
transforms
)
mindspore/dataset/transforms/vision/c_transforms.py
浏览文件 @
8c6dae88
...
@@ -738,6 +738,21 @@ class UniformAugment(cde.UniformAugOp):
...
@@ -738,6 +738,21 @@ class UniformAugment(cde.UniformAugOp):
class
RandomSelectSubpolicy
(
cde
.
RandomSelectSubpolicyOp
):
class
RandomSelectSubpolicy
(
cde
.
RandomSelectSubpolicyOp
):
"""
Choose a random sub-policy from a list to be applied on the input image. A sub-policy is a list of tuples
(op, prob), where op is a TensorOp operation and prob is the probability that this op will be applied. Once
a sub-policy is selected, each op within the subpolicy with be applied in sequence according to its probability
Args:
policy (list(list(tuple(TensorOp,float))): List of sub-policies to choose from.
Examples:
>>> policy = [[(c_vision.RandomRotation((45, 45))), (c_transforms.RandomVerticalFlip()),
>>> (c_transforms.RandomColorAdjust())],
>>> [(c_vision.RandomRotation((90, 90))), (c_transforms.RandomColorAdjust())]]
>>> ds_policy = ds.map(input_columns=["image"], operations=visions.RandomSelectSubpolicy(policy))
"""
@
check_random_select_subpolicy_op
@
check_random_select_subpolicy_op
def
__init__
(
self
,
policy
):
def
__init__
(
self
,
policy
):
super
().
__init__
(
policy
)
super
().
__init__
(
policy
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录