featureName += '-FENS_dsf%i_dswl%i' % ( settingsDict['FENS Downsampling'], settingsDict['FENS Window Length']) # Assign a value to numFeatures if settingsDict['NN Type'] is not None: numFeatures = int(settingsDict['dA Num Hidden Units']) else: numFeatures = int(settingsDict['Number of Features']) NCDlist = calculateNCDs(processPool, featureName, numFeatures, int(settingsDict['Feature DownSample Factor']), int(settingsDict['CRP Time Delay']), int(settingsDict['CRP Dimension']), settingsDict['CRP Method'], settingsDict['CRP Neighbourhood Size'], None, None, int(settingsDict['NCD Sequence Length']), featureFileDict=featureFileDict, pieceIds=pieceIds) # Convert NCD files into a dataframe runTime = str(datetime.now()).replace(':', '-') MAPresult = None if NCDlist is None: # there were errors e.g. in CRP calculation after downsampling MAPresult = 0 # need to use something that is not None for the optimiser to find its best result else: dfNCDs = convertNCDs(NCDlist, dataFrameFileName=None) # Get the overall MAP of the run and add to the setting
# Calculate NCDs for key in setting.keys(): print key, ':', setting[key] featureName = '%s-%s-%iv-%i-FENS_dsf%i_dswl%i' % ( baseFeatureName, NNtype, setting['dA Num Visible Units'], setting['dA Num Hidden Units'], setting['FENS Downsampling'], setting['FENS Window Length']) NCDlist = calculateNCDs(processPool, featureName, numFeatures, setting['DownSample Factor'], setting['Time Delay'], setting['Dimension'], CRPmethod, setting['Neighbourhood Size'], numFolders, numFilesPerFolder, setting['Sequence Length'], featureFileDict=FENSfeatureFileDict, pieceIds=pieceIds) # Convert NCD files into a dataframe runTime = str(datetime.now()).replace(':', '-') MAPresult = None if NCDlist is None: # there were errors e.g. in CRP calculation after downsampling MAPresult = 0 # need to use something that is not None for the optimiser to find its best result else: dfNCDs = convertNCDs(NCDlist, dataFrameFileName=runTime) # Get the overall MAP of the run and add to the setting
learningRateBoostFactor, setting['dA Corruption Level'], setting['dA Num Visible Units'], setting['dA Num Hidden Units'], batchSize, freqStd, numFolders, numFilesPerFolder, timeStacking) else: weightMatrix = biases = featureOffset = featureScaling = None # Calculate NCDs for key in setting.keys(): print key, ':', setting[key] NCDlist = calculateNCDs(processPool, featureName, numFeatures, setting['DownSample Factor'], setting['Time Delay'], setting['Dimension'], CRPmethod, setting['Neighbourhood Size'], numFolders, numFilesPerFolder, setting['Sequence Length'], weightMatrix, biases, featureOffset, featureScaling, timeStacking) # Convert NCD files into a dataframe runTime = str(datetime.now()).replace(':', '-') MAPresult = None if NCDlist is None: # there were errors e.g. in CRP calculation after downsampling MAPresult = 0 # need to use something that is not None for the optimiser to find its best result else: dfNCDs = convertNCDs(NCDlist, dataFrameFileName=runTime) # Get the overall MAP of the run and add to the setting MAPresult = getDataFrameMAPresult(dfNCDs) if MAPresult is not None and MAPresult != 0:
featureScaling = 1 # Calculate NCDs for key in settingsDict.keys(): print key, ':', settingsDict[key] featureName = '%s-%s-%iv-%i' % (settingsDict['Feature Name'], settingsDict['NN Type'], numFeatures, settingsDict['NN # Hidden Units']) NCDlist = calculateNCDs(processPool = processPool, featureName = settingsDict['Feature Name'], numFeatures = numFeatures, downSampleFactor = settingsDict['Feature DownSample Factor'], timeDelay = settingsDict['CRP Time Delay'], dimension = settingsDict['CRP Dimension'], method = settingsDict['CRP Method'], neighbourhoodSize = settingsDict['CRP Neighbourhood Size'], numFolders = numFolders, numFilesPerFolder = numFilesPerFolder, sequenceLength = settingsDict['NCD Sequence Length'], featureFileDict = transformedFeatureFileDict, pieceIds = pieceIds) # Convert NCD files into a dataframe runTime = str(datetime.now()).replace(':', '-') MAPresult = None if NCDlist is None: # there were errors e.g. in CRP calculation after downsampling MAPresult = 0 # need to use something that is not None for the optimiser to find its best result else: dfNCDs = convertNCDs(NCDlist, dataFrameFileName = runTime) # Get the overall MAP of the run and add to the setting