Package model.MARK_II

Examples of model.MARK_II.SpatialPooler


                percentMinimumOverlapScore, (int) desiredLocalActivity);

        AbstractSensorCellsToRegionConnect retinaToRegion = new SensorCellsToRegionRectangleConnect();
        retinaToRegion.connect(retina.getVisionCells(), region, 0, 0);

        SpatialPooler spatialPooler = new SpatialPooler(region);
        spatialPooler.setLearningState(true);
        TemporalPooler temporalPooler = new TemporalPooler(spatialPooler,
                (int) newSynapseCount);
        temporalPooler.setLearningState(true);

        retina.seeBMPImage("2.bmp");

        int totalNumberOfSequenceSegments = 0;
        int totalNumberOfLearningNeurons = 0;
        for (int i = 0; i < (int) numberOfIterations; i++) {
            spatialPooler.performPooling();
            temporalPooler.performPooling();

            temporalPooler.getLearningAlgorithmStatistics().updateModelLearningMetrics(temporalPooler.getRegion());
            totalNumberOfSequenceSegments += temporalPooler.getLearningAlgorithmStatistics()
                    .getTotalNumberOfSequenceSegmentsInCurrentTimeStep();
View Full Code Here


                percentMinimumOverlapScore, (int) desiredLocalActivity);

        AbstractSensorCellsToRegionConnect retinaToRegion = new SensorCellsToRegionRectangleConnect();
        retinaToRegion.connect(retina.getVisionCells(), region, 0, 0);

        SpatialPooler spatialPooler = new SpatialPooler(region);
        spatialPooler.setLearningState(true);

        retina.seeBMPImage("2.bmp");

        spatialPooler.performPooling(); // 11 active columns
        Set<ColumnPosition> columnActivityAfterSeeingImage2 = spatialPooler
                .getActiveColumnPositions();
        // = (6,5)(6, 3)(6, 2)(5, 3)(3, 5)(2, 2)(1, 3)(1, 2)(2, 5)(1, 5)(4, 4)

        // -----------------------compute SDR score----------------------------
        int totalNumberOfColumnsInRegion = region.getNumberOfRowsAlongRegionYAxis()
View Full Code Here

                percentMinimumOverlapScore, (int) desiredLocalActivity);

        AbstractSensorCellsToRegionConnect retinaToRegion = new SensorCellsToRegionRectangleConnect();
        retinaToRegion.connect(retina.getVisionCells(), region, 0, 0);

        SpatialPooler spatialPooler = new SpatialPooler(region);
        spatialPooler.setLearningState(true);

        int numberOfImagesToSee = 1000;
        double totalSDRScore = 0.0;
        for (int i = 1; i < (numberOfImagesToSee + 1); i++) {
            mnistManager.setCurrent(i);
            int[][] image = mnistManager.readImage();

            retina.see2DIntArray(image);
            spatialPooler.performPooling();
            Set<ColumnPosition> columnActivityAfterSeeingCurrentMNISTImage = spatialPooler
                    .getActiveColumnPositions();

            // compute SDR score
            int totalNumberOfColumnsInRegion = region.getNumberOfRowsAlongRegionYAxis()
                    * region.getNumberOfColumnsAlongRegionXAxis();
 
View Full Code Here

        Region region = new Region("Region", 8, 8, 1, 50, 3);

        AbstractSensorCellsToRegionConnect retinaToRegion = new SensorCellsToRegionRectangleConnect();
        retinaToRegion.connect(retina.getVisionCells(), region, 0, 0);

        SpatialPooler spatialPooler = new SpatialPooler(region);
        spatialPooler.setLearningState(true);

        retina.seeBMPImage("2.bmp");

        spatialPooler.performPooling(); // 11 active columns
        this.columnActivityAfterSeeingImage2 = spatialPooler
                .getActiveColumnPositions();
        // = (6,5)(6, 3)(6, 2)(5, 3)(3, 5)(2, 2)(1, 3)(1, 2)(2, 5)(1, 5)(4, 4)
    }
View Full Code Here

        this.region.setInhibitionRadius(3);

        AbstractSensorCellsToRegionConnect retinaToRegion = new SensorCellsToRegionRectangleConnect();
        retinaToRegion.connect(this.retina.getVisionCells(), this.region, 0, 0);

        this.spatialPooler = new SpatialPooler(this.region);
        this.spatialPooler.setLearningState(true);
    }
View Full Code Here

        Region LGNRegion = partialNervousSystem.getCNS().getBrain()
                .getThalamus().getLGN().getRegion();

        retina.seeBMPImage("2.bmp");

        SpatialPooler spatialPooler = new SpatialPooler(LGNRegion);
        spatialPooler.setLearningState(true);
        spatialPooler.performPooling();
        Set<ColumnPosition> LGNNeuronActivity = spatialPooler
                .getActiveColumnPositions();

        assertEquals(11, LGNNeuronActivity.size());

        // save partialNervousSystemObject object in JSON format
View Full Code Here

        AbstractSensorCellsToRegionConnect retinaToLGN = new SensorCellsToRegionRectangleConnect();
        retinaToLGN.connect(retina.getVisionCells(), LGNRegion, 0, 0);

        // run spatial pooling on a image
        SpatialPooler spatialPooler = new SpatialPooler(LGNRegion);
        spatialPooler.setLearningState(true);

        retina.seeBMPImage("2.bmp");
        Set<Column> LGNNeuronActivity = spatialPooler
                .performPooling();

        assertEquals(11, LGNNeuronActivity.size());

        Gson gson2 = new Gson();
        Region trainedLGNRegion = spatialPooler.getRegion();
        String regionObject = gson2.toJson(trainedLGNRegion);

        JsonFileInputOutput.saveObjectToTextFile(regionObject,
                "./src/test/java/model/util/test_saveRegionObject.txt");
    }
View Full Code Here

        Region region = new Region("region", 8, 8, 4, 50, 1);

        AbstractSensorCellsToRegionConnect connectType2 = new SensorCellsToRegionRectangleConnect();
        connectType2.connect(retina.getVisionCells(), region, 2, 2);

        SpatialPooler spatialPooler = new SpatialPooler(region);
        spatialPooler.setLearningState(true);

        // declare sets to test on
        Set<ColumnPosition> emptySet = new HashSet<ColumnPosition>();
        Set<ColumnPosition> filledSet = new HashSet<ColumnPosition>();

        // create columns that should be in the filledSet
        ColumnPosition cp1 = new ColumnPosition(6, 5);
        ColumnPosition cp2 = new ColumnPosition(6, 2);
        ColumnPosition cp3 = new ColumnPosition(1, 2);
        ColumnPosition cp4 = new ColumnPosition(2, 5);
        ColumnPosition cp5 = new ColumnPosition(4, 4);

        // add the column positions to the filledSet
        filledSet.add(cp1);
        filledSet.add(cp2);
        filledSet.add(cp3);
        filledSet.add(cp4);
        filledSet.add(cp5);

        assertEquals(emptySet, spatialPooler.getActiveColumnPositions());

        // view the image, which will activate Columns in the spatialPooler
        retina.seeBMPImage("2.bmp");
        spatialPooler.performPooling();

        // filledSet contains ((6, 5), (6, 2), (1, 2), (2, 5), (4, 4))
        assertEquals(filledSet, spatialPooler.getActiveColumnPositions());
    }
View Full Code Here

TOP

Related Classes of model.MARK_II.SpatialPooler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.