Examples of nextGaussian()


Examples of java.util.Random.nextGaussian()

    ArrayList<double[]> test = new ArrayList<double[]>();
    // 4. generate positive test samples
    for (int i = 0; i < nbPosTest; i++) {
      double[] t = new double[dimension];
      for (int x = 0; x < dimension; x++) {
        t[x] = ran.nextGaussian();
      }

      test.add(t);
    }
View Full Code Here

Examples of java.util.Random.nextGaussian()

      for(int i = 0 ; i < nbPosTrain; i++)
      {
        double[] t = new double[dimension];
        for(int x = 0 ; x < dimension; x++)
        {
          t[x] = posstart + ran.nextGaussian();
        }

        train.add(new TrainingSample<double[]>(t, 1));
      }
      //2. generate negative train samples
View Full Code Here

Examples of java.util.Random.nextGaussian()

      for(int i = 0 ; i < nbNegTrain; i++)
      {
        double[] t = new double[dimension];
        for(int x = 0 ; x < dimension; x++)
        {
          t[x] = negstart + ran.nextGaussian();
        }

        train.add(new TrainingSample<double[]>(t, -1));
      }
View Full Code Here

Examples of java.util.Random.nextGaussian()

      for(int i = 0 ; i < nbPosTest; i++)
      {
        double[] t = new double[dimension];
        for(int x = 0 ; x < dimension; x++)
        {
          t[x] = posstart + ran.nextGaussian();
        }

        test.add(new TrainingSample<double[]>(t, 1));
      }
      //5. generate negative test samples
View Full Code Here

Examples of java.util.Random.nextGaussian()

      for(int i = 0 ; i < nbNegTest; i++)
      {
        double[] t = new double[dimension];
        for(int x = 0 ; x < dimension; x++)
        {
          t[x] = negstart + ran.nextGaussian();
        }

        test.add(new TrainingSample<double[]>(t, -1));
      }
View Full Code Here

Examples of java.util.Random.nextGaussian()

        Random rand = new Random();
        if (seed != null) rand.setSeed(seed);
        for (int t = 0; t < n_trial; ++t) {
            double[] prob = initProbability();
            double alpha = this.alpha + rand.nextGaussian() * ALPHA_WIDTH;

            for (int i = 0;; ++i) {
                int r = rand.nextInt(ngrams.size());
                updateLangProb(prob, ngrams.get(r), alpha);
                if (i % 5 == 0) {
View Full Code Here

Examples of java.util.Random.nextGaussian()

        final double p = 4.1;
        final HarmonicOscillator f = new HarmonicOscillator(a, w, p);

        final WeightedObservedPoints points = new WeightedObservedPoints();
        for (double x = 0.0; x < 10.0; x += 0.1) {
            points.add(1, x, f.value(x) + 0.01 * randomizer.nextGaussian());
        }

        final HarmonicCurveFitter fitter = HarmonicCurveFitter.create();
        final double[] fitted = fitter.fit(points.toList());
        Assert.assertEquals(a, fitted[0], 7.6e-4);
View Full Code Here

Examples of java.util.Random.nextGaussian()

    public void testTinyVariationsData() {
        final Random randomizer = new Random(64925784252L);

        final WeightedObservedPoints points = new WeightedObservedPoints();
        for (double x = 0.0; x < 10.0; x += 0.1) {
            points.add(1, x, 1e-7 * randomizer.nextGaussian());
        }

        final HarmonicCurveFitter fitter = HarmonicCurveFitter.create();
        fitter.fit(points.toList());

View Full Code Here

Examples of java.util.Random.nextGaussian()

        final double p = 4.1;
        final HarmonicOscillator f = new HarmonicOscillator(a, w, p);

        final WeightedObservedPoints points = new WeightedObservedPoints();
        for (double x = 0.0; x < 10.0; x += 0.1) {
            points.add(1, x, f.value(x) + 0.01 * randomizer.nextGaussian());
        }

        final HarmonicCurveFitter fitter = HarmonicCurveFitter.create()
            .withStartPoint(new double[] { 0.15, 3.6, 4.5 });
        final double[] fitted = fitter.fit(points.toList());
View Full Code Here

Examples of java.util.Random.nextGaussian()

        final int size = 100;
        final double[] xTab = new double[size];
        final double[] yTab = new double[size];
        for (int i = 0; i < size; i++) {
            xTab[i] = 0.1 * i;
            yTab[i] = f.value(xTab[i]) + 0.01 * randomizer.nextGaussian();
        }

        // shake it
        for (int i = 0; i < size; i++) {
            int i1 = randomizer.nextInt(size);
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.