Search in sources :

Example 16 with DoubleSummaryStatistics

use of java.util.DoubleSummaryStatistics in project j2objc by google.

the class DoubleSummaryStatisticsTest method test_empty.

public void test_empty() {
    DoubleSummaryStatistics dss = new DoubleSummaryStatistics();
    assertEquals(0, dss.getCount());
    assertEquals(0.0d, dss.getSum());
    assertEquals(0.0d, dss.getAverage());
    assertEquals(Double.POSITIVE_INFINITY, dss.getMin());
    assertEquals(Double.NEGATIVE_INFINITY, dss.getMax());
}
Also used : DoubleSummaryStatistics(java.util.DoubleSummaryStatistics)

Example 17 with DoubleSummaryStatistics

use of java.util.DoubleSummaryStatistics in project j2objc by google.

the class DoubleSummaryStatisticsTest method test_getMin.

public void test_getMin() {
    DoubleSummaryStatistics dss1 = getDoubleSummaryStatisticsData1();
    assertEquals(-53.4d, dss1.getMin());
    dss1.accept(Double.NaN);
    assertEquals(Double.NaN, dss1.getMin());
}
Also used : DoubleSummaryStatistics(java.util.DoubleSummaryStatistics)

Example 18 with DoubleSummaryStatistics

use of java.util.DoubleSummaryStatistics in project j2objc by google.

the class DoubleSummaryStatisticsTest method test_accept.

public void test_accept() {
    DoubleSummaryStatistics dss = new DoubleSummaryStatistics();
    dss.accept(100.5d);
    assertEquals(1, dss.getCount());
    assertEquals(100.5d, dss.getSum());
    dss.accept(45.0d);
    assertEquals(2, dss.getCount());
    assertEquals(145.5d, dss.getSum());
}
Also used : DoubleSummaryStatistics(java.util.DoubleSummaryStatistics)

Example 19 with DoubleSummaryStatistics

use of java.util.DoubleSummaryStatistics in project j2objc by google.

the class DoubleSummaryStatisticsTest method test_getMax.

public void test_getMax() {
    DoubleSummaryStatistics dss1 = getDoubleSummaryStatisticsData1();
    assertEquals(100.0d, dss1.getMax());
    dss1.accept(Double.NaN);
    assertEquals(Double.NaN, dss1.getMax());
}
Also used : DoubleSummaryStatistics(java.util.DoubleSummaryStatistics)

Example 20 with DoubleSummaryStatistics

use of java.util.DoubleSummaryStatistics in project j2objc by google.

the class DoubleSummaryStatisticsTest method test_getSum.

public void test_getSum() {
    DoubleSummaryStatistics dss1 = getDoubleSummaryStatisticsData1();
    assertEquals(148.4, dss1.getSum());
    dss1.accept(Double.NaN);
    assertEquals(Double.NaN, dss1.getSum());
}
Also used : DoubleSummaryStatistics(java.util.DoubleSummaryStatistics)

Aggregations

DoubleSummaryStatistics (java.util.DoubleSummaryStatistics)39 Arrays (java.util.Arrays)9 List (java.util.List)9 Test (org.junit.Test)9 Layer (com.simiacryptus.mindseye.lang.Layer)8 Tensor (com.simiacryptus.mindseye.lang.Tensor)8 LongSummaryStatistics (java.util.LongSummaryStatistics)8 IntStream (java.util.stream.IntStream)8 Nonnull (javax.annotation.Nonnull)8 Nullable (javax.annotation.Nullable)8 TrainingMonitor (com.simiacryptus.mindseye.opt.TrainingMonitor)7 Map (java.util.Map)6 LoggingWrapperLayer (com.simiacryptus.mindseye.layers.java.LoggingWrapperLayer)5 MonitoringWrapperLayer (com.simiacryptus.mindseye.layers.java.MonitoringWrapperLayer)5 StochasticComponent (com.simiacryptus.mindseye.layers.java.StochasticComponent)5 DAGNetwork (com.simiacryptus.mindseye.network.DAGNetwork)5 DAGNode (com.simiacryptus.mindseye.network.DAGNode)5 Step (com.simiacryptus.mindseye.opt.Step)5 MonitoredObject (com.simiacryptus.util.MonitoredObject)5 DoubleStatistics (com.simiacryptus.util.data.DoubleStatistics)5