コード例 #1
0
        #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)

    # Test the spatial pooler on testingVectors.
    accuracy = tb.test(testingVectors, testingTags, clf, verbose=1)
コード例 #2
0
ファイル: demo.py プロジェクト: neuroidss/nupic.vision
    #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)

  # Test the spatial pooler on testingVectors.
  accuracy = tb.test(testingVectors, testingTags, clf, verbose=1)