Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.base
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
bob
bob.bio.base
Commits
7fc43e9e
Commit
7fc43e9e
authored
4 years ago
by
Tiago de Freitas Pereira
Browse files
Options
Downloads
Patches
Plain Diff
Possible split between bioalgorithm_dir and transform dir
parent
c456f875
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!180
[dask] Preparing bob.bio.base for dask pipelines
Pipeline
#40600
failed
4 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/base/pipelines/vanilla_biometrics/wrappers.py
+20
-6
20 additions, 6 deletions
bob/bio/base/pipelines/vanilla_biometrics/wrappers.py
with
20 additions
and
6 deletions
bob/bio/base/pipelines/vanilla_biometrics/wrappers.py
+
20
−
6
View file @
7fc43e9e
...
...
@@ -240,7 +240,9 @@ def dask_vanilla_biometrics(pipeline, npartitions=None, partition_size=None):
pipeline
.
vanilla_biometrics_pipeline
=
dask_vanilla_biometrics
(
pipeline
.
vanilla_biometrics_pipeline
,
npartitions
)
pipeline
.
biometric_algorithm
=
pipeline
.
vanilla_biometrics_pipeline
.
biometric_algorithm
pipeline
.
biometric_algorithm
=
(
pipeline
.
vanilla_biometrics_pipeline
.
biometric_algorithm
)
pipeline
.
transformer
=
pipeline
.
vanilla_biometrics_pipeline
.
transformer
pipeline
.
ztnorm_solver
=
ZTNormDaskWrapper
(
pipeline
.
ztnorm_solver
)
...
...
@@ -267,6 +269,7 @@ def dask_vanilla_biometrics(pipeline, npartitions=None, partition_size=None):
return
pipeline
def
dask_get_partition_size
(
cluster
,
n_objects
):
"""
Heuristics that gives you a number for dask.partition_size.
...
...
@@ -287,10 +290,10 @@ def dask_get_partition_size(cluster, n_objects):
return
None
max_jobs
=
cluster
.
sge_job_spec
[
"
default
"
][
"
max_jobs
"
]
return
n_objects
//
max_jobs
if
n_objects
>
max_jobs
else
1
return
n_objects
//
max_jobs
if
n_objects
>
max_jobs
else
1
def
checkpoint_vanilla_biometrics
(
pipeline
,
base_dir
):
def
checkpoint_vanilla_biometrics
(
pipeline
,
base_dir
,
biometric_algorithm_dir
=
None
):
"""
Given a :any:`VanillaBiometrics`, wraps :any:`VanillaBiometrics.transformer` and
:any:`VanillaBiometrics.biometric_algorithm` to be checkpointed
...
...
@@ -302,7 +305,14 @@ def checkpoint_vanilla_biometrics(pipeline, base_dir):
Vanilla Biometrics based pipeline to be checkpointed
base_dir: str
Path to store biometric references and scores
Path to store transformed input data and possibly biometric references and scores
biometric_algorithm_dir: str
If set, it will checkpoint the biometric references and scores to this path.
If not, `base_dir` will be used.
This is useful when it
'
s suitable to have the transformed data path, and biometric references and scores
in different paths.
"""
...
...
@@ -340,11 +350,15 @@ def checkpoint_vanilla_biometrics(pipeline, base_dir):
sk_pipeline
.
steps
[
i
]
=
(
name
,
wraped_estimator
)
bio_ref_scores_dir
=
(
base_dir
if
biometric_algorithm_dir
is
None
else
biometric_algorithm_dir
)
if
isinstance
(
pipeline
.
biometric_algorithm
,
BioAlgorithmLegacy
):
pipeline
.
biometric_algorithm
.
base_dir
=
b
ase
_dir
pipeline
.
biometric_algorithm
.
base_dir
=
b
io_ref_scores
_dir
else
:
pipeline
.
biometric_algorithm
=
BioAlgorithmCheckpointWrapper
(
pipeline
.
biometric_algorithm
,
base_dir
=
b
ase
_dir
pipeline
.
biometric_algorithm
,
base_dir
=
b
io_ref_scores
_dir
)
return
pipeline
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