Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.tensorflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.learn.tensorflow
Commits
d8c784e5
There was a problem fetching the pipeline summary.
Commit
d8c784e5
authored
7 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Add repeat option for training pipelines
parent
c1ceedf7
No related branches found
No related tags found
1 merge request
!28
Take estimators from config in generic scripts
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/learn/tensorflow/dataset/bio.py
+14
-9
14 additions, 9 deletions
bob/learn/tensorflow/dataset/bio.py
with
14 additions
and
9 deletions
bob/learn/tensorflow/dataset/bio.py
+
14
−
9
View file @
d8c784e5
...
...
@@ -4,7 +4,7 @@ from bob.bio.base import read_original_data
def
bio_generator
(
database
,
biofiles
,
load_data
=
None
,
biofile_to_label
=
None
,
multiple_samples
=
False
):
multiple_samples
=
False
,
repeat
=
False
):
"""
Returns a generator and its output types and shapes based on
bob.bio.base databases.
...
...
@@ -25,6 +25,8 @@ def bio_generator(database, biofiles, load_data=None, biofile_to_label=None,
If true, it assumes that the bio database
'
s samples actually contain
multiple samples. This is useful for when you want to treat video
databases as image databases.
repeat : bool, optional
If True, the samples are repeated forever.
Returns
-------
...
...
@@ -50,14 +52,17 @@ def bio_generator(database, biofiles, load_data=None, biofile_to_label=None,
keys
=
(
str
(
f
.
make_path
(
""
,
""
))
for
f
in
biofiles
)
def
generator
():
for
f
,
label
,
key
in
six
.
moves
.
zip
(
biofiles
,
labels
,
keys
):
data
=
load_data
(
database
,
f
)
# labels
if
multiple_samples
:
for
d
in
data
:
yield
(
d
,
label
,
key
)
else
:
yield
(
data
,
label
,
key
)
while
True
:
for
f
,
label
,
key
in
six
.
moves
.
zip
(
biofiles
,
labels
,
keys
):
data
=
load_data
(
database
,
f
)
# labels
if
multiple_samples
:
for
d
in
data
:
yield
(
d
,
label
,
key
)
else
:
yield
(
data
,
label
,
key
)
if
not
repeat
:
break
# load one data to get its type and shape
data
=
load_data
(
database
,
biofiles
[
0
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment