@do_cprofile
def objective(args):
    minRand, maxRand, posReinfVal, negReinfVal = args
    # train
    randVal = str(minRand)+'-'+str(maxRand)
    trainModel = snnrlWithParams(evaluateClassifier=False, randomization=randVal, posReinf=posReinfVal, negReinf=negReinfVal)
    trainModel.run_model()
    del trainModel
    # test
    testModel = snnrlWithParams(evaluateClassifier=True, posReinf=posReinfVal, negReinf=negReinfVal)
    origAccPerc = testModel.run_model()
    accuracyPerc = (origAccPerc) - 1
    print "\naccPer:\t",accuracyPerc
    del testModel

    return {'loss': accuracyPerc}

#objective([0.6, 0.9, 1.5, 3.0])
dataset/ETHPy150Open tartavull/snn-rl/utilities/profileProg.py/objective/swapped operands of `-`