Examples of MnistManager


Examples of mnist.tools.MnistManager

     */
    public static double printToFileAverageSDRScoreFor1RetinaTo1RegionModelForAllDigitsInMNIST(
            double percentMinimumOverlapScore, double desiredLocalActivity,
            double desiredPercentageOfActiveColumns,
            String locationOfFileWithFileNameToSaveScore) throws IOException {
        MnistManager mnistManager = new MnistManager(
                "./images/digits/MNIST/t10k-images.idx3-ubyte",
                "./images/digits/MNIST/t10k-labels.idx1-ubyte");

        // all images in MNIST dataset are 28 x 28 pixels
        Retina retina = new Retina(28, 28);
        Region region = new Region("Region", 8, 8, 1,
                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();
View Full Code Here

Examples of tv.floe.metronome.deeplearning.datasets.MnistManager

  public MnistDataFetcher() throws IOException {
    if (!new File("/tmp/mnist").exists()) {
      new MnistFetcher().downloadAndUntar();
    }
   
    man = new MnistManager( "/tmp/MNIST/" + MnistFetcher.trainingFilesFilename_unzipped, "/tmp/MNIST/" + MnistFetcher.trainingFileLabelsFilename_unzipped );
    numOutcomes = 10;
    totalExamples = NUM_EXAMPLES;
    //1 based cursor
    cursor = 1;
    man.setCurrent(cursor);
View Full Code Here

Examples of tv.floe.metronome.deeplearning.datasets.MnistManager

    for(int i = 0; i < numExamples; i++,cursor++) {
      if(!hasMore())
        break;
      if(man == null) {
        try {
          man = new MnistManager("/tmp/MNIST/" + MnistFetcher.trainingFilesFilename_unzipped,"/tmp/MNIST/" + MnistFetcher.trainingFileLabelsFilename_unzipped);
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      man.setCurrent(cursor);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.