Skip to content
Snippets Groups Projects
Commit 5e21aa04 authored by Baptiste Bauvin's avatar Baptiste Bauvin
Browse files

Modified file structure for noisy data and added loop to run over multiple noisiness

'
parent e7ff7f86
No related branches found
No related tags found
No related merge requests found
......@@ -573,7 +573,7 @@ def execBenchmark(nbCores, statsIter, nbMulticlass,
multiclassGroundTruth, metrics, classificationIndices,
directories, directory, labelsDictionary, nbExamples, nbLabels)
logging.debug("Done:\t Analyzing predictions")
DATASET.close()
return results
......@@ -594,11 +594,15 @@ def execClassif(arguments):
multiviewAlgos = args.CL_algos_multiview
dataset_list = execution.find_dataset_names(args.pathF, args.type, args.name)
if not args.add_noise:
args.noise_std=[0.0]
for name in dataset_list:
for noise_std in args.noise_std:
directory = execution.initLogFile(name, args.views, args.CL_type,
args.log, args.debug, args.label,
args.res_dir, args.add_noise, args.noise_std)
args.res_dir, args.add_noise, noise_std)
randomState = execution.initRandomState(args.randomState, directory)
statsIterRandomStates = execution.initStatsIterRandomStates(statsIter,
randomState)
......@@ -612,7 +616,7 @@ def execClassif(arguments):
randomState,
args.full,
args.add_noise,
args.noise_std)
noise_std)
args.name = datasetname
splits = execution.genSplits(DATASET.get("Labels").value, args.CL_split,
......
......@@ -64,10 +64,10 @@ def parseTheArgs(arguments):
help='Use option to bebug implemented algorithms')
groupStandard.add_argument('-add_noise', action='store_true',
help='Use option to add noise to the data')
groupStandard.add_argument('--noise_std', metavar='FLOAT', action='store',
groupStandard.add_argument('--noise_std', metavar='FLOAT', nargs="+", action='store',
help='The std of the gaussian noise that will '
'be added to the data.',
type=float, default=0.15)
type=float, default=[0.0])
groupStandard.add_argument('--res_dir', metavar='STRING', action='store',
help='The path to the result directory',
default="../Results/")
......@@ -800,10 +800,7 @@ def initLogFile(name, views, CL_type, log, debug, label, result_directory, add_n
resultsDirectory : string
Reference to the main results directory for the benchmark.
"""
if add_noise:
noise_string = "_n_"+str(int(noise_std*100))
else:
noise_string = ""
noise_string = "/n_"+str(int(noise_std*100))
if debug:
resultDirectory = result_directory + name + noise_string +"/debug_started_" + time.strftime(
"%Y_%m_%d-%H_%M_%S") + "_" + label + "/"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment