Package org.encog.platformspecific.j2se.data.image

Examples of org.encog.platformspecific.j2se.data.image.ImageNeuralData


          ideal.setData(i, -1);
        }
      }

      final Image img = ImageIO.read(pair.getFile());
      final ImageNeuralData data = new ImageNeuralData(img);
      this.training.add(data, ideal);
    }

    final String strHidden1 = getArg("hidden1");
    final String strHidden2 = getArg("hidden2");
View Full Code Here


  public void processWhatIs() throws IOException {
    final String filename = getArg("image");
    final File file = new File(filename);
    final Image img = ImageIO.read(file);
    final ImageNeuralData input = new ImageNeuralData(img);
    input.downsample(this.downsample, false, this.downsampleHeight,
        this.downsampleWidth, 1, -1);
    final int winner = this.network.winner(input);
    System.out.println("What is: " + filename + ", it seems to be: "
        + this.neuron2identity.get(winner));
  }
View Full Code Here

    g.dispose();
   
    Downsample downsample = new SimpleIntensityDownsample();
    ImageNeuralDataSet set = new ImageNeuralDataSet(downsample,true,-1,1);
    BasicMLData ideal = new BasicMLData(1);
    ImageNeuralData input = new ImageNeuralData(image);
    set.add(input,ideal);
    set.downsample(2,2);
    Iterator<MLDataPair> itr = set.iterator();
    MLDataPair pair = (MLDataPair)itr.next();
    MLData data = pair.getInput();
    double[] d = data.getData();
    //Assert.assertEquals(d[0],-1.0, 0.1);
    //Assert.assertEquals(d[5],1, 0.1);
   
    // just "flex" these for no exceptions
    input.toString();
    input.setImage(input.getImage());
  }
View Full Code Here

TOP

Related Classes of org.encog.platformspecific.j2se.data.image.ImageNeuralData

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.