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
ce34ae16
Commit
ce34ae16
authored
Jun 05, 2018
by
Pariksheet Pinjari
Committed by
Tianqi Chen
Jun 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NNVM] Elu support added in darknet frontend (#1199)
parent
5f7f4138
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
+17
-1
nnvm/python/nnvm/frontend/darknet.py
+4
-0
nnvm/tests/python/frontend/darknet/test_forward.py
+13
-1
No files found.
nnvm/python/nnvm/frontend/darknet.py
View file @
ce34ae16
...
...
@@ -302,6 +302,8 @@ def _darknet_activations(inputs, attrs):
return
inputs
,
None
elif
ACTIVATION
.
LEAKY
==
act
:
act_type
=
'leaky_relu'
elif
ACTIVATION
.
ELU
==
act
:
act_type
=
'elu'
else
:
_darknet_raise_not_supported
(
'act: '
+
act
)
...
...
@@ -312,6 +314,8 @@ def _darknet_activations(inputs, attrs):
op_name
,
new_attrs
=
act_type
,
{}
new_attrs
[
'alpha'
]
=
attrs
.
get
(
'slope'
,
0.1
)
sym
=
_darknet_get_nnvm_op
(
op_name
)(
*
inputs
,
**
new_attrs
)
elif
act_type
in
[
'elu'
]:
sym
=
-
1
*
_sym
.
relu
(
1
-
_sym
.
exp
(
*
inputs
))
+
_sym
.
relu
(
*
inputs
)
else
:
_darknet_raise_not_supported
(
'act_type: '
+
act_type
)
return
sym
,
None
...
...
nnvm/tests/python/frontend/darknet/test_forward.py
View file @
ce34ae16
...
...
@@ -138,7 +138,7 @@ def test_forward_resnet50():
def
test_forward_yolo
():
'''test yolo model'''
model_name
=
'yolo'
model_name
=
'yolo
v2
'
cfg_name
=
model_name
+
'.cfg'
weights_name
=
model_name
+
'.weights'
cfg_url
=
'https://github.com/pjreddie/darknet/blob/master/cfg/'
+
cfg_name
+
'?raw=true'
...
...
@@ -242,6 +242,17 @@ def test_forward_region():
test_forward
(
net
)
LIB
.
free_network
(
net
)
def
test_forward_elu
():
'''test elu activation layer'''
net
=
LIB
.
make_network
(
1
)
layer_1
=
LIB
.
make_convolutional_layer
(
1
,
224
,
224
,
3
,
32
,
1
,
3
,
2
,
0
,
1
,
0
,
0
,
0
,
0
)
layer_1
.
activation
=
8
net
.
layers
[
0
]
=
layer_1
net
.
w
=
net
.
h
=
224
LIB
.
resize_network
(
net
,
224
,
224
)
test_forward
(
net
)
LIB
.
free_network
(
net
)
if
__name__
==
'__main__'
:
test_forward_resnet50
()
test_forward_alexnet
()
...
...
@@ -255,3 +266,4 @@ if __name__ == '__main__':
test_forward_dense
()
test_forward_reorg
()
test_forward_region
()
test_forward_elu
()
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