Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
4b99af0a
Commit
4b99af0a
authored
Jan 16, 2017
by
Patrick Wieschollek
Committed by
Yuxin Wu
Jan 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change rnn-cell to fix #103 (#104)
* Change rnn-cell to fix #103
parent
c3dc184d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
examples/CTC-TIMIT/train-timit.py
examples/CTC-TIMIT/train-timit.py
+2
-2
examples/Char-RNN/char-rnn.py
examples/Char-RNN/char-rnn.py
+3
-3
No files found.
examples/CTC-TIMIT/train-timit.py
View file @
4b99af0a
...
...
@@ -40,8 +40,8 @@ class Model(ModelDesc):
feat
,
labelidx
,
labelvalue
,
labelshape
,
seqlen
=
input_vars
label
=
tf
.
SparseTensor
(
labelidx
,
labelvalue
,
labelshape
)
cell
=
tf
.
nn
.
rnn_cell
.
BasicLSTMCell
(
num_units
=
HIDDEN
)
cell
=
tf
.
nn
.
rnn_cell
.
MultiRNNCell
([
cell
]
*
NLAYER
)
cell
=
tf
.
contrib
.
rnn
.
BasicLSTMCell
(
num_units
=
HIDDEN
)
cell
=
tf
.
contrib
.
rnn
.
MultiRNNCell
([
cell
]
*
NLAYER
)
initial
=
cell
.
zero_state
(
tf
.
shape
(
feat
)[
0
],
tf
.
float32
)
...
...
examples/Char-RNN/char-rnn.py
View file @
4b99af0a
...
...
@@ -69,8 +69,8 @@ class Model(ModelDesc):
def
_build_graph
(
self
,
input_vars
):
input
,
nextinput
=
input_vars
cell
=
tf
.
nn
.
rnn_cell
.
BasicLSTMCell
(
num_units
=
param
.
rnn_size
)
cell
=
tf
.
nn
.
rnn_cell
.
MultiRNNCell
([
cell
]
*
param
.
num_rnn_layer
)
cell
=
tf
.
contrib
.
rnn
.
BasicLSTMCell
(
num_units
=
param
.
rnn_size
)
cell
=
tf
.
contrib
.
rnn
.
MultiRNNCell
([
cell
]
*
param
.
num_rnn_layer
)
self
.
initial
=
initial
=
cell
.
zero_state
(
tf
.
shape
(
input
)[
0
],
tf
.
float32
)
...
...
@@ -80,7 +80,7 @@ class Model(ModelDesc):
input_list
=
tf
.
unstack
(
input_feature
,
axis
=
1
)
# seqlen x (Bxrnnsize)
# seqlen is 1 in inference. don't need loop_function
outputs
,
last_state
=
tf
.
nn
.
rnn
(
cell
,
input_list
,
initial
,
scope
=
'rnnlm'
)
outputs
,
last_state
=
tf
.
contrib
.
rnn
.
static_
rnn
(
cell
,
input_list
,
initial
,
scope
=
'rnnlm'
)
self
.
last_state
=
tf
.
identity
(
last_state
,
'last_state'
)
# seqlen x (Bxrnnsize)
...
...
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