Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.gmm
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.bio.gmm
Commits
0e45af28
There was a problem fetching the pipeline summary.
Commit
0e45af28
authored
8 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Added test cases that internal options raise exceptions
parent
b0389f3f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Resolve "Change required after bob.bio.base command-line option change"
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/gmm/test/test_scripts.py
+39
-14
39 additions, 14 deletions
bob/bio/gmm/test/test_scripts.py
with
39 additions
and
14 deletions
bob/bio/gmm/test/test_scripts.py
+
39
−
14
View file @
0e45af28
from
__future__
import
print_function
import
bob.measure
import
os
import
shutil
import
tempfile
import
numpy
import
nose
import
bob.io.image
import
bob.bio.base
...
...
@@ -75,8 +74,6 @@ def test_gmm_sequential():
'
--preferred-package
'
,
'
bob.bio.gmm
'
]
print
(
bob
.
bio
.
base
.
tools
.
command_line
(
parameters
))
_verify
(
parameters
,
test_dir
,
'
test_gmm_sequential
'
,
ref_modifier
=
'
-gmm
'
)
...
...
@@ -100,8 +97,6 @@ def test_gmm_parallel():
'
--preferred-package
'
,
'
bob.bio.gmm
'
]
print
(
bob
.
bio
.
base
.
tools
.
command_line
(
parameters
))
_verify
(
parameters
,
test_dir
,
'
test_gmm_parallel
'
,
executable
=
main
,
ref_modifier
=
'
-gmm
'
)
...
...
@@ -120,8 +115,6 @@ def test_isv_sequential():
'
--preferred-package
'
,
'
bob.bio.gmm
'
]
print
(
bob
.
bio
.
base
.
tools
.
command_line
(
parameters
))
_verify
(
parameters
,
test_dir
,
'
test_isv_sequential
'
,
ref_modifier
=
'
-isv
'
)
...
...
@@ -145,8 +138,6 @@ def test_isv_parallel():
'
--preferred-package
'
,
'
bob.bio.gmm
'
]
print
(
bob
.
bio
.
base
.
tools
.
command_line
(
parameters
))
_verify
(
parameters
,
test_dir
,
'
test_isv_parallel
'
,
executable
=
main
,
ref_modifier
=
'
-isv
'
)
...
...
@@ -164,7 +155,7 @@ def test_ivector_cosine_sequential():
'
--result-directory
'
,
test_dir
,
'
--preferred-package
'
,
'
bob.bio.gmm
'
]
print
(
bob
.
bio
.
base
.
tools
.
command_line
(
parameters
))
_verify
(
parameters
,
test_dir
,
'
test_ivector_cosine_sequential
'
,
ref_modifier
=
'
-ivector-cosine
'
)
...
...
@@ -187,7 +178,7 @@ def test_ivector_cosine_parallel():
'
--result-directory
'
,
test_dir
,
'
--preferred-package
'
,
'
bob.bio.gmm
'
]
print
(
bob
.
bio
.
base
.
tools
.
command_line
(
parameters
))
_verify
(
parameters
,
test_dir
,
'
test_ivector_cosine_parallel
'
,
executable
=
main
,
ref_modifier
=
'
-ivector-cosine
'
)
def
test_ivector_lda_wccn_plda_sequential
():
...
...
@@ -203,7 +194,7 @@ def test_ivector_lda_wccn_plda_sequential():
'
--temp-directory
'
,
test_dir
,
'
--result-directory
'
,
test_dir
]
print
(
bob
.
bio
.
base
.
tools
.
command_line
(
parameters
))
_verify
(
parameters
,
test_dir
,
'
test_ivector_lda_wccn_plda_sequential
'
,
ref_modifier
=
'
-ivector-lda-wccn-plda
'
)
...
...
@@ -226,5 +217,39 @@ def test_ivector_lda_wccn_plda_parallel():
'
--result-directory
'
,
test_dir
,
'
--preferred-package
'
,
'
bob.bio.gmm
'
]
print
(
bob
.
bio
.
base
.
tools
.
command_line
(
parameters
))
_verify
(
parameters
,
test_dir
,
'
test_ivector_lda_wccn_plda_parallel
'
,
executable
=
main
,
ref_modifier
=
'
-ivector-lda-wccn-plda
'
)
def
test_internal_raises
():
test_dir
=
tempfile
.
mkdtemp
(
prefix
=
'
bobtest_
'
)
test_database
=
os
.
path
.
join
(
test_dir
,
"
submitted.sql3
"
)
# define dummy parameters
parameters
=
[
'
-d
'
,
'
dummy
'
,
'
-p
'
,
'
dummy
'
,
'
-e
'
,
'
dummy2d
'
,
'
-g
'
,
'
bob.bio.base.grid.Grid(grid_type =
"
local
"
, number_of_parallel_processes = 2, scheduler_sleep_time = 0.1)
'
,
'
-G
'
,
test_database
,
'
--run-local-scheduler
'
,
'
--stop-on-failure
'
,
'
--import
'
,
'
bob.bio.gmm
'
,
'
bob.io.image
'
,
'
--clean-intermediate
'
,
'
--zt-norm
'
,
'
-vs
'
,
'
test_raises
'
,
'
--temp-directory
'
,
test_dir
,
'
--result-directory
'
,
test_dir
,
'
--preferred-package
'
,
'
bob.bio.gmm
'
]
from
bob.bio.gmm.script.verify_gmm
import
main
as
gmm
from
bob.bio.gmm.script.verify_isv
import
main
as
isv
from
bob.bio.gmm.script.verify_ivector
import
main
as
ivector
for
script
,
algorithm
in
(
(
gmm
,
"
bob.bio.gmm.algorithm.GMM(2, 2, 2)
"
),
(
isv
,
"
bob.bio.gmm.algorithm.ISV(10, number_of_gaussians=2, kmeans_training_iterations=2, gmm_training_iterations=2, isv_training_iterations=2)
"
),
(
ivector
,
"
bob.bio.gmm.algorithm.IVector(10, number_of_gaussians=2, kmeans_training_iterations=2, gmm_training_iterations=2, tv_training_iterations=2, use_lda=True, use_wccn=True, use_plda=True, lda_dim=2, plda_dim_F=2, plda_dim_G=2, plda_training_iterations=2)
"
)):
for
option
,
value
in
((
"
--iteration
"
,
"
0
"
),
(
"
--group
"
,
"
dev
"
),
(
"
--model-type
"
,
"
N
"
),
(
"
--score-type
"
,
"
A
"
)):
internal
=
parameters
+
[
"
--algorithm
"
,
algorithm
,
option
,
value
]
nose
.
tools
.
assert_raises
(
ValueError
,
script
,
internal
)
shutil
.
rmtree
(
test_dir
)
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