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
8c9c61d3
You need to sign in or sign up before continuing.
Commit
8c9c61d3
authored
Mar 16, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
joindata
parent
fe548cf0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
tensorpack/dataflow/common.py
tensorpack/dataflow/common.py
+23
-1
tensorpack/dataflow/format.py
tensorpack/dataflow/format.py
+8
-3
No files found.
tensorpack/dataflow/common.py
View file @
8c9c61d3
...
@@ -9,7 +9,7 @@ from .base import DataFlow, ProxyDataFlow
...
@@ -9,7 +9,7 @@ from .base import DataFlow, ProxyDataFlow
from
..utils
import
*
from
..utils
import
*
__all__
=
[
'BatchData'
,
'FixedSizeData'
,
'FakeData'
,
'MapData'
,
__all__
=
[
'BatchData'
,
'FixedSizeData'
,
'FakeData'
,
'MapData'
,
'MapDataComponent'
,
'RandomChooseData'
,
'RandomMixData'
]
'MapDataComponent'
,
'RandomChooseData'
,
'RandomMixData'
,
'JoinData'
]
class
BatchData
(
ProxyDataFlow
):
class
BatchData
(
ProxyDataFlow
):
def
__init__
(
self
,
ds
,
batch_size
,
remainder
=
False
):
def
__init__
(
self
,
ds
,
batch_size
,
remainder
=
False
):
...
@@ -218,3 +218,25 @@ class RandomMixData(DataFlow):
...
@@ -218,3 +218,25 @@ class RandomMixData(DataFlow):
for
k
in
idxs
:
for
k
in
idxs
:
yield
next
(
itrs
[
k
])
yield
next
(
itrs
[
k
])
class
JoinData
(
DataFlow
):
"""
Concatenate several dataflows
"""
def
__init__
(
self
,
df_lists
):
"""
df_lists: list of dataflow
"""
self
.
df_lists
=
df_lists
def
reset_state
(
self
):
for
d
in
self
.
df_lists
:
d
.
reset_state
()
def
size
(
self
):
return
sum
([
x
.
size
()
for
x
in
self
.
df_lists
])
def
get_data
(
self
):
for
d
in
self
.
df_lists
:
for
dp
in
d
.
get_data
():
yield
dp
tensorpack/dataflow/format.py
View file @
8c9c61d3
...
@@ -2,12 +2,17 @@
...
@@ -2,12 +2,17 @@
# File: format.py
# File: format.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import
h5py
from
..utils
import
logger
from
.base
import
DataFlow
import
random
import
random
from
six.moves
import
range
from
six.moves
import
range
from
..utils
import
logger
try
:
from
.base
import
DataFlow
import
h5py
except
ImportError
:
logger
.
error
(
"Error in `import h5py`. HDF5Data cannot function."
)
"""
"""
Adapter for different data format.
Adapter for different data format.
...
...
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