Package java.util

Examples of java.util.Random.nextGaussian()


        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);
        DataOutputStream data = new DataOutputStream(out);
        Random rand = new Random(3333);
        for(int times = 0; times < 3; times++) {
            for(int i = 0; i < 10000; i++) {
                data.writeDouble(rand.nextGaussian());
            }
            probe(out.toByteArray_clear());
        }
    }
View Full Code Here


        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);
        DataOutputStream data = new DataOutputStream(out);
        Random rand = new Random(3333);
        for(int times = 0; times < 3; times++) {
            for(int i = 0; i < 10000; i++) {
                data.writeDouble(rand.nextGaussian());
            }
            probe(out.toByteArray_clear());
        }
    }
View Full Code Here

      for (int j = 0; j < 10; j++) {
        input.put(String.valueOf(i) + String.valueOf(j), String.valueOf(i));
      }
      JSONEvent e = new JSONEvent();
      e.setHeaders(input);
      e.setBody(String.valueOf(rand.nextGaussian()).getBytes(encoding));
      events.add(e);
    }
    Gson gson = new Gson();
    String json = gson.toJson(events, listType);
    StringEntity input = new StringEntity(json);
View Full Code Here

      for (int j = 0; j < 10; j++) {
        input.put(String.valueOf(i) + String.valueOf(j), String.valueOf(i));
      }
      JSONEvent e = new JSONEvent();
      e.setHeaders(input);
      e.setBody(String.valueOf(rand.nextGaussian()).getBytes(encoding));
      events.add(e);
    }
    Gson gson = new Gson();
    String json = gson.toJson(events, listType);
    StringEntity input = new StringEntity(json);
View Full Code Here

        input.put(String.valueOf(i) + String.valueOf(j), String.valueOf(i));
      }
      input.put("MsgNum", String.valueOf(i));
      JSONEvent e = new JSONEvent();
      e.setHeaders(input);
      e.setBody(String.valueOf(rand.nextGaussian()).getBytes("UTF-8"));
      events.add(e);
    }
    Gson gson = new Gson();
    String json = gson.toJson(events, listType);
    HttpsURLConnection httpsURLConnection = null;
View Full Code Here

            input.put(String.valueOf(i) + String.valueOf(j), String.valueOf(i));
        }
        input.put("MsgNum", String.valueOf(i));
        JSONEvent e = new JSONEvent();
        e.setHeaders(input);
        e.setBody(String.valueOf(rand.nextGaussian()).getBytes("UTF-8"));
        events.add(e);
    }
    Gson gson = new Gson();
    String json = gson.toJson(events, listType);
    HttpURLConnection httpURLConnection = null;
View Full Code Here

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

      train.add(t);
    }
    System.out.println("Samples generated");
View Full Code Here

    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

      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

      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

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.