本文整理汇总了Python中parameters.Parameters.define方法的典型用法代码示例。如果您正苦于以下问题:Python Parameters.define方法的具体用法?Python Parameters.define怎么用?Python Parameters.define使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parameters.Parameters
的用法示例。
在下文中一共展示了Parameters.define方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Parameters
# 需要导入模块: from parameters import Parameters [as 别名]
# 或者: from parameters.Parameters import define [as 别名]
import dataset_readers as data
import image_encoders as encoder
from parameters import Parameters
from nupic.research.spatial_pooler import SpatialPooler
#from nupic.encoders import ScalarEncoder
from vision_testbench import VisionTestBench
# Get training images and convert them to vectors.
trainingImages, trainingTags = data.getImagesAndTags(trainingDataset)
trainingVectors = encoder.imagesToVectors(trainingImages)
# Specify parameter values to search
parameters = Parameters()
parameters.define("dataSet", ['20.xml'])
#parameters.define("dataSet",[
#'1.xml','2.xml', '3.xml', '4.xml', '5.xml', '6.xml', '7.xml', '8.xml',
#'9.xml', '10.xml', '11.xml', '12.xml', '13.xml', '14.xml', '15.xml',
#'16.xml', '17.xml', '18.xml', '19.xml', '20.xml', '21.xml', '22.xml',
#'23.xml', '24.xml', '25.xml', '26.xml', '27.xml', '28.xml', '29.xml',
#'30.xml', '31.xml', '32.xml', '33.xml', '34.xml', '35.xml', '36.xml',
#'37.xml', '38.xml', '39.xml', '40.xml', '41.xml', '42.xml', '43.xml',
#'44.xml', '45.xml', '46.xml', '47.xml', '48.xml', '49.xml', '50.xml',
#'51.xml', '52.xml', '53.xml', '54.xml', '55.xml', '56.xml', '57.xml',
#'58.xml', '59.xml', '60.xml', '61.xml', '62.xml'])
parameters.define("numCols", [16])
#parameters.define("numCols", [256,512,1024,2048])
parameters.define("synPermConn", [0.3])
#parameters.define("synPermConn", [0.9, 0.7, 0.5, 0.3, 0.1])
parameters.define("synPermDecFrac", [1.0])
示例2: Parameters
# 需要导入模块: from parameters import Parameters [as 别名]
# 或者: from parameters.Parameters import define [as 别名]
trainingDataset = 'DataSets/OCR/characters/cmr_hex.xml'
minAccuracy = 100.0
maxTrainingCycles = 5
testingDataset = 'DataSets/OCR/characters/cmr_hex.xml'
if __name__ == "__main__":
# Get training images and convert them to vectors.
trainingImages, trainingTags = data.getImagesAndTags(trainingDataset)
trainingVectors = encoder.imagesToVectors(trainingImages)
# Specify parameter values to search
parameters = Parameters()
parameters.define("synPermConn", [0.5])
parameters.define("synPermDecFrac", [1.0, 0.5, 0.1])
parameters.define("synPermIncFrac", [1.0, 0.5, 0.1])
# Run the model until all combinations have been tried
while parameters.getNumResults() < parameters.numCombinations:
# Pick a combination of parameter values
parameters.nextCombination()
#parameters.nextRandomCombination()
synPermConn = parameters.getValue("synPermConn")
synPermDec = synPermConn*parameters.getValue("synPermDecFrac")
synPermInc = synPermConn*parameters.getValue("synPermIncFrac")
# Instantiate our spatial pooler
示例3: Parameters
# 需要导入模块: from parameters import Parameters [as 别名]
# 或者: from parameters.Parameters import define [as 别名]
from vision_testbench import VisionTestBench
from classifiers import KNNClassifier
minAccuracy = 200.0
maxTrainingCycles = 5
if __name__ == "__main__":
# Specify parameter values to search
parameters = Parameters()
parameters.define("dataSet",[
'1.xml','2.xml', '3.xml', '4.xml', '5.xml', '6.xml', '7.xml', '8.xml',
'9.xml', '10.xml', '11.xml', '12.xml', '13.xml', '14.xml', '15.xml',
'16.xml', '17.xml', '18.xml', '19.xml', '20.xml', '21.xml', '22.xml',
'23.xml', '24.xml', '25.xml', '26.xml', '27.xml', '28.xml', '29.xml',
'30.xml', '31.xml', '32.xml', '33.xml', '34.xml', '35.xml', '36.xml',
'37.xml', '38.xml', '39.xml', '40.xml', '41.xml', '42.xml', '43.xml',
'44.xml', '45.xml', '46.xml', '47.xml', '48.xml', '49.xml', '50.xml',
'51.xml', '52.xml', '53.xml', '54.xml', '55.xml', '56.xml', '57.xml',
'58.xml', '59.xml', '60.xml', '61.xml', '62.xml'])
# Run the model until all combinations have been tried
while parameters.getNumResults() < parameters.numCombinations:
# Pick a combination of parameter values
parameters.nextCombination()
dataSet = parameters.getValue("dataSet")
trainingDataset = 'DataSets/OCR/characters/capacity_datasets/' + dataSet
trainingImages, trainingTags = data.getImagesAndTags(trainingDataset)
trainingVectors = encoder.imagesToVectors(trainingImages)