Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindarmour
提交
b7ef2e0b
M
mindarmour
项目概览
MindSpore
/
mindarmour
通知
4
Star
2
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindarmour
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b7ef2e0b
编写于
5月 15, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
5月 15, 2020
浏览文件
操作
浏览文件
下载
差异文件
!18 Modify the inputs batch_size of defense tests to adapt to current version MindSpore.
Merge pull request !18 from jxlang910/master
上级
151e10e8
aeba2b3e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
7 addition
and
7 deletion
+7
-7
example/mnist_demo/lenet5_mnist_fuzzing.py
example/mnist_demo/lenet5_mnist_fuzzing.py
+2
-2
tests/ut/python/defenses/test_ad.py
tests/ut/python/defenses/test_ad.py
+1
-1
tests/ut/python/defenses/test_ead.py
tests/ut/python/defenses/test_ead.py
+2
-2
tests/ut/python/defenses/test_nad.py
tests/ut/python/defenses/test_nad.py
+1
-1
tests/ut/python/defenses/test_pad.py
tests/ut/python/defenses/test_pad.py
+1
-1
未找到文件。
example/mnist_demo/lenet5_mnist_fuzzing.py
浏览文件 @
b7ef2e0b
...
...
@@ -41,7 +41,7 @@ def test_lenet_mnist_fuzzing():
model
=
Model
(
net
)
# get training data
data_list
=
"./MNIST_
datasets
/train"
data_list
=
"./MNIST_
unzip
/train"
batch_size
=
32
ds
=
generate_mnist_dataset
(
data_list
,
batch_size
,
sparse
=
True
)
train_images
=
[]
...
...
@@ -55,7 +55,7 @@ def test_lenet_mnist_fuzzing():
# fuzz test with original test data
# get test data
data_list
=
"./MNIST_
datasets
/test"
data_list
=
"./MNIST_
unzip
/test"
batch_size
=
32
ds
=
generate_mnist_dataset
(
data_list
,
batch_size
,
sparse
=
True
)
test_images
=
[]
...
...
tests/ut/python/defenses/test_ad.py
浏览文件 @
b7ef2e0b
...
...
@@ -39,7 +39,7 @@ TAG = 'Ad_Test'
def
test_ad
():
"""UT for adversarial defense."""
num_classes
=
10
batch_size
=
16
batch_size
=
32
sparse
=
False
context
.
set_context
(
mode
=
context
.
GRAPH_MODE
)
...
...
tests/ut/python/defenses/test_ead.py
浏览文件 @
b7ef2e0b
...
...
@@ -41,7 +41,7 @@ TAG = 'Ead_Test'
def
test_ead
():
"""UT for ensemble adversarial defense."""
num_classes
=
10
batch_size
=
16
batch_size
=
64
sparse
=
False
context
.
set_context
(
mode
=
context
.
GRAPH_MODE
)
...
...
@@ -53,7 +53,7 @@ def test_ead():
if
not
sparse
:
labels
=
np
.
eye
(
num_classes
)[
labels
].
astype
(
np
.
float32
)
net
=
Simple
Net
()
net
=
Net
()
loss_fn
=
nn
.
SoftmaxCrossEntropyWithLogits
(
is_grad
=
False
,
sparse
=
sparse
)
optimizer
=
Momentum
(
net
.
trainable_params
(),
0.001
,
0.9
)
...
...
tests/ut/python/defenses/test_nad.py
浏览文件 @
b7ef2e0b
...
...
@@ -39,7 +39,7 @@ TAG = 'Nad_Test'
def
test_nad
():
"""UT for natural adversarial defense."""
num_classes
=
10
batch_size
=
16
batch_size
=
32
sparse
=
False
context
.
set_context
(
mode
=
context
.
GRAPH_MODE
)
...
...
tests/ut/python/defenses/test_pad.py
浏览文件 @
b7ef2e0b
...
...
@@ -39,7 +39,7 @@ TAG = 'Pad_Test'
def
test_pad
():
"""UT for projected adversarial defense."""
num_classes
=
10
batch_size
=
16
batch_size
=
32
sparse
=
False
context
.
set_context
(
mode
=
context
.
GRAPH_MODE
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录