当前位置: 首页>>代码示例>>Python>>正文


Python Parameters.getValue方法代码示例

本文整理汇总了Python中parameters.Parameters.getValue方法的典型用法代码示例。如果您正苦于以下问题:Python Parameters.getValue方法的具体用法?Python Parameters.getValue怎么用?Python Parameters.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在parameters.Parameters的用法示例。


在下文中一共展示了Parameters.getValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: len

# 需要导入模块: from parameters import Parameters [as 别名]
# 或者: from parameters.Parameters import getValue [as 别名]
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])
#parameters.define("synPermDecFrac", [1.0, 0.5, 0.1])
parameters.define("synPermIncFrac", [1.0])
#parameters.define("synPermIncFrac", [1.0, 0.5, 0.1])


# Run the model until all combinations have been tried
combinations = []  # list for storing parameter combinations
results = []  # list for storing image recognition accuracy results
while len(results) < parameters.combinations:

  dataSet = parameters.getValue("dataSet")
  trainingDataset = 'DataSets/OCR/characters/' + dataSet
  trainingImages, trainingTags = data.getImagesAndTags(trainingDataset)
  trainingVectors = encoder.imagesToVectors(trainingImages)
  testingDataset = 'DataSets/OCR/characters/' + dataSet

  # Pick a random combination of parameter values
  #parameters.generateRandomCombination()
  numCols = parameters.getValue("numCols")
  synPermConn = parameters.getValue("synPermConn")
  synPermDec = synPermConn*parameters.getValue("synPermDecFrac")
  synPermInc = synPermConn*parameters.getValue("synPermIncFrac")

  # Run it if it hasn't been tried yet
  if parameters.getAllValues() not in combinations:
    print "Parameter Combination: ", parameters.getAllValues()
开发者ID:rhyolight,项目名称:nupic.vision,代码行数:33,代码来源:train_and_test.py

示例2: Parameters

# 需要导入模块: from parameters import Parameters [as 别名]
# 或者: from parameters.Parameters import getValue [as 别名]
  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
    sp = SpatialPooler(
      inputDimensions= (32, 32), # Size of image patch
      columnDimensions = (32, 32),
      potentialRadius = 10000, # Ensures 100% potential pool
      potentialPct = 0.8,
      globalInhibition = True,
      localAreaDensity = -1, # Using numActiveColumnsPerInhArea
      numActiveColumnsPerInhArea = 64,
      # All input activity can contribute to feature output
      stimulusThreshold = 0,
      synPermInactiveDec = synPermDec,
开发者ID:neuroidss,项目名称:nupic.vision,代码行数:33,代码来源:parameter_search.py

示例3: SpatialPooler

# 需要导入模块: from parameters import Parameters [as 别名]
# 或者: from parameters.Parameters import getValue [as 别名]
    '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)
    testingDataset = 'DataSets/OCR/characters/capacity_datasets/' + dataSet

    # Instantiate our spatial pooler
    sp = SpatialPooler(
      inputDimensions= (32, 32), # Size of image patch
      columnDimensions = (32, 32),
      potentialRadius = 10000, # Ensures 100% potential pool
      potentialPct = 0.8,
      globalInhibition = True,
      localAreaDensity = -1, # Using numActiveColumnsPerInhArea
      numActiveColumnsPerInhArea = 64,
      # All input activity can contribute to feature output
开发者ID:neuroidss,项目名称:nupic.vision,代码行数:33,代码来源:sp_capacity.py


注:本文中的parameters.Parameters.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。