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
0f8c8bf7
Commit
0f8c8bf7
authored
Jun 27, 2019
by
Adam Rogowiec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix retrieving bias input.
parent
103d5fbc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
16 deletions
+2
-16
gru_cell.cpp
src/ngraph/op/fused/gru_cell.cpp
+1
-10
gru_cell.hpp
src/ngraph/op/fused/gru_cell.hpp
+0
-2
rnn_cell.cpp
src/ngraph/op/fused/rnn_cell.cpp
+1
-4
No files found.
src/ngraph/op/fused/gru_cell.cpp
View file @
0f8c8bf7
...
@@ -191,7 +191,7 @@ NodeVector op::GRUCell::decompose_op() const
...
@@ -191,7 +191,7 @@ NodeVector op::GRUCell::decompose_op() const
std
::
shared_ptr
<
Node
>
W
=
get_argument
(
1
);
std
::
shared_ptr
<
Node
>
W
=
get_argument
(
1
);
std
::
shared_ptr
<
Node
>
R
=
get_argument
(
2
);
std
::
shared_ptr
<
Node
>
R
=
get_argument
(
2
);
std
::
shared_ptr
<
Node
>
H_t
=
get_argument
(
3
);
std
::
shared_ptr
<
Node
>
H_t
=
get_argument
(
3
);
std
::
shared_ptr
<
Node
>
B
=
get_
bias
(
);
std
::
shared_ptr
<
Node
>
B
=
get_
argument
(
4
);
// Get W and R biases separately.
// Get W and R biases separately.
NodeVector
b_W_R
=
builder
::
split
(
B
,
2
);
NodeVector
b_W_R
=
builder
::
split
(
B
,
2
);
...
@@ -270,15 +270,6 @@ NodeVector op::GRUCell::decompose_op() const
...
@@ -270,15 +270,6 @@ NodeVector op::GRUCell::decompose_op() const
return
{
H_t
};
return
{
H_t
};
}
}
shared_ptr
<
Node
>
op
::
GRUCell
::
get_bias
()
const
{
shared_ptr
<
Node
>
bias
;
// Split B onto Wb an Rb and add them.
NodeVector
b_W_R
=
builder
::
split
(
get_argument
(
4
),
2
);
bias
=
b_W_R
.
at
(
0
)
+
b_W_R
.
at
(
1
);
return
bias
;
}
void
op
::
GRUCell
::
add_default_bias_input
()
void
op
::
GRUCell
::
add_default_bias_input
()
{
{
shared_ptr
<
Node
>
B
=
shared_ptr
<
Node
>
B
=
...
...
src/ngraph/op/fused/gru_cell.hpp
View file @
0f8c8bf7
...
@@ -132,8 +132,6 @@ namespace ngraph
...
@@ -132,8 +132,6 @@ namespace ngraph
bool
get_linear_before_reset
()
const
{
return
m_linear_before_reset
;
}
bool
get_linear_before_reset
()
const
{
return
m_linear_before_reset
;
}
private
:
private
:
std
::
shared_ptr
<
Node
>
get_bias
()
const
;
/// brief Add and initialize bias input to all zeros.
/// brief Add and initialize bias input to all zeros.
void
add_default_bias_input
();
void
add_default_bias_input
();
...
...
src/ngraph/op/fused/rnn_cell.cpp
View file @
0f8c8bf7
...
@@ -171,10 +171,7 @@ NodeVector op::RNNCell::decompose_op() const
...
@@ -171,10 +171,7 @@ NodeVector op::RNNCell::decompose_op() const
std
::
shared_ptr
<
Node
>
W
=
get_argument
(
1
);
std
::
shared_ptr
<
Node
>
W
=
get_argument
(
1
);
std
::
shared_ptr
<
Node
>
R
=
get_argument
(
2
);
std
::
shared_ptr
<
Node
>
R
=
get_argument
(
2
);
std
::
shared_ptr
<
Node
>
H_t
=
get_argument
(
3
);
std
::
shared_ptr
<
Node
>
H_t
=
get_argument
(
3
);
std
::
shared_ptr
<
Node
>
B
=
get_bias
();
std
::
shared_ptr
<
Node
>
bias
=
get_bias
();
NodeVector
b_W_R
=
builder
::
split
(
B
,
2
);
auto
bias
=
b_W_R
.
at
(
0
)
+
b_W_R
.
at
(
1
);
// Xt*(W^T)
// Xt*(W^T)
auto
Xt_W
=
std
::
make_shared
<
op
::
Dot
>
(
X
,
builder
::
transpose
(
W
));
auto
Xt_W
=
std
::
make_shared
<
op
::
Dot
>
(
X
,
builder
::
transpose
(
W
));
...
...
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