Package com.greentea.relaxation.jnmf.util.data

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


      for (int i = 0; i < count; ++i)
      {
         double x1 = 5 + shift1 + rand.nextDouble();
         double y1 = 5 + rand.nextDouble();

         Sample v1 = new Sample(null, DataUtils.asList(x1, y1), DataUtils.asList(0, 1));

         double x2 = 5 + shift2 + rand.nextDouble();
         double y2 = 5 + rand.nextDouble();
         Sample v2 = new Sample(null, DataUtils.asList(x2, y2), DataUtils.asList(1, 0));

         data.add(v1);
         data.add(v2);
      }
View Full Code Here


   {
      TrainingDataset data = new TrainingDataset(2, 0);

      for (int i = 0; i < 100; ++i)
      {
         data.add(new Sample(null,
                 DataUtils.asList(RandomUtils.nextInt(30), RandomUtils.nextInt(30)), null));
      }

//      data.add(new Sample(DataUtils.asList(10, 10), null));
//      data.add(new Sample(DataUtils.asList(20, 18), null));
View Full Code Here

      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

         {
            double x = JNMFMathUtils
                    .reflectToInterval(j2, 0, pointsCount, in0Range.getMinimumDouble(),
                            in0Range.getMaximumDouble());

            Sample elem = new Sample(null, DataUtils.asList(x, y), null);
            testDataVectors.add(elem);
         }
      }

   }
View Full Code Here

   private void drawOriginalLearningDataPoints()
   {
      for (int i = 0; i < originalLearningData.size(); ++i)
      {
         Sample pair = originalLearningData.get(i);

         DoubleList input = pair.getInput();

         Color c1 = Color.WHITE;
         Color c2 = Color.BLACK;
         if (originalLearningData.getOutputsCount() > 1)
         {
            Color color = null;
            int winner = JNMFMathUtils.indexOfMaxElement(pair.getOutput());
            if (winner == 0)
            {
               color = c1;
            }
            else if (winner == 1)
            {
               color = c2;
            }

            drawPoint(input.get(0), input.get(1), color);
         }
         else if (originalLearningData.getOutputsCount() == 1)
         {
            double value = pair.getOutput().get(0);

            Color color = null;
            if (value > 0)
            {
               color = c1;
View Full Code Here

      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

         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

      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

TOP

Related Classes of com.greentea.relaxation.jnmf.util.data.Sample

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.