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
71cff3e8
Commit
71cff3e8
authored
Aug 02, 2018
by
Pariksheet Pinjari
Committed by
Tianqi Chen
Aug 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MXNET] LRN support in MXNET frontend (#1520)
parent
a2870fef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
+17
-1
nnvm/python/nnvm/frontend/mxnet.py
+11
-1
nnvm/tests/python/frontend/mxnet/test_forward.py
+6
-0
No files found.
nnvm/python/nnvm/frontend/mxnet.py
View file @
71cff3e8
...
...
@@ -263,6 +263,15 @@ def _expand_dims(inputs, attrs):
new_attrs
[
'axis'
]
=
_required_attr
(
attrs
,
'axis'
)
return
_get_nnvm_op
(
op_name
)(
*
inputs
,
**
new_attrs
)
def
_lrn
(
inputs
,
attrs
):
op_name
,
new_attrs
=
"lrn"
,
{}
new_attrs
[
'alpha'
]
=
attrs
.
get
(
'alpha'
,
0.0001
)
new_attrs
[
'beta'
]
=
attrs
.
get
(
'beta'
,
0.75
)
new_attrs
[
'bias'
]
=
attrs
.
get
(
'knorm'
,
2
)
# NCHW format and normalization along channel axis
new_attrs
[
'axis'
]
=
1
new_attrs
[
'size'
]
=
_required_attr
(
attrs
,
'nsize'
)
return
_get_nnvm_op
(
op_name
)(
*
inputs
,
**
new_attrs
)
_identity_list
=
[
'__add_scalar__'
,
'__add_symbol__'
,
'__div_scalar__'
,
'__div_symbol__'
,
'__mul_scalar__'
,
'__mul_symbol__'
,
...
...
@@ -314,7 +323,8 @@ _convert_map = {
'sum_axis'
:
_rename
(
'sum'
),
'UpSampling'
:
_upsampling
,
'clip'
:
_clip
,
'expand_dims'
:
_expand_dims
'expand_dims'
:
_expand_dims
,
'LRN'
:
_lrn
}
def
_convert_symbol
(
op_name
,
inputs
,
attrs
,
...
...
nnvm/tests/python/frontend/mxnet/test_forward.py
View file @
71cff3e8
...
...
@@ -149,6 +149,11 @@ def test_forward_pooling():
mx_sym
=
mx
.
sym
.
Pooling
(
data
,
kernel
=
(
3
,
3
),
pad
=
(
1
,
1
),
pool_type
=
'max'
)
verify_mxnet_frontend_impl
(
mx_sym
,
(
1
,
20
,
8
,
8
),
(
1
,
20
,
8
,
8
))
def
test_forward_lrn
():
data
=
mx
.
sym
.
var
(
'data'
)
mx_sym
=
mx
.
sym
.
LRN
(
data
,
alpha
=
2
,
beta
=
2
,
knorm
=
1
,
nsize
=
5
)
verify_mxnet_frontend_impl
(
mx_sym
,
(
1
,
10
,
24
,
24
),
(
1
,
10
,
24
,
24
))
if
__name__
==
'__main__'
:
test_forward_mlp
()
test_forward_vgg
()
...
...
@@ -163,3 +168,4 @@ if __name__ == '__main__':
test_forward_split_squeeze
()
test_forward_expand_dims
()
test_forward_pooling
()
test_forward_lrn
()
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