Commit 40b39d27 by Jiri Borovec

update

parent 9b20fce0
......@@ -454,12 +454,12 @@ def dataset_load_images(path_dir, im_pattern='*', im_posix=IMAGE_POSIX,
path_search = os.path.join(path_dir, im_pattern + im_posix)
logger.debug('image search "%s"', path_search)
paths_img = glob.glob(path_search)
logger.debug('number spls %i in dataset "%s"', len(paths_img),
logger.debug('number samples %i in dataset "%s"', len(paths_img),
os.path.basename(path_dir))
paths_img = sorted(paths_img)[:nb_spls]
if nb_jobs > 1:
logger.info('running in %i threads...', nb_jobs)
logger.debug('running in %i threads...', nb_jobs)
nb_load_blocks = len(paths_img) / BLOCK_NB_LOAD_IMAGES
logger.debug('estimated %i loading blocks', nb_load_blocks)
block_paths_img = (paths_img[i::nb_load_blocks] for i in range(nb_load_blocks))
......@@ -472,7 +472,7 @@ def dataset_load_images(path_dir, im_pattern='*', im_posix=IMAGE_POSIX,
names_imgs = sorted(itertools.chain(*list_names_imgs))
im_names, imgs = zip(*names_imgs)
else:
logger.info('running in single thread...')
logger.debug('running in single thread...')
names_imgs = [load_image(p) for p in paths_img]
logger.debug('split the resulting tuples')
im_names, imgs = zip(*names_imgs)
......
......@@ -114,6 +114,9 @@ def create_args_parser(dict_params):
parser.add_argument('-out', '--path_out', type=str, required=False,
help='path to the output with experiment results',
default=dict_params['path_out'])
parser.add_argument('-tp', '--type', type=str, required=False,
help='switch between real and synth. images',
default='synth', choices=['real', 'synth'])
parser.add_argument('-n', '--name', type=str, required=False,
help='specific name', default=None)
parser.add_argument('--dataset', type=str, required=False, # nargs='+',
......@@ -122,7 +125,7 @@ def create_args_parser(dict_params):
parser.add_argument('--nb_jobs', type=int, required=False, default=NB_THREADS,
help='number of processes running in parallel')
parser.add_argument('--methods', type=str, required=False, nargs='+', default=None,
help='possible APD methods', choices=['PCA', 'ICA', 'DL'])
help='possible APD methods', choices=['PCA', 'ICA', 'DL', 'APDL'])
return parser
......
......@@ -2,44 +2,44 @@
# STATE-OF-THE-ART methods
python run_experiment_apd_sta.py \
-in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v0 \
-out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-sta
python run_experiment_apd_sta.py \
-in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v1 \
-out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-sta
python run_experiment_apd_sta.py \
-in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v2 \
-out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-sta
# python run_experiment_apd_all.py \
# -in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v0 \
# -out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-sta
#
# python run_experiment_apd_all.py \
# -in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v1 \
# -out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-sta
#
# python run_experiment_apd_all.py \
# -in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v2 \
# -out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-sta
#
# python run_experiment_apd_all.py \
# -in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v3 \
# -out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-sta
#
# python run_experiment_apd_all.py \
# -in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary3D_v0 \
# -out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-3D-sta
#
# python run_experiment_apd_all.py \
# -in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary3D_v1 \
# -out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-3D-sta
python run_experiment_apd_sta.py \
-in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v3 \
-out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-sta
# OUR method
python run_experiment_apd_sta.py \
-in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary3D_v0 \
-out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-3D-sta
python run_experiment_apd_apdl.py \
-in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v0 \
-out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APDL_synth
python run_experiment_apd_sta.py \
-in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary3D_v1 \
-out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APD-3D-sta
python run_experiment_apd_apdl.py \
-in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v1 \
-out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APDL_synth
# OUR method
python run_experiment_apd_apdl.py \
-in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v2 \
-out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APDL_synth
#python run_experiment_apd_apdl.py \
# -in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v0 \
# -out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APDL_synth
#
#python run_experiment_apd_apdl.py \
# -in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v1 \
# -out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APDL_synth
#
#python run_experiment_apd_apdl.py \
# -in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v2 \
# -out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APDL_synth
#
#python run_experiment_apd_apdl.py \
# -in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v3 \
# -out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APDL_synth
\ No newline at end of file
python run_experiment_apd_apdl.py \
-in /datagrid/Medical/microscopy/drosophila/synthetic_data/atomicPatternDictionary_v3 \
-out /datagrid/Medical/microscopy/drosophila/TEMPORARY/experiments_APDL_synth
\ No newline at end of file
......@@ -29,6 +29,7 @@ sys.path.append(os.path.abspath(os.path.join('..','..'))) # Add path to root
import experiment_apd as expt_apd
import pattern_disctionary as ptn_dict
import pattern_weights as ptn_weight
import run_experiment_apd_apdl as expt_apdl
SYNTH_PARAMS = expt_apd.SYNTH_PARAMS
......@@ -178,9 +179,12 @@ class ExperimentDictLearn(ExperimentLinearCombine):
self.components = self.estimator.components_
METHODS = {'PCA': ExperimentFastICA,
'ICA': ExperimentSparsePCA,
'DL': ExperimentDictLearn}
METHODS = {
'PCA': ExperimentFastICA,
'ICA': ExperimentSparsePCA,
'DL': ExperimentDictLearn,
'APDL': expt_apdl.ExperimentALPE_mp,
}
def experiments_test(params=SYNTH_PARAMS):
......@@ -237,7 +241,11 @@ def main():
# experiments_test()
experiments_synthetic()
arg_params = expt_apd.parse_params(SYNTH_PARAMS)
if arg_params['type'] == 'synth':
experiments_synthetic()
else:
logging.error('not implemented yet')
logging.info('DONE')
# plt.show()
......
......@@ -285,9 +285,12 @@ def main():
# experiments_test()
# plt.show()
experiments_synthetic()
# experiments_real()
arg_params = expt_apd.parse_params(SYNTH_PARAMS)
if arg_params['type'] == 'synth':
experiments_synthetic()
elif arg_params['type'] == 'real':
experiments_real()
logging.info('DONE')
......
......@@ -6,7 +6,7 @@ Copyright (C) 2015-2016 Jiri Borovec <jiri.borovec@fel.cvut.cz>
import logging
import run_experiment_apd_sta
import run_experiment_apd_all
import run_experiment_apd_apdl
......@@ -15,7 +15,7 @@ def main():
logging.basicConfig(level=logging.INFO)
logging.info('running...')
run_experiment_apd_sta.experiments_test()
run_experiment_apd_all.experiments_test()
run_experiment_apd_apdl.experiments_test()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment