Package java.util.concurrent

Examples of java.util.concurrent.ThreadLocalRandom.nextDouble()


        Set<MeasurementDataNumeric> data = new HashSet<MeasurementDataNumeric>(batchSize);
        long timestamp = dateTimeService.nowInMillis();
        ThreadLocalRandom random = ThreadLocalRandom.current();

        for (int i = 0; i < batchSize; ++i) {
            data.add(new MeasurementDataNumeric(timestamp, startingScheduleId + i, random.nextDouble()));
        }

        return data;
    }
View Full Code Here


        double[] hidden3 = new double[config.hiddenSize];

        // Run dropout: randomly drop some hidden-layer units. `ls`
        // contains the indices of those units which are still active
        int[] ls = IntStream.range(0, config.hiddenSize)
                            .filter(n -> random.nextDouble() > params.getDropOutProb())
                            .toArray();

        int offset = 0;
        for (int j = 0; j < config.numTokens; ++j) {
          int tok = feature.get(j);
View Full Code Here

        int c = 0, o = 0;
        while (c < count && count + o < src.size())
        {
            int leeway = src.size() - (count + o);
            int spreadover = count - c;
            o += Math.round(rnd.nextDouble() * (leeway / (double) spreadover));
            r.add(src.get(o + c++));
        }
        while (c < count)
            r.add(src.get(o + c++));
        return r;
View Full Code Here

            int runCount = 0;
            int byteCount = 0;
            while (byteCount < trg.length)
            {
                byte[] nextRun;
                if (runCount == 0 || random.nextDouble() < this.randomRatio)
                {
                    nextRun = new byte[random.nextInt(randomRunLength[0], randomRunLength[1])];
                    random.nextBytes(nextRun );
                    runs[runCount % runs.length] = nextRun;
                    runCount++;
View Full Code Here

        int c = 0, o = 0;
        while (c < count && count + o < totalCount)
        {
            int leeway = totalCount - (count + o);
            int spreadover = count - c;
            o += Math.round(rnd.nextDouble() * (leeway / (double) spreadover));
            indices[c] = o + c;
            c++;
        }
        while (c < count)
        {
View Full Code Here

        int c = 0, o = 0;
        while (c < count && count + o < totalCount)
        {
            int leeway = totalCount - (count + o);
            int spreadover = count - c;
            o += Math.round(rnd.nextDouble() * (leeway / (double) spreadover));
            indices[c] = o + c;
            c++;
        }
        while (c < count)
        {
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.