Skip to content
Snippets Groups Projects
Commit 890bc288 authored by bbauvin's avatar bbauvin
Browse files

Added main execution file

parent 994a0a62
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ from joblib import Parallel, delayed
import numpy as np
import math
import matplotlib
import h5py
# Import own modules
import Multiview
......@@ -100,7 +101,7 @@ def initMonoviewKWARGS(args, classifiersNames):
return monoviewKWARGS
def initKWARGS(args, benchmark):
def initKWARGSFunc(args, benchmark):
if "Monoview" in benchmark:
monoviewKWARGS = initMonoviewKWARGS(args, benchmark["Monoview"])
else:
......@@ -108,20 +109,20 @@ def initKWARGS(args, benchmark):
return monoviewKWARGS
def lateFusionSetArgs(views, viewsIndices, classes, method,
classifiersNames, classifiersConfig, fusionMethodConfig):
arguments = {"CL_type": "Fusion",
"views": views,
"NB_VIEW": len(views),
"viewsIndices": viewsIndices,
"NB_CLASS": len(classes),
"LABELS_NAMES": args.CL_classes,
"FusionKWARGS": {"fusionType": "LateFusion", "fusionMethod": method,
"classifiersNames": classifiersNames,
"classifiersConfigs": classifiersConfig,
'fusionMethodConfig': fusionMethodConfig,
"nbView": (len(viewsIndices))}}
return arguments
# def lateFusionSetArgs(views, viewsIndices, classes, method,
# classifiersNames, classifiersConfig, fusionMethodConfig):
# arguments = {"CL_type": "Fusion",
# "views": views,
# "NB_VIEW": len(views),
# "viewsIndices": viewsIndices,
# "NB_CLASS": len(classes),
# "LABELS_NAMES": args.CL_classes,
# "FusionKWARGS": {"fusionType": "LateFusion", "fusionMethod": method,
# "classifiersNames": classifiersNames,
# "classifiersConfigs": classifiersConfig,
# 'fusionMethodConfig': fusionMethodConfig,
# "nbView": (len(viewsIndices))}}
# return arguments
def initMultiviewArguments(args, benchmark, views, viewsIndices, argumentDictionaries, randomState, directory,
......@@ -178,6 +179,7 @@ def classifyOneIter_multicore(LABELS_DICTIONARY, argumentDictionaries, nbCores,
labels = np.array(
[resultMonoview[1][3] for resultMonoview in resultsMonoview] + [resultMultiview[3] for resultMultiview in
resultsMultiview]).transpose()
DATASET = h5py.File(args.pathF + args.name + str(0) + ".hdf5", "r")
trueLabels = DATASET.get("Labels").value
times = [dataBaseTime, monoviewTime, multiviewTime]
results = (resultsMonoview, resultsMultiview)
......@@ -273,10 +275,10 @@ def classifyOneIter(LABELS_DICTIONARY, argumentDictionaries, nbCores, directory,
# _______________ #
# __ EXECUTION __ #
# _______________ #
def execClassif(arguments):
testVersions()
start = time.time()
args = execution.parseTheArgs(sys.argv[1:])
args = execution.parseTheArgs(arguments)
os.nice(args.nice)
nbCores = args.CL_cores
......@@ -327,7 +329,7 @@ logging.info("Start:\t Finding all available mono- & multiview algorithms")
benchmark = initBenchmark(args)
initKWARGS = initKWARGS(args, benchmark)
initKWARGS = initKWARGSFunc(args, benchmark)
dataBaseTime = time.time() - start
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment