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
75925343
Commit
75925343
authored
Apr 19, 2017
by
Patrick Wieschollek
Committed by
Yuxin Wu
Apr 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
solution from issue 207 (#227)
* solution from issue 207 * remove copy * remove old docs
parent
2fb8f750
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
tensorpack/dataflow/common.py
tensorpack/dataflow/common.py
+26
-1
No files found.
tensorpack/dataflow/common.py
View file @
75925343
...
@@ -12,7 +12,7 @@ from .base import DataFlow, ProxyDataFlow, RNGDataFlow
...
@@ -12,7 +12,7 @@ from .base import DataFlow, ProxyDataFlow, RNGDataFlow
from
..utils
import
logger
,
get_tqdm
,
get_rng
from
..utils
import
logger
,
get_tqdm
,
get_rng
__all__
=
[
'TestDataSpeed'
,
'PrintData'
,
'BatchData'
,
'BatchDataByShape'
,
'FixedSizeData'
,
'MapData'
,
__all__
=
[
'TestDataSpeed'
,
'PrintData'
,
'BatchData'
,
'BatchDataByShape'
,
'FixedSizeData'
,
'MapData'
,
'MapDataComponent'
,
'RepeatedData'
,
'RandomChooseData'
,
'MapDataComponent'
,
'RepeatedData'
,
'R
epeatedDataPoint'
,
'R
andomChooseData'
,
'RandomMixData'
,
'JoinData'
,
'ConcatData'
,
'SelectComponent'
,
'RandomMixData'
,
'JoinData'
,
'ConcatData'
,
'SelectComponent'
,
'LocallyShuffleData'
,
'CacheData'
]
'LocallyShuffleData'
,
'CacheData'
]
...
@@ -295,6 +295,31 @@ class RepeatedData(ProxyDataFlow):
...
@@ -295,6 +295,31 @@ class RepeatedData(ProxyDataFlow):
yield
dp
yield
dp
class
RepeatedDataPoint
(
ProxyDataFlow
):
""" Take data points from another DataFlow and produce them a
certain number of times dp1, ..., dp1, dp2, ..., dp2, ...
"""
def
__init__
(
self
,
ds
,
nr
):
"""
Args:
ds (DataFlow): input DataFlow
nr (int): number of times to repeat each datapoint.
"""
self
.
nr
=
int
(
nr
)
assert
self
.
nr
>=
1
,
self
.
nr
super
(
RepeatedDataPoint
,
self
)
.
__init__
(
ds
)
def
size
(
self
):
return
self
.
ds
.
size
()
*
self
.
nr
def
get_data
(
self
):
for
dp
in
self
.
ds
.
get_data
():
for
_
in
range
(
self
.
nr
):
yield
dp
class
RandomChooseData
(
RNGDataFlow
):
class
RandomChooseData
(
RNGDataFlow
):
"""
"""
Randomly choose from several DataFlow.
Randomly choose from several DataFlow.
...
...
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