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
ca06e6c3
Commit
ca06e6c3
authored
Mar 05, 2018
by
Matthew Brookhart
Committed by
Scott Cyphers
Mar 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rework autodiff of tanh for stability on LC (#591)
parent
22347363
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
tanh.cpp
src/ngraph/ops/tanh.cpp
+2
-5
No files found.
src/ngraph/ops/tanh.cpp
View file @
ca06e6c3
...
@@ -15,16 +15,13 @@
...
@@ -15,16 +15,13 @@
*******************************************************************************/
*******************************************************************************/
#include "ngraph/ops/tanh.hpp"
#include "ngraph/ops/tanh.hpp"
#include "ngraph/ops/cosh.hpp"
#include "ngraph/ops/divide.hpp"
#include "ngraph/ops/multiply.hpp"
#include "ngraph/ops/multiply.hpp"
#include "ngraph/ops/subtract.hpp"
void
ngraph
::
op
::
Tanh
::
generate_adjoints
(
autodiff
::
Adjoints
&
adjoints
,
void
ngraph
::
op
::
Tanh
::
generate_adjoints
(
autodiff
::
Adjoints
&
adjoints
,
const
std
::
shared_ptr
<
Node
>&
delta
)
const
std
::
shared_ptr
<
Node
>&
delta
)
{
{
auto
x
=
get_input_op
(
0
);
auto
x
=
get_input_op
(
0
);
auto
c
=
std
::
make_shared
<
op
::
Cosh
>
(
x
);
adjoints
.
add_delta
(
x
,
delta
-
(
delta
*
(
shared_from_this
()
*
shared_from_this
())));
adjoints
.
add_delta
(
x
,
delta
/
(
c
*
c
));
}
}
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