Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cld
ml
tvm
Commits
b65a13dd
Commit
b65a13dd
authored
6 years ago
by
Siju
Committed by
Tianqi Chen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Activations for coreml added (#1508)
parent
c8aa6f99
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nnvm/python/nnvm/frontend/coreml.py
+6
-4
6 additions, 4 deletions
nnvm/python/nnvm/frontend/coreml.py
nnvm/python/nnvm/top/image.py
+1
-1
1 addition, 1 deletion
nnvm/python/nnvm/top/image.py
with
7 additions
and
5 deletions
nnvm/python/nnvm/frontend/coreml.py
+
6
−
4
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
'
:
...
...
This diff is collapsed.
Click to expand it.
nnvm/python/nnvm/top/image.py
+
1
−
1
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment