Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
2f41a396
Unverified
Commit
2f41a396
authored
Apr 02, 2020
by
MORITA Kazutaka
Committed by
GitHub
Apr 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FRONTEND][MXNET] Use leaky by default for LeakyReLU (#5192)
parent
302e8ee2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
python/tvm/relay/frontend/mxnet.py
+1
-1
tests/python/frontend/mxnet/test_forward.py
+9
-0
No files found.
python/tvm/relay/frontend/mxnet.py
View file @
2f41a396
...
...
@@ -510,7 +510,7 @@ def _mx_pad(inputs, attrs):
pad_mode
=
pad_mode
)
def
_mx_leaky_relu
(
inputs
,
attrs
):
act_type
=
attrs
.
get_str
(
"act_type"
)
act_type
=
attrs
.
get_str
(
"act_type"
,
"leaky"
)
if
act_type
==
"leaky"
:
return
_op
.
nn
.
leaky_relu
(
inputs
[
0
],
alpha
=
attrs
.
get_float
(
"slope"
,
0.25
))
if
act_type
==
"prelu"
:
...
...
tests/python/frontend/mxnet/test_forward.py
View file @
2f41a396
...
...
@@ -107,6 +107,14 @@ def test_forward_resnet():
mx_sym
=
model_zoo
.
mx_resnet
(
18
)
verify_mxnet_frontend_impl
(
mx_sym
)
def
test_forward_leaky_relu
():
data
=
mx
.
sym
.
var
(
'data'
)
data
=
mx
.
sym
.
concat
(
data
,
-
data
,
dim
=
1
)
# negative part explicitly
mx_sym
=
mx
.
sym
.
LeakyReLU
(
data
)
verify_mxnet_frontend_impl
(
mx_sym
,
(
1
,
3
,
100
,
100
),
(
1
,
6
,
100
,
100
))
mx_sym
=
mx
.
sym
.
LeakyReLU
(
data
,
act_type
=
'leaky'
)
verify_mxnet_frontend_impl
(
mx_sym
,
(
1
,
3
,
100
,
100
),
(
1
,
6
,
100
,
100
))
def
test_forward_elu
():
data
=
mx
.
sym
.
var
(
'data'
)
data
=
mx
.
sym
.
concat
(
data
,
-
data
,
dim
=
1
)
# negative part explicitly
...
...
@@ -979,6 +987,7 @@ if __name__ == '__main__':
test_forward_mlp
()
test_forward_vgg
()
test_forward_resnet
()
test_forward_leaky_relu
()
test_forward_elu
()
test_forward_rrelu
()
test_forward_prelu
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment