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
be968fef
Commit
be968fef
authored
May 15, 2018
by
MORITA Kazutaka
Committed by
Tianqi Chen
May 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Keras] ReLU6 support (#481)
parent
8db42c41
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
+11
-1
nnvm/python/nnvm/frontend/keras.py
+1
-1
nnvm/tests/python/frontend/keras/test_forward.py
+10
-0
No files found.
nnvm/python/nnvm/frontend/keras.py
View file @
be968fef
...
...
@@ -52,7 +52,7 @@ def _convert_activation(insym, keras_layer, _):
elif
act_type
==
'elu'
:
raise
NotImplementedError
(
'elu not implemented'
)
elif
act_type
==
'relu6'
:
r
aise
NotImplementedError
(
'relu6 not implemented'
)
r
eturn
_sym
.
clip
(
insym
,
a_min
=
0
,
a_max
=
6
)
elif
act_type
==
'softsign'
:
raise
NotImplementedError
(
'softsign not implemented'
)
elif
act_type
==
'hard_sigmoid'
:
...
...
nnvm/tests/python/frontend/keras/test_forward.py
View file @
be968fef
...
...
@@ -116,6 +116,15 @@ def test_forward_upsample():
verify_keras_frontend
(
keras_model
)
def
test_forward_relu6
():
data
=
keras
.
layers
.
Input
(
shape
=
(
32
,
32
,
3
))
x
=
keras
.
layers
.
Activation
(
keras
.
applications
.
mobilenet
.
relu6
)(
data
)
x
=
keras
.
layers
.
Concatenate
()([
x
,
x
])
x
=
keras
.
layers
.
GlobalMaxPooling2D
()(
x
)
keras_model
=
keras
.
models
.
Model
(
data
,
x
)
verify_keras_frontend
(
keras_model
)
def
test_forward_vgg16
():
keras_model
=
keras
.
applications
.
vgg16
.
VGG16
(
include_top
=
True
,
weights
=
None
,
input_shape
=
(
224
,
224
,
3
),
classes
=
1000
)
...
...
@@ -142,6 +151,7 @@ if __name__ == '__main__':
test_forward_transpose_conv
()
test_forward_separable_conv
()
test_forward_upsample
()
test_forward_relu6
()
test_forward_vgg16
()
test_forward_xception
()
...
...
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