Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
skmad-suite
tff2020
Commits
f3d8416b
Commit
f3d8416b
authored
Dec 04, 2020
by
valentin.emiya
Browse files
fix test keep eigen vec
parent
42e53ce7
Pipeline
#6091
passed with stage
in 5 minutes and 12 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
python/tffpy/experiments/exp_variance.py
View file @
f3d8416b
...
...
@@ -65,7 +65,8 @@ class VarianceExperiment(SolveTffExperiment):
def
__init__
(
self
,
force_reset
=
False
,
suffix
=
''
):
SolveTffExperiment
.
__init__
(
self
,
force_reset
=
force_reset
,
suffix
=
'Variance'
+
suffix
)
suffix
=
'Variance'
+
suffix
,
keep_eigenvectors
=
[])
def
display_results
(
self
):
res
=
self
.
load_results
(
array_type
=
'xarray'
)
...
...
python/tffpy/experiments/tests/test_exp_solve_tff.py
View file @
f3d8416b
...
...
@@ -71,7 +71,7 @@ class TestSolveTffExperiment(unittest.TestCase):
light_exp
=
SolveTffExperiment
.
get_experiment
(
setting
=
'light'
,
force_reset
=
False
)
for
idt
in
range
(
light_exp
.
n_tasks
)
:
for
idt
in
light_exp
.
keep_eigenvectors
:
light_exp
.
plot_task
(
idt
=
idt
,
fontsize
=
16
)
plt
.
close
(
'all'
)
light_exp
.
plot_results
()
...
...
python/tffpy/experiments/tests/test_exp_variance.py
View file @
f3d8416b
...
...
@@ -71,7 +71,7 @@ class TestVarianceExperiment(unittest.TestCase):
light_exp
=
VarianceExperiment
.
get_experiment
(
setting
=
'light'
,
force_reset
=
False
)
for
idt
in
range
(
light_exp
.
n_tasks
)
:
for
idt
in
light_exp
.
keep_eigenvectors
:
light_exp
.
plot_task
(
idt
=
idt
,
fontsize
=
16
)
plt
.
close
(
'all'
)
light_exp
.
plot_results
()
...
...
python/tffpy/experiments/yafe_slurm.py
View file @
f3d8416b
...
...
@@ -61,7 +61,7 @@ import sys
def
generate_slurm_script
(
script_file_path
,
xp_var_name
,
task_ids
=
None
,
n_simultaneous_jobs
=
10
,
slurm_walltime
=
'02:00:00'
,
activate_env_command
=
None
,
use_
gpu
=
False
):
activate_env_command
=
None
,
use_
cpu_gpu
=
'cpu'
):
"""Generate a script to launch an experiment using Slurm.
Tasks are divided into batches that are executed by oar jobs.
...
...
@@ -95,9 +95,8 @@ def generate_slurm_script(script_file_path, xp_var_name, task_ids=None,
``source activate some_conda_env`` when using conda.
If ``activate_env_command`` is ``None``, no virtual environment is
activated.
use_gpu : bool
Flag specifying if a gpu ressource is needed when running the
experiment. This has not been implemented yet.
use_cpu_gpu : {'all', 'cpu', 'gpu'}
Parameter to choose using CPU, GPU or both.
"""
script_file_path
=
Path
(
script_file_path
)
script_dir
=
script_file_path
.
parent
...
...
@@ -127,10 +126,8 @@ def generate_slurm_script(script_file_path, xp_var_name, task_ids=None,
script
+=
'#SBATCH --output={}/stdout_%A_%a.slurm
\n
'
.
format
(
log_dir
)
script
+=
'#SBATCH --error={}/stderr_%A_%a.slurm
\n
'
.
format
(
log_dir
)
script
+=
'#SBATCH --time={}
\n
'
.
format
(
slurm_walltime
)
# if use_gpu:
# script += '#SBATCH -p gpu IS NOT NULL\n'
# else:
# script += '#SBATCH -p gpu IS NULL\n'
if
use_cpu_gpu
in
(
'cpu'
,
'gpu'
):
script
+=
'#SBATCH --partition={}
\n
'
.
format
(
use_cpu_gpu
)
script
+=
'srun -N1 -n1 {}/run_$SLURM_ARRAY_TASK_ID.sh'
.
format
(
script_dir
)
...
...
Write
Preview
Supports
Markdown
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