コード例 #1
0
        globalInhibition=True,
        localAreaDensity=-1,  # Using numActiveColumnsPerInhArea
        #localAreaDensity = 0.02, # one percent of columns active at a time
        #numActiveColumnsPerInhArea = -1, # Using percentage instead
        numActiveColumnsPerInhArea=1,  # Only one feature active at a time
        # All input activity can contribute to feature output
        stimulusThreshold=0,
        synPermInactiveDec=0.3,
        synPermActiveInc=0.3,
        synPermConnected=0.3,  # Connected threshold
        maxBoost=2,
        seed=1956,  # The seed that Grok uses
        spVerbosity=1)

    # Instantiate the spatial pooler test bench.
    tb = VisionTestBench(sp)

    # Instantiate the classifier
    clf = exactMatch()

    # Train the spatial pooler on trainingVectors.
    numCycles = tb.train(trainingVectors, trainingTags, clf, maxTrainingCycles)

    # View the permanences and connections after training.
    tb.showPermsAndConns()
    #tb.savePermsAndConns('perms_and_conns.jpg')

    # Get testing images and convert them to vectors.
    testingImages, testingTags = data.getImagesAndTags(testingDataset)
    testingVectors = encoder.imagesToVectors(testingImages)
コード例 #2
0
ファイル: demo.py プロジェクト: neuroidss/nupic.vision
    globalInhibition = True,
    localAreaDensity = -1, # Using numActiveColumnsPerInhArea
    #localAreaDensity = 0.02, # one percent of columns active at a time
    #numActiveColumnsPerInhArea = -1, # Using percentage instead
    numActiveColumnsPerInhArea = 1, # Only one feature active at a time
    # All input activity can contribute to feature output
    stimulusThreshold = 0,
    synPermInactiveDec = 0.3,
    synPermActiveInc = 0.3,
    synPermConnected = 0.3, # Connected threshold
    maxBoost = 2,
    seed = 1956, # The seed that Grok uses
    spVerbosity = 1)

  # Instantiate the spatial pooler test bench.
  tb = VisionTestBench(sp)

  # Instantiate the classifier
  clf = exactMatch()

  # Train the spatial pooler on trainingVectors.
  numCycles = tb.train(trainingVectors, trainingTags, clf, maxTrainingCycles)

  # View the permanences and connections after training.
  tb.showPermsAndConns()
  #tb.savePermsAndConns('perms_and_conns.jpg')

  # Get testing images and convert them to vectors.
  testingImages, testingTags = data.getImagesAndTags(testingDataset)
  testingVectors = encoder.imagesToVectors(testingImages)
コード例 #3
0
        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,
        synPermActiveInc=synPermInc,
        synPermConnected=synPermConn,
        maxBoost=1.0,
        seed=1956,  # The seed that Grok uses
        spVerbosity=1)

    # Instantiate the spatial pooler test bench.
    tb = VisionTestBench(sp)

    # Instantiate the classifier
    clf = KNNClassifier()

    # Train the spatial pooler on trainingVectors.
    numCycles = tb.train(trainingVectors, trainingTags, clf, maxTrainingCycles,
                         minAccuracy)

    # Save the permanences and connections after training.
    #tb.savePermanences('perms.jpg')
    #tb.showPermanences()
    #tb.showConnections()

    # Get testing images and convert them to vectors.
    testingImages, testingTags = data.getImagesAndTags(testingDataset)
コード例 #4
0
   #numActiveColumnsPerInhArea = -1, # Using percentage instead
   numActiveColumnsPerInhArea = 64,
   # All input activity can contribute to feature output
   stimulusThreshold = 0,
   synPermInactiveDec = 0.001,
   synPermActiveInc = 0.001,
   synPermConnected = 0.3,
   minPctOverlapDutyCycle=0.001,
   minPctActiveDutyCycle=0.001,
   dutyCyclePeriod=1000,
   maxBoost = 1.0,
   seed = 1956, # The seed that Grok uses
   spVerbosity = 1)
 
 # Instantiate the spatial pooler test bench.
 tb = VisionTestBench(sp)
 
 # Instantiate the classifier
 clf = KNNClassifier()
 
 # Get training images and convert them to vectors.
 trainingImages, trainingTags = data.getImagesAndTags(trainingDataset)
 trainingVectors = encoder.imagesToVectors(trainingImages)
 
 # Train the spatial pooler on trainingVectors.
 numCycles = tb.train(trainingVectors, trainingTags, clf, maxTrainingCycles,
   minAccuracy)
 
 # Save the permanences and connections after training.
 #tb.savePermanences('perms.jpg')
 #tb.showPermanences()
コード例 #5
0
      localAreaDensity = -1, # Using numActiveColumnsPerInhArea
      #localAreaDensity = 0.02, # one percent of columns active at a time
      #numActiveColumnsPerInhArea = -1, # Using percentage instead
      numActiveColumnsPerInhArea = 64,
      # All input activity can contribute to feature output
      stimulusThreshold = 0,
      synPermInactiveDec = synPermDec,
      synPermActiveInc = synPermInc,
      synPermConnected = synPermConn, # Connected threshold
      maxBoost = 3,
      seed = 1956, # The seed that Grok uses
      spVerbosity = 1)


    # Instantiate the spatial pooler test bench.
    tb = VisionTestBench(sp)

    # Train the spatial pooler on trainingVectors.
    trainSDRIs, numCycles = tb.train(trainingVectors, trainingTags,
      maxTrainingCycles, usePPM=False)

    # Save the permanences and connections after training.
    tb.savePermsAndConns('perms_and_conns.jpg')
    #tb.showPermsAndConns()

    # Get testing images and convert them to vectors.
    testingImages, testingTags = data.getImagesAndTags(testingDataset)
    testingVectors = encoder.imagesToVectors(testingImages)

    # Test the spatial pooler on testingVectors.
    testSDRIs = tb.test(testingVectors, testingTags)
コード例 #6
0
ファイル: demo.py プロジェクト: rhyolight/nupic.vision
  localAreaDensity = -1, # Using numActiveColumnsPerInhArea 
  #localAreaDensity = 0.02, # one percent of columns active at a time
  #numActiveColumnsPerInhArea = -1, # Using percentage instead
  numActiveColumnsPerInhArea = 1, # Only one feature active at a time
  # All input activity can contribute to feature output
  stimulusThreshold = 0,
  synPermInactiveDec = 0.1,
  synPermActiveInc = 0.1,
  synPermConnected = 0.1, # Connected threshold
  maxBoost = 3,
  seed = 1956, # The seed that Grok uses
  spVerbosity = 1)


# Instantiate the spatial pooler test bench.
tb = VisionTestBench(sp)

# Train the spatial pooler on trainingVectors.
SDRs, numCycles = tb.train(trainingVectors, trainingTags, maxTrainingCycles)

# View the permanences and connections after training.
tb.showPermsAndConns()
#tb.savePermsAndConns('perms_and_conns.jpg')

# Get testing images and convert them to vectors.
testingImages, testingTags = data.getImagesAndTags(testingDataset)
testingVectors = encoder.imagesToVectors(testingImages)

# Test the spatial pooler on testingVectors.
testSDRs = tb.test(testingVectors, testingTags)
if testSDRs != SDRs: