Examples of Sample


Examples of com.greentea.relaxation.jnmf.util.data.Sample

      int totalNotGuessedClasses = 0;
      int[] notGuessedClasses = new int[data.getOutputsCount()];

      for (int i = 0; i < data.size(); ++i)
      {
         Sample pair = data.get(i);

         network.feedforwardStep(pair.getInput());
         DoubleList networkResult = network.getResult();
         DoubleList realResult = pair.getOutput();

         double error = JNMFMathUtils.distance(networkResult, realResult);
         averageError += error;

         if (data.isSplitedOnClasses())
View Full Code Here

Examples of com.greentea.relaxation.jnmf.util.data.Sample

         inputsForClasses.add(new ArrayList<DoubleList>());
      }

      for (int i = 0; i < learningData.size(); ++i)
      {
         Sample pair = learningData.get(i);

         inputsForClasses.get(findWinnerClass(pair.getOutput())).add(pair.getInput());
      }

      return inputsForClasses;
   }
View Full Code Here

Examples of com.greentea.relaxation.jnmf.util.data.Sample

      double maxIn0 = Integer.MIN_VALUE;
      double maxIn1 = Integer.MIN_VALUE;

      for (int i = 0; i < data.size(); ++i)
      {
         Sample pair = data.get(i);
         double in0 = pair.getInput().get(0);
         double in1 = pair.getInput().get(1);

         if (in0 < minIn0)
         {
            minIn0 = in0;
         }
View Full Code Here

Examples of com.iggroup.oss.sample.domain.Sample

    * Success test case for getSampleByReference
    */
   @Test
   public void testGetSampleByReference() {
      try {
         Sample sample = service.getSampleByReference("00001");
         assertTrue(sample.getReference().equalsIgnoreCase("00001"));
      } catch (Exception se) {
         assertTrue(false);
      }
   }
View Full Code Here

Examples of com.iggroup.oss.sample.domain.Sample

    */
   @Test
   public void testCreateSample() {

      try {
         service.createSample(new Sample(getAvailableRef(), "New Sample",
            SampleType.BOOK));
         assertTrue(true);
      } catch (Exception e) {
         assertTrue(false);
      }
View Full Code Here

Examples of com.iggroup.oss.sample.domain.Sample

    */
   @Test
   public void testDeleteSample() {
      String tempRef = getAvailableRef();
      try {
         service.createSample(new Sample(tempRef, "New Sample",
            SampleType.BOOK));
         service.deleteSample(tempRef);
      } catch (Exception e) {
         assertTrue(false);
      }
View Full Code Here

Examples of com.iggroup.oss.sample.domain.Sample

    */
   @Test
   public void testUpdateSample() {

      try {
         Sample sample = service.getSampleByReference("00001");
         sample.setName("New name");
         service.updateSample(sample);
      } catch (Exception e) {
         assertTrue(false);
      }

View Full Code Here

Examples of com.iggroup.oss.sample.domain.Sample

   @Profiled
   @Override
   public Sample getSampleByReference(String reference) {

      Sample sample;
      sample = sampleDAO.loadSample(reference);
      return sample;
   }
View Full Code Here

Examples of com.iggroup.oss.sample.domain.Sample

    * Default constructor. Sets up the "database"
    */
   public SampleDAO() {

      getDatabase().put("00001",
         new Sample("00001", "Wuthering Heights", SampleType.BOOK));
      getDatabase().put("00002",
         new Sample("00002", "Silas Marner", SampleType.BOOK));
      getDatabase().put("00003",
         new Sample("00003", "The Life of Pi", SampleType.BOOK));
      getDatabase().put("00004",
         new Sample("00004", "Gladiator", SampleType.DVD));
      getDatabase().put("00005",
         new Sample("00005", "Oliver Twist", SampleType.BOOK));

   }
View Full Code Here

Examples of com.iggroup.oss.sample.domain.Sample

    * @param reference the unique reference for a sample object
    * @return sample if found, else throws a NotFoundException
    */
   public Sample loadSample(String reference) {

      Sample sample = database.get(reference);

      if (sample == null) {
         throw new ReferenceNotFoundException(reference);
      }
      return sample;
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.