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
b65a13dd
Commit
b65a13dd
authored
Jul 30, 2018
by
Siju
Committed by
Tianqi Chen
Jul 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Activations for coreml added (#1508)
parent
c8aa6f99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
nnvm/python/nnvm/frontend/coreml.py
+6
-4
nnvm/python/nnvm/top/image.py
+1
-1
No files found.
nnvm/python/nnvm/frontend/coreml.py
View file @
b65a13dd
...
...
@@ -102,9 +102,10 @@ def ActivationParams(op, insym, symtab):
elif
whichActivation
==
'leakyReLU'
:
return
_sym
.
leaky_relu
(
insym
,
alpha
=
par
.
alpha
)
elif
whichActivation
==
'thresholdedReLU'
:
raise
NotImplementedError
(
'thresholdedReLU not implemented'
)
alpha_tensor
=
_sym
.
full_like
(
insym
,
fill_value
=
float
(
par
.
alpha
))
return
_sym
.
elemwise_mul
(
insym
,
_sym
.
greater
(
insym
,
alpha_tensor
))
elif
whichActivation
==
'PReLU'
:
r
aise
NotImplementedError
(
'PReLU not implemented'
)
r
eturn
_sym
.
prelu
(
insym
,
alpha
=
par
.
alpha
)
elif
whichActivation
==
'tanh'
:
return
_sym
.
tanh
(
insym
)
elif
whichActivation
==
'scaledTanh'
:
...
...
@@ -113,12 +114,13 @@ def ActivationParams(op, insym, symtab):
elif
whichActivation
==
'sigmoid'
:
return
_sym
.
sigmoid
(
insym
)
elif
whichActivation
==
'sigmoidHard'
:
raise
NotImplementedError
(
'sigmoidHard not immplemented'
)
transformX
=
(
par
.
alpha
*
insym
)
+
par
.
beta
return
_sym
.
clip
(
transformX
,
a_min
=
0
,
a_max
=
1
)
elif
whichActivation
==
'ELU'
:
return
_sym
.
__mul_scalar__
(
_sym
.
__add_scalar__
(
_sym
.
exp
(
insym
),
scalar
=-
1
),
scalar
=
par
.
alpha
)
elif
whichActivation
==
'softsign'
:
r
aise
NotImplementedError
(
'softsign not implemented'
)
r
eturn
insym
/
(
1
+
(
_sym
.
relu
(
insym
)
+
_sym
.
relu
(
_sym
.
negative
(
insym
)))
)
elif
whichActivation
==
'softplus'
:
return
_sym
.
log
(
_sym
.
__add_scalar__
(
_sym
.
exp
(
insym
),
scalar
=
1
))
elif
whichActivation
==
'parametricSoftplus'
:
...
...
nnvm/python/nnvm/top/image.py
View file @
b65a13dd
...
...
@@ -2,8 +2,8 @@
"""Definition of image ops"""
from
__future__
import
absolute_import
import
topi
import
tvm
import
topi
from
.
import
registry
as
reg
from
.registry
import
OpPattern
...
...
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