Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
1166a091
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看板
提交
1166a091
编写于
8月 21, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
8月 21, 2020
浏览文件
操作
浏览文件
下载
差异文件
!4893 fix error of conv_variational
Merge pull request !4893 from byweng/fix_param_check
上级
5cc073c4
b126272b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
7 deletion
+7
-7
mindspore/nn/probability/bnn_layers/conv_variational.py
mindspore/nn/probability/bnn_layers/conv_variational.py
+4
-4
tests/st/probability/test_bnn_layer.py
tests/st/probability/test_bnn_layer.py
+1
-1
tests/st/probability/test_transform_bnn_layer.py
tests/st/probability/test_transform_bnn_layer.py
+1
-1
tests/st/probability/test_transform_bnn_model.py
tests/st/probability/test_transform_bnn_model.py
+1
-1
未找到文件。
mindspore/nn/probability/bnn_layers/conv_variational.py
浏览文件 @
1166a091
...
...
@@ -61,10 +61,10 @@ class _ConvVariational(_Conv):
raise
ValueError
(
'Attr
\'
pad_mode
\'
of
\'
Conv2d
\'
Op passed '
+
str
(
pad_mode
)
+
', should be one of values in
\'
valid
\'
,
\'
same
\'
,
\'
pad
\'
.'
)
if
not
isinstance
(
stride
,
(
int
,
tuple
)):
if
isinstance
(
stride
,
bool
)
or
not
isinstance
(
stride
,
(
int
,
tuple
)):
raise
TypeError
(
'The type of `stride` should be `int` of `tuple`'
)
if
not
isinstance
(
dilation
,
(
int
,
tuple
)):
if
isinstance
(
dilation
,
bool
)
or
not
isinstance
(
dilation
,
(
int
,
tuple
)):
raise
TypeError
(
'The type of `dilation` should be `int` of `tuple`'
)
# convolution args
...
...
@@ -136,8 +136,8 @@ class _ConvVariational(_Conv):
return
outputs
def
extend_repr
(
self
):
str_info
=
'in_channels={}, out_channels={}, kernel_size={},
weight_mean={},
stride={}, pad_mode={}, '
\
'padding={}, dilation={}, group={}, weight_std={}, has_bias={}'
\
str_info
=
'in_channels={}, out_channels={}, kernel_size={}, stride={}, pad_mode={}, '
\
'padding={}, dilation={}, group={}, weight_
mean={}, weight_
std={}, has_bias={}'
\
.
format
(
self
.
in_channels
,
self
.
out_channels
,
self
.
kernel_size
,
self
.
stride
,
self
.
pad_mode
,
self
.
padding
,
self
.
dilation
,
self
.
group
,
self
.
weight_posterior
.
mean
,
self
.
weight_posterior
.
untransformed_std
,
self
.
has_bias
)
...
...
tests/st/probability/test_bnn_layer.py
浏览文件 @
1166a091
...
...
@@ -137,7 +137,7 @@ if __name__ == "__main__":
epoch
=
100
for
i
in
range
(
epoch
):
train_loss
,
train_acc
=
train_model
(
train_bnn_network
,
network
,
t
est
_set
)
train_loss
,
train_acc
=
train_model
(
train_bnn_network
,
network
,
t
rain
_set
)
valid_acc
=
validate_model
(
network
,
test_set
)
...
...
tests/st/probability/test_transform_bnn_layer.py
浏览文件 @
1166a091
...
...
@@ -142,7 +142,7 @@ if __name__ == "__main__":
epoch
=
100
for
i
in
range
(
epoch
):
train_loss
,
train_acc
=
train_model
(
train_bnn_network
,
network
,
t
est
_set
)
train_loss
,
train_acc
=
train_model
(
train_bnn_network
,
network
,
t
rain
_set
)
valid_acc
=
validate_model
(
network
,
test_set
)
...
...
tests/st/probability/test_transform_bnn_model.py
浏览文件 @
1166a091
...
...
@@ -141,7 +141,7 @@ if __name__ == "__main__":
epoch
=
500
for
i
in
range
(
epoch
):
train_loss
,
train_acc
=
train_model
(
train_bnn_network
,
network
,
t
est
_set
)
train_loss
,
train_acc
=
train_model
(
train_bnn_network
,
network
,
t
rain
_set
)
valid_acc
=
validate_model
(
network
,
test_set
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录