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
f226b559
You need to sign in or sign up before continuing.
Commit
f226b559
authored
Jan 18, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add repeated data
parent
ef8aa2a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
tensorpack/dataflow/common.py
tensorpack/dataflow/common.py
+16
-1
No files found.
tensorpack/dataflow/common.py
View file @
f226b559
...
@@ -59,6 +59,7 @@ class BatchData(DataFlow):
...
@@ -59,6 +59,7 @@ class BatchData(DataFlow):
return
result
return
result
class
FixedSizeData
(
DataFlow
):
class
FixedSizeData
(
DataFlow
):
""" generate data from another dataflow, but with a fixed epoch size"""
def
__init__
(
self
,
ds
,
size
):
def
__init__
(
self
,
ds
,
size
):
self
.
ds
=
ds
self
.
ds
=
ds
self
.
_size
=
size
self
.
_size
=
size
...
@@ -75,8 +76,22 @@ class FixedSizeData(DataFlow):
...
@@ -75,8 +76,22 @@ class FixedSizeData(DataFlow):
if
cnt
==
self
.
_size
:
if
cnt
==
self
.
_size
:
return
return
class
RepeatedData
(
DataFlow
):
""" repeat another dataflow for certain times"""
def
__init__
(
self
,
ds
,
nr
):
self
.
nr
=
nr
self
.
ds
=
ds
def
size
(
self
):
return
self
.
ds
.
size
()
*
self
.
nr
def
get_data
(
self
):
for
_
in
xrange
(
self
.
nr
):
for
dp
in
self
.
ds
.
get_data
():
yield
dp
class
FakeData
(
DataFlow
):
class
FakeData
(
DataFlow
):
""" Build fake data of given shapes"""
""" Build fake
random
data of given shapes"""
def
__init__
(
self
,
shapes
,
size
):
def
__init__
(
self
,
shapes
,
size
):
self
.
shapes
=
shapes
self
.
shapes
=
shapes
self
.
_size
=
size
self
.
_size
=
size
...
...
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