Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
docs
提交
c1ed3365
D
docs
项目概览
MindSpore
/
docs
通知
4
Star
2
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c1ed3365
编写于
4月 01, 2020
作者:
Y
Yanjun Peng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix batch repeat usage order
上级
5aafe2f0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
18 deletion
+18
-18
tutorials/source_en/advanced_use/computer_vision_application.md
...als/source_en/advanced_use/computer_vision_application.md
+3
-3
tutorials/source_en/advanced_use/distributed_training.md
tutorials/source_en/advanced_use/distributed_training.md
+3
-3
tutorials/source_zh_cn/advanced_use/computer_vision_application.md
.../source_zh_cn/advanced_use/computer_vision_application.md
+3
-3
tutorials/source_zh_cn/advanced_use/distributed_training.md
tutorials/source_zh_cn/advanced_use/distributed_training.md
+3
-3
tutorials/tutorial_code/distributed_training/resnet50_distributed_training.py
...ode/distributed_training/resnet50_distributed_training.py
+3
-3
tutorials/tutorial_code/resnet/cifar_resnet50.py
tutorials/tutorial_code/resnet/cifar_resnet50.py
+3
-3
未找到文件。
tutorials/source_en/advanced_use/computer_vision_application.md
浏览文件 @
c1ed3365
...
...
@@ -129,14 +129,14 @@ tar -zvxf cifar-10-binary.tar.gz
Shuffle data randomly to disorder the data sequence and read data in batches for model training:
```python
# apply repeat operations
cifar_ds = cifar_ds.repeat(repeat_num)
# apply shuffle operations
cifar_ds = cifar_ds.shuffle(buffer_size=10)
# apply batch operations
cifar_ds = cifar_ds.batch(batch_size=args_opt.batch_size, drop_remainder=True)
# apply repeat operations
cifar_ds = cifar_ds.repeat(repeat_num)
```
...
...
tutorials/source_en/advanced_use/distributed_training.md
浏览文件 @
c1ed3365
...
...
@@ -145,15 +145,15 @@ def create_dataset(repeat_num=1, batch_size=32, rank_id=0, rank_size=1):
data_set
=
data_set
.
map
(
input_columns
=
"label"
,
operations
=
type_cast_op
)
data_set
=
data_set
.
map
(
input_columns
=
"image"
,
operations
=
c_trans
)
# apply repeat operations
data_set
=
data_set
.
repeat
(
repeat_num
)
# apply shuffle operations
data_set
=
data_set
.
shuffle
(
buffer_size
=
10
)
# apply batch operations
data_set
=
data_set
.
batch
(
batch_size
=
batch_size
,
drop_remainder
=
True
)
# apply repeat operations
data_set
=
data_set
.
repeat
(
repeat_num
)
return
data_set
```
...
...
tutorials/source_zh_cn/advanced_use/computer_vision_application.md
浏览文件 @
c1ed3365
...
...
@@ -131,14 +131,14 @@ tar -zvxf cifar-10-binary.tar.gz
最后通过数据混洗(shuffle)随机打乱数据的顺序,并按batch读取数据,进行模型训练:
```python
# apply repeat operations
cifar_ds = cifar_ds.repeat(repeat_num)
# apply shuffle operations
cifar_ds = cifar_ds.shuffle(buffer_size=10)
# apply batch operations
cifar_ds = cifar_ds.batch(batch_size=args_opt.batch_size, drop_remainder=True)
# apply repeat operations
cifar_ds = cifar_ds.repeat(repeat_num)
```
...
...
tutorials/source_zh_cn/advanced_use/distributed_training.md
浏览文件 @
c1ed3365
...
...
@@ -144,15 +144,15 @@ def create_dataset(repeat_num=1, batch_size=32, rank_id=0, rank_size=1):
data_set
=
data_set
.
map
(
input_columns
=
"label"
,
operations
=
type_cast_op
)
data_set
=
data_set
.
map
(
input_columns
=
"image"
,
operations
=
c_trans
)
# apply repeat operations
data_set
=
data_set
.
repeat
(
repeat_num
)
# apply shuffle operations
data_set
=
data_set
.
shuffle
(
buffer_size
=
10
)
# apply batch operations
data_set
=
data_set
.
batch
(
batch_size
=
batch_size
,
drop_remainder
=
True
)
# apply repeat operations
data_set
=
data_set
.
repeat
(
repeat_num
)
return
data_set
```
...
...
tutorials/tutorial_code/distributed_training/resnet50_distributed_training.py
浏览文件 @
c1ed3365
...
...
@@ -69,15 +69,15 @@ def create_dataset(repeat_num=1, batch_size=32, rank_id=0, rank_size=1):
data_set
=
data_set
.
map
(
input_columns
=
"label"
,
operations
=
type_cast_op
)
data_set
=
data_set
.
map
(
input_columns
=
"image"
,
operations
=
c_trans
)
# apply repeat operations
data_set
=
data_set
.
repeat
(
repeat_num
)
# apply shuffle operations
data_set
=
data_set
.
shuffle
(
buffer_size
=
10
)
# apply batch operations
data_set
=
data_set
.
batch
(
batch_size
=
batch_size
,
drop_remainder
=
True
)
# apply repeat operations
data_set
=
data_set
.
repeat
(
repeat_num
)
return
data_set
...
...
tutorials/tutorial_code/resnet/cifar_resnet50.py
浏览文件 @
c1ed3365
...
...
@@ -91,15 +91,15 @@ def create_dataset(repeat_num=1, training=True):
cifar_ds
=
cifar_ds
.
map
(
input_columns
=
"label"
,
operations
=
type_cast_op
)
cifar_ds
=
cifar_ds
.
map
(
input_columns
=
"image"
,
operations
=
c_trans
)
# apply repeat operations
cifar_ds
=
cifar_ds
.
repeat
(
repeat_num
)
# apply shuffle operations
cifar_ds
=
cifar_ds
.
shuffle
(
buffer_size
=
10
)
# apply batch operations
cifar_ds
=
cifar_ds
.
batch
(
batch_size
=
args_opt
.
batch_size
,
drop_remainder
=
True
)
# apply repeat operations
cifar_ds
=
cifar_ds
.
repeat
(
repeat_num
)
return
cifar_ds
if
__name__
==
'__main__'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录