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
744defbe
Commit
744defbe
authored
Aug 02, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix in dataflow
parent
4f1568dc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
2 deletions
+9
-2
examples/char-rnn/char-rnn.py
examples/char-rnn/char-rnn.py
+2
-1
tensorpack/dataflow/base.py
tensorpack/dataflow/base.py
+1
-1
tensorpack/dataflow/common.py
tensorpack/dataflow/common.py
+5
-0
tensorpack/tfutils/varmanip.py
tensorpack/tfutils/varmanip.py
+1
-0
No files found.
examples/char-rnn/char-rnn.py
View file @
744defbe
...
@@ -91,8 +91,9 @@ class Model(ModelDesc):
...
@@ -91,8 +91,9 @@ class Model(ModelDesc):
# seqlen is 1 in inference. don't need loop_function
# seqlen is 1 in inference. don't need loop_function
outputs
,
last_state
=
rnn
.
rnn
(
cell
,
input_list
,
initial
,
scope
=
'rnnlm'
)
outputs
,
last_state
=
rnn
.
rnn
(
cell
,
input_list
,
initial
,
scope
=
'rnnlm'
)
self
.
last_state
=
tf
.
identity
(
last_state
,
'last_state'
)
self
.
last_state
=
tf
.
identity
(
last_state
,
'last_state'
)
# seqlen x (Bxrnnsize)
# seqlen x (Bxrnnsize)
output
=
tf
.
reshape
(
tf
.
concat
(
1
,
outputs
),
[
-
1
,
param
.
rnn_size
])
# (
seqlenxB
) x rnnsize
output
=
tf
.
reshape
(
tf
.
concat
(
1
,
outputs
),
[
-
1
,
param
.
rnn_size
])
# (
Bxseqlen
) x rnnsize
logits
=
FullyConnected
(
'fc'
,
output
,
param
.
vocab_size
,
nl
=
tf
.
identity
)
logits
=
FullyConnected
(
'fc'
,
output
,
param
.
vocab_size
,
nl
=
tf
.
identity
)
self
.
prob
=
tf
.
nn
.
softmax
(
logits
/
param
.
softmax_temprature
)
self
.
prob
=
tf
.
nn
.
softmax
(
logits
/
param
.
softmax_temprature
)
...
...
tensorpack/dataflow/base.py
View file @
744defbe
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
from
abc
import
abstractmethod
,
ABCMeta
from
abc
import
abstractmethod
,
ABCMeta
from
..utils
import
get_rng
from
..utils
import
get_rng
__all__
=
[
'DataFlow'
,
'ProxyDataFlow'
]
__all__
=
[
'DataFlow'
,
'ProxyDataFlow'
,
'RNGDataFlow'
]
class
DataFlow
(
object
):
class
DataFlow
(
object
):
""" Base class for all DataFlow """
""" Base class for all DataFlow """
...
...
tensorpack/dataflow/common.py
View file @
744defbe
...
@@ -28,6 +28,11 @@ class TestDataSpeed(ProxyDataFlow):
...
@@ -28,6 +28,11 @@ class TestDataSpeed(ProxyDataFlow):
for
dp
in
self
.
ds
.
get_data
():
for
dp
in
self
.
ds
.
get_data
():
yield
dp
yield
dp
def
start_test
(
self
):
self
.
ds
.
reset_state
()
for
k
in
self
.
get_data
():
pass
class
BatchData
(
ProxyDataFlow
):
class
BatchData
(
ProxyDataFlow
):
def
__init__
(
self
,
ds
,
batch_size
,
remainder
=
False
):
def
__init__
(
self
,
ds
,
batch_size
,
remainder
=
False
):
"""
"""
...
...
tensorpack/tfutils/varmanip.py
View file @
744defbe
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
import
six
import
six
import
tensorflow
as
tf
import
tensorflow
as
tf
import
numpy
as
np
import
numpy
as
np
from
..utils
import
logger
__all__
=
[
'SessionUpdate'
,
'dump_session_params'
,
'dump_chkpt_vars'
]
__all__
=
[
'SessionUpdate'
,
'dump_session_params'
,
'dump_chkpt_vars'
]
...
...
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