Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
兔爷不爱我
mindspore
提交
206b36cc
M
mindspore
项目概览
兔爷不爱我
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
0
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
206b36cc
编写于
5月 08, 2020
作者:
S
shijianning
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix pylint warnings
上级
a06694ab
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
8 addition
and
9 deletion
+8
-9
example/yolov3_coco2017/train.py
example/yolov3_coco2017/train.py
+5
-6
mindspore/_akg/utils/format_transform.py
mindspore/_akg/utils/format_transform.py
+2
-2
mindspore/model_zoo/Bert_NEZHA/bert_for_pre_training.py
mindspore/model_zoo/Bert_NEZHA/bert_for_pre_training.py
+1
-1
未找到文件。
example/yolov3_coco2017/train.py
浏览文件 @
206b36cc
...
...
@@ -41,23 +41,22 @@ from config import ConfigYOLOV3ResNet18
def
get_lr
(
learning_rate
,
start_step
,
global_step
,
decay_step
,
decay_rate
,
steps
=
False
):
"""Set learning rate."""
lr_each_step
=
[]
lr
=
learning_rate
for
i
in
range
(
global_step
):
if
steps
:
lr_each_step
.
append
(
l
r
*
(
decay_rate
**
(
i
//
decay_step
)))
lr_each_step
.
append
(
l
earning_rate
*
(
decay_rate
**
(
i
//
decay_step
)))
else
:
lr_each_step
.
append
(
l
r
*
(
decay_rate
**
(
i
/
decay_step
)))
lr_each_step
.
append
(
l
earning_rate
*
(
decay_rate
**
(
i
/
decay_step
)))
lr_each_step
=
np
.
array
(
lr_each_step
).
astype
(
np
.
float32
)
lr_each_step
=
lr_each_step
[
start_step
:]
return
lr_each_step
def
init_net_param
(
net
,
init
=
'ones'
):
"""Init the parameters in net."""
def
init_net_param
(
net
,
init
_value
=
'ones'
):
"""Init
:wq
the parameters in net."""
params
=
net
.
trainable_params
()
for
p
in
params
:
if
isinstance
(
p
.
data
,
Tensor
)
and
'beta'
not
in
p
.
name
and
'gamma'
not
in
p
.
name
and
'bias'
not
in
p
.
name
:
p
.
set_parameter_data
(
initializer
(
init
,
p
.
data
.
shape
(),
p
.
data
.
dtype
()))
p
.
set_parameter_data
(
initializer
(
init
_value
,
p
.
data
.
shape
(),
p
.
data
.
dtype
()))
if
__name__
==
'__main__'
:
...
...
mindspore/_akg/utils/format_transform.py
浏览文件 @
206b36cc
...
...
@@ -15,9 +15,9 @@
"""format transform function"""
import
_akg
def
refine_reduce_axis
(
input
,
axis
):
def
refine_reduce_axis
(
input
_content
,
axis
):
"""make reduce axis legal."""
shape
=
get_shape
(
input
)
shape
=
get_shape
(
input
_content
)
if
axis
is
None
:
axis
=
[
i
for
i
in
range
(
len
(
shape
))]
elif
isinstance
(
axis
,
int
):
...
...
mindspore/model_zoo/Bert_NEZHA/bert_for_pre_training.py
浏览文件 @
206b36cc
...
...
@@ -55,7 +55,7 @@ class ClipGradients(nn.Cell):
grads
,
clip_type
,
clip_value
):
if
clip_type
!=
0
and
clip_type
!=
1
:
if
clip_type
not
in
(
0
,
1
)
:
return
grads
new_grads
=
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录