Skip to content

Commit

Permalink
as matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Oct 26, 2020
1 parent 120b4f4 commit 742390b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bpdl/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ def dataset_load_weights(path_base, name_csv=CSV_NAME_WEIGHTS, img_names=None):
encoding = np.array([[int(x) for x in c.split(';')] for c in coding])
# the new encoding with pattern names
else:
encoding = df.as_matrix()
encoding = df.values
return np.array(encoding)


Expand Down
2 changes: 1 addition & 1 deletion experiments/experiment_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def load_list_img_names(path_csv, path_in=''):
assert os.path.exists(path_csv), '%s' % path_csv
df = pd.read_csv(path_csv, index_col=False, header=None)
assert len(df.columns) == 1, 'assume just single column'
list_names = df.as_matrix()[:, 0].tolist()
list_names = df.values[:, 0].tolist()
# if the input path was set and the list are just names, no complete paths
if os.path.exists(path_in) and not all(os.path.exists(p) for p in list_names):
# to each image name add the input path
Expand Down
9 changes: 4 additions & 5 deletions experiments/run_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@

sys.path += [os.path.abspath('.'), os.path.abspath('..')] # Add path to root
from bpdl.utilities import is_list_like, is_iterable
from bpdl.data_utils import (DIR_NAME_DICTIONARY, DEFAULT_NAME_DATASET,
dataset_compose_atlas, find_images, dataset_load_images)
from bpdl.data_utils import (
DIR_NAME_DICTIONARY, DEFAULT_NAME_DATASET, dataset_compose_atlas, find_images, dataset_load_images)
from bpdl.dictionary_learning import bpdl_pipeline
from bpdl.pattern_atlas import init_atlas_mosaic
from experiments.experiment_general import (SYNTH_PARAMS, REAL_PARAMS,
SYNTH_PATH_APD, parse_params)
from experiments.experiment_general import (
SYNTH_PARAMS, REAL_PARAMS, SYNTH_PATH_APD, parse_params)
from experiments.experiment_methods import (
ExperimentSparsePCA, ExperimentFastICA, ExperimentDictLearn, ExperimentNMF,
ExperimentSpectClust, ExperimentCanICA, ExperimentMSDL, ExperimentBPDL, DICT_ATLAS_INIT)
Expand All @@ -64,7 +64,6 @@
'max_iter': 25, # 250, 150
})

REAL_PARAMS = REAL_PARAMS
REAL_PARAMS.update({
'method': LIST_METHODS,
'max_iter': 25, # 250, 150
Expand Down

0 comments on commit 742390b

Please sign in to comment.