Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
7b9f581a
Commit
7b9f581a
authored
Dec 03, 2019
by
Gleb Kazantaev
Committed by
Scott Cyphers
Dec 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Selu op decomposition (#3976)
* Fixed Selu op decomposition * Updated Selu op
parent
420c8c0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
selu.cpp
src/ngraph/op/fused/selu.cpp
+12
-6
No files found.
src/ngraph/op/fused/selu.cpp
View file @
7b9f581a
...
...
@@ -39,12 +39,18 @@ NodeVector op::v0::Selu::decompose_op() const
const
auto
data
=
input_value
(
0
);
const
auto
alpha
=
input_value
(
1
);
const
auto
lambda
=
input_value
(
2
);
const
auto
zero_node
=
std
::
make_shared
<
ngraph
::
op
::
Constant
>
(
data
.
get_element_type
(),
data
.
get_shape
(),
std
::
vector
<
double
>
{
0
});
return
{
lambda
*
(
std
::
make_shared
<
op
::
Maximum
>
(
data
,
zero_node
)
+
alpha
*
std
::
make_shared
<
op
::
Exp
>
(
std
::
make_shared
<
op
::
Minimum
>
(
data
,
zero_node
))
-
alpha
)};
const
auto
zero_node
=
op
::
Constant
::
create
(
data
.
get_element_type
(),
Shape
{
1
},
{
0
});
// lambda * ((max(data, 0) + (alpha * exp(min(data, 0)) - alpha))
return
{
std
::
make_shared
<
op
::
v1
::
Multiply
>
(
lambda
,
std
::
make_shared
<
op
::
v1
::
Add
>
(
std
::
make_shared
<
op
::
v1
::
Maximum
>
(
data
,
zero_node
),
std
::
make_shared
<
op
::
v1
::
Subtract
>
(
std
::
make_shared
<
op
::
v1
::
Multiply
>
(
alpha
,
std
::
make_shared
<
op
::
Exp
>
(
std
::
make_shared
<
op
::
v1
::
Minimum
>
(
data
,
zero_node
))),
alpha
)))};
}
shared_ptr
<
Node
>
op
::
v0
::
Selu
::
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
...
...
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