Search in sources :

Example 1 with SerializationTest

use of com.simiacryptus.mindseye.test.unit.SerializationTest in project MindsEye by SimiaCryptus.

the class PipelineTest method test.

/**
 * Test double.
 *
 * @param log       the log
 * @param layer     the layer
 * @param header    the header
 * @param inputDims the input dims
 * @return the double
 */
@Nullable
public TrainingTester.ComponentResult test(@Nonnull final NotebookOutput log, @Nonnull final Layer layer, final String header, @Nonnull final int[]... inputDims) {
    @Nonnull final Layer component = layer.copy();
    final Tensor[] randomize = randomize(inputDims);
    new SerializationTest().test(log, component, randomize);
    return new TrainingTester() {

        @Override
        protected void printHeader(NotebookOutput log) {
            log.h1(header);
        }
    }.test(log, component, randomize);
}
Also used : TrainingTester(com.simiacryptus.mindseye.test.unit.TrainingTester) Tensor(com.simiacryptus.mindseye.lang.Tensor) Nonnull(javax.annotation.Nonnull) MarkdownNotebookOutput(com.simiacryptus.util.io.MarkdownNotebookOutput) NotebookOutput(com.simiacryptus.util.io.NotebookOutput) SerializationTest(com.simiacryptus.mindseye.test.unit.SerializationTest) Layer(com.simiacryptus.mindseye.lang.Layer) Nullable(javax.annotation.Nullable)

Example 2 with SerializationTest

use of com.simiacryptus.mindseye.test.unit.SerializationTest in project MindsEye by SimiaCryptus.

the class NLayerTest method test.

/**
 * Test double.
 *
 * @param log       the log
 * @param layer     the layer
 * @param inputDims the input dims
 * @return the double
 */
@Nullable
public TrainingTester.ComponentResult test(@Nonnull final NotebookOutput log, @Nonnull final Layer layer, @Nonnull final int[]... inputDims) {
    @Nonnull final Layer component = layer.copy();
    final Tensor[] randomize = randomize(inputDims);
    new SerializationTest().test(log, component, randomize);
    return new TrainingTester().test(log, component, randomize);
}
Also used : TrainingTester(com.simiacryptus.mindseye.test.unit.TrainingTester) Tensor(com.simiacryptus.mindseye.lang.Tensor) Nonnull(javax.annotation.Nonnull) SerializationTest(com.simiacryptus.mindseye.test.unit.SerializationTest) Layer(com.simiacryptus.mindseye.lang.Layer) Nullable(javax.annotation.Nullable)

Aggregations

Layer (com.simiacryptus.mindseye.lang.Layer)2 Tensor (com.simiacryptus.mindseye.lang.Tensor)2 SerializationTest (com.simiacryptus.mindseye.test.unit.SerializationTest)2 TrainingTester (com.simiacryptus.mindseye.test.unit.TrainingTester)2 Nonnull (javax.annotation.Nonnull)2 Nullable (javax.annotation.Nullable)2 MarkdownNotebookOutput (com.simiacryptus.util.io.MarkdownNotebookOutput)1 NotebookOutput (com.simiacryptus.util.io.NotebookOutput)1