1. Test Modules
  2. Training Characteristics
    1. Input Learning
      1. Gradient Descent
      2. Conjugate Gradient Descent
      3. Limited-Memory BFGS
    2. Results
  3. Results

Subreport: Logs for com.simiacryptus.ref.lang.ReferenceCountingBase

Test Modules

Using Seed 9138532100232136704

Training Characteristics

Input Learning

In this apply, we use a network to learn this target input, given it's pre-evaluated output:

TrainingTester.java:332 executed in 0.03 seconds (0.000 gc):

    return RefArrays.stream(RefUtil.addRef(input_target)).flatMap(RefArrays::stream).map(x -> {
      try {
        return x.prettyPrint();
      } finally {
        x.freeRef();
      }
    }).reduce((a, b) -> a + "\n" + b).orElse("");

Returns

    [
    	[ [ 0.568, -1.036, -1.364 ], [ 0.924, 0.4, -1.232 ], [ 0.356, -0.436, -0.428 ], [ -1.572, 0.704, 1.344 ], [ -1.436, 1.508, -0.024 ], [ 0.668, -1.912, -1.392 ], [ -1.544, 1.98, 0.564 ], [ 1.444, -1.196, 0.208 ], ... ],
    	[ [ 0.688, -0.356, -1.1 ], [ -0.984, 1.672, -0.816 ], [ -1.032, -0.788, -1.472 ], [ -1.052, -0.492, -1.512 ], [ 0.096, -1.9, -1.856 ], [ -1.744, -1.584, -0.5 ], [ -0.496, -1.156, -0.876 ], [ -1.888, 1.668, -1.604 ], ... ],
    	[ [ 0.46, -0.38, -1.0 ], [ -0.132, -1.096, -1.548 ], [ 1.084, 1.52, -0.056 ], [ -1.024, 1.604, -0.804 ], [ 0.904, -1.128, -1.796 ], [ -1.696, 1.668, 0.932 ], [ -0.236, -0.288, -0.024 ], [ 1.152, -1.684, -0.912 ], ... ],
    	[ [ -1.684, -0.56, 0.564 ], [ -0.932, 1.72, -1.848 ], [ -1.692, 0.196, -1.352 ], [ -0.064, 0.784, 0.368 ], [ 1.732, -1.22, -0.52 ], [ 1.716, 1.448, 0.876 ], [ -0.848, -1.8, 0.396 ], [ -0.512, 1.7, 1.588 ], ... ],
    	[ [ 1.192, -1.296, 1.584 ], [ 1.772, -0.812, 0.108 ], [ -0.784, 1.44, 1.08 ], [ 1.972, 1.388, -1.648 ], [ 0.54, 1.46, -1.888 ], [ 1.116, -0.316, 0.856 ], [ -0.7, 0.476, 0.32 ], [ -0.612, 0.492, 0.608 ], ... ],
    	[ [ -0.736, -1.684, -0.164 ], [ 1.952, -1.508, -0.812 ], [ 1.66, -0.972, 0.996 ], [ 1.86, 0.412, -1.24 ], [ 0.144, 0.18, -0.824 ], [ -0.876, 1.86, -1.832 ], [ 0.312, 1.184, -1.276 ], [ 0.664, -0.876, -1.672 ], ... ],
    	[ [ -1.164, -0.648, -1.524 ], [ -0.136, -0.304, 1.688 ], [ 1.572, -0.304, -1.184 ], [ 1.936, -0.836, -1.02 ], [ 0.4, 1.872, 1.288 ], [ -0.224, 1.148, 0.732 ], [ 1.072, 0.836, 0.584 ], [ 0.744, 1.464, -1.788 ], ... ],
    	[ [ -0.356, -1.548, -0.204 ], [ -0.168, -0.672, 0.772 ], [ 0.64, -0.012, -1.652 ], [ -0.2, 0.084, 1.308 ], [ -0.372, -1.224, -1.96 ], [ 0.648, 0.132, 1.896 ], [ -1.36, 1.472, 0.524 ], [ 0.212, -1.34, 0.316 ], ... ],
    	...
    ]
    [
    	[ [ -1.536, 0.304, -0.188 ], [ 1.992, -1.384, 1.112 ], [ 1.924, -1.048, 0.792 ], [ -0.056, 0.052, -0.528 ], [ -1.368, -0.48, 1.224 ], [ -0.028, 1.112, 0.58 ], [ -0.132, -0.932, 0.72 ], [ 1.128, 1.688, 1.444 ], ... ],
    	[ [ 0.892, 1.236, 1.184 ], [ 0.696, -0.356, -0.656 ], [ -0.268, 1.316, 1.012 ], [ -1.972, 1.016, -1.392 ], [ -1.96, -0.468, -1.848 ], [ 0.16, 0.432, 0.552 ], [ 0.188, 1.828, 1.652 ], [ 1.988, 0.588, 0.936 ], ... ],
    	[ [ -0.54, 0.216, 1.924 ], [ -1.156, -0.672, -0.252 ], [ 1.788, 0.768, 1.448 ], [ -0.02, -1.316, -1.888 ], [ -1.06, -1.648, 0.772 ], [ 0.76, 0.032, 0.88 ], [ -0.18, 1.664, 1.42 ], [ 1.516, 0.732, -0.636 ], ... ],
    	[ [ -0.66, -1.796, 0.588 ], [ -0.576, 1.828, -0.136 ], [ 0.616, -1.288, 0.0 ], [ -0.856, -0.244, 1.052 ], [ -0.164, -1.256, 0.48 ], [ 1.576, 1.34, 1.14 ], [ 1.06, -1.908, -1.084 ], [ -0.008, -1.696, 0.924 ], ... ],
    	[ [ -0.056, 0.484, -1.528 ], [ 0.016, -1.312, -1.724 ], [ -0.344, 1.684, 1.056 ], [ 1.132, -0.864, 1.728 ], [ 1.432, -1.212, -0.796 ], [ -1.092, -0.94, -0.016 ], [ -0.652, -1.964, 1.16 ], [ -1.8, -1.328, -1.056 ], ... ],
    	[ [ 0.924, 0.672, 0.472 ], [ -0.9, -0.876, -0.6 ], [ -1.196, 0.748, -1.832 ], [ 1.024, 0.764, -1.328 ], [ 0.996, -1.332, -0.656 ], [ -0.332, -0.192, -0.94 ], [ -1.968, 1.028, 0.432 ], [ -0.424, 0.8, 1.192 ], ... ],
    	[ [ 0.748, 1.324, -1.356 ], [ 0.308, -1.932, 0.852 ], [ -0.112, 1.896, 0.692 ], [ -0.052, -1.144, -0.644 ], [ 0.44, -0.684, -0.336 ], [ 0.432, -1.256, 1.808 ], [ -0.2, 1.34, 0.3 ], [ 0.416, 1.728, -1.732 ], ... ],
    	[ [ 1.548, 0.192, -1.008 ], [ 0.244, -0.676, 1.384 ], [ 0.932, -0.984, 0.176 ], [ 1.104, 0.208, -0.772 ], [ -1.132, 1.884, 0.732 ], [ 1.816, 0.064, 0.472 ], [ -0.364, -0.744, -0.76 ], [ 0.872, -0.104, -1.64 ], ... ],
    	...
    ]
    [
    	[ [ 0.388, 0.548, 0.024 ], [ -0.188, 1.572, 0.256 ], [ -0.856, -0.296, -0.104 ], [ 1.244, -0.312, -1.772 ], [ -0.828, -1.076, 1.812 ], [ -0.32, 0.992, 1.976 ], [ 0.016, 0.564, 0.792 ], [ 0.88, -1.684, 1.384 ], ... ],
    	[ [ 0.196, 1.2, -0.308 ], [ -0.972, 0.316, -1.704 ], [ 1.88, -1.44, -1.192 ], [ -0.94, -1.116, -0.992 ], [ 0.224, 1.7, -0.528 ], [ 1.8, 0.596, -1.36 ], [ -0.46, 1.66, 0.84 ], [ -1.28, 1.16, 1.844 ], ... ],
    	[ [ -1.892, 1.16, 1.94 ], [ -0.38, -1.472, -0.428 ], [ -0.844, 1.272, -0.608 ], [ -0.884, 1.164, 0.98 ], [ -1.076, -1.18, -1.084 ], [ -0.596, 1.344, 0.664 ], [ 0.208, -0.848, -1.852 ], [ -0.612, 1.996, 1.136 ], ... ],
    	[ [ 0.008, 0.584, -0.288 ], [ -0.692, 1.848, 0.512 ], [ -0.332, 1.976, 1.644 ], [ 1.88, -1.464, 1.756 ], [ -0.164, -0.708, 1.896 ], [ 0.668, -0.328, 1.672 ], [ -0.468, 0.6, 0.44 ], [ 0.336, -0.98, 1.904 ], ... ],
    	[ [ 0.188, 1.148, -0.048 ], [ 0.0, -0.812, 0.224 ], [ -0.348, -0.624, 1.712 ], [ -0.976, -0.82, 1.368 ], [ -1.644, -0.252, 0.704 ], [ -1.368, -1.12, 0.28 ], [ -1.848, -0.62, 0.96 ], [ -1.368, -0.04, 0.64 ], ... ],
    	[ [ 1.732, 1.54, 1.472 ], [ 1.06, -0.664, -0.016 ], [ 0.988, 0.068, -0.828 ], [ -0.748, -0.72, -1.516 ], [ -0.356, 1.772, -1.88 ], [ -1.392, -1.36, -0.804 ], [ 1.184, 1.012, 1.14 ], [ -1.548, -0.856, 0.028 ], ... ],
    	[ [ -0.236, 0.528, -0.22 ], [ -1.836, 1.368, 0.308 ], [ 0.156, 1.688, 0.528 ], [ -0.728, 1.392, 0.884 ], [ -1.76, 0.552, -0.028 ], [ 0.072, 1.028, 1.524 ], [ -1.656, 1.708, -0.972 ], [ 0.496, 0.74, 1.484 ], ... ],
    	[ [ 1.324, 1.076, -1.188 ], [ -1.652, 1.916, 1.788 ], [ -0.056, -0.172, -1.172 ], [ 1.556, 0.664, 1.972 ], [ -0.792, 0.048, -0.532 ], [ -0.04, -1.816, -0.024 ], [ 0.676, 1.152, 0.916 ], [ 0.048, 1.568, 0.216 ], ... ],
    	...
    ]
    [
    	[ [ 0.22, 1.304, 1.48 ], [ 1.848, -0.068, -0.94 ], [ 0.82, -0.504, -1.42 ], [ 1.212, 1.576, 0.908 ], [ 0.116, 1.908, 1.392 ], [ -1.236, -0.156, -1.692 ], [ 0.824, -0.428, -1.172 ], [ -0.728, -0.624, -1.92 ], ... ],
    	[ [ -1.84, 0.16, -0.676 ], [ -0.292, -1.772, 0.82 ], [ -1.64, -1.304, 0.456 ], [ -1.472, -0.956, 0.564 ], [ -0.112, -0.58, -1.368 ], [ -0.324, -1.72, -0.292 ], [ 0.856, -0.984, 0.632 ], [ 0.584, -1.1, 1.028 ], ... ],
    	[ [ 0.588, 0.316, 0.276 ], [ 0.28, -1.452, 1.348 ], [ 1.796, 1.528, -0.828 ], [ 0.496, 1.528, 1.98 ], [ -0.848, 1.58, -1.648 ], [ -1.62, -0.848, -0.62 ], [ -1.756, -1.792, -0.24 ], [ -1.008, -1.804, -1.652 ], ... ],
    	[ [ -0.052, -1.088, -0.892 ], [ -0.12, -1.412, 1.088 ], [ -1.636, -0.704, -1.084 ], [ -0.104, 1.976, 1.492 ], [ 0.384, -0.16, -1.872 ], [ -1.06, 0.64, 1.428 ], [ -0.408, 0.352, 1.156 ], [ 0.556, -1.636, -1.132 ], ... ],
    	[ [ -1.616, 0.252, -0.092 ], [ 0.42, -1.72, -1.772 ], [ -0.532, 1.616, 0.672 ], [ 1.924, -0.008, -0.016 ], [ 0.672, 0.084, -0.384 ], [ -1.964, -0.72, 1.54 ], [ 1.084, -0.524, -1.56 ], [ 0.48, 1.688, 1.184 ], ... ],
    	[ [ 0.856, 0.468, 0.116 ], [ -1.712, -0.336, -1.868 ], [ -1.404, 1.916, 1.52 ], [ 1.136, -0.664, -0.916 ], [ -1.084, 1.156, -0.22 ], [ -1.88, -1.312, 0.204 ], [ -1.756, 0.84, -1.824 ], [ 0.168, -0.268, 0.384 ], ... ],
    	[ [ -0.244, -1.836, -0.184 ], [ 0.688, -1.0, 0.076 ], [ 0.272, 1.792, 1.632 ], [ 0.232, 1.392, 0.444 ], [ 0.384, 1.936, -0.912 ], [ -1.212, -0.696, 1.752 ], [ -0.784, 0.26, -0.72 ], [ 0.22, -0.812, -0.552 ], ... ],
    	[ [ -1.112, 0.184, -1.02 ], [ -0.46, -1.48, -0.776 ], [ 0.104, -1.516, 1.888 ], [ -1.236, 1.34, -0.288 ], [ -1.22, 1.996, 0.384 ], [ -0.884, 1.176, 1.44 ], [ 1.444, -0.868, 1.836 ], [ 1.016, -0.652, -1.312 ], ... ],
    	...
    ]
    [
    	[ [ -1.396, -0.688, -1.9 ], [ 1.9, -1.732, 0.984 ], [ -0.516, 0.448, -1.32 ], [ 1.336, 1.816, -1.184 ], [ -0.208, -1.588, 1.016 ], [ -1.972, 0.016, -0.552 ], [ 0.06, -0.568, 0.728 ], [ -1.468, 1.624, -0.012 ], ... ],
    	[ [ -1.496, -1.632, 1.8 ], [ -0.812, -0.848, -0.336 ], [ -0.012, 0.04, -1.156 ], [ -0.072, 1.264, 1.956 ], [ 0.696, 1.388, 0.536 ], [ 1.8, -0.76, 1.168 ], [ 1.4, 0.264, -0.452 ], [ -1.048, 1.512, 0.444 ], ... ],
    	[ [ 0.368, 0.952, 0.128 ], [ 1.26, 1.952, 0.22 ], [ 1.956, 0.56, 0.636 ], [ -0.032, -1.456, -1.456 ], [ -1.14, -0.788, -1.596 ], [ 0.876, -1.912, 1.312 ], [ 1.912, 1.268, 0.44 ], [ 1.276, -1.536, 1.912 ], ... ],
    	[ [ 1.112, -1.316, -0.36 ], [ -0.812, 0.1, 0.216 ], [ 1.188, -1.704, 1.32 ], [ -0.532, 1.116, -0.472 ], [ 0.568, 0.424, 0.268 ], [ -0.504, 1.224, -1.348 ], [ 1.028, 0.676, -0.196 ], [ -1.736, 1.924, 0.56 ], ... ],
    	[ [ -1.952, -0.528, -0.38 ], [ 1.5, -1.196, 1.388 ], [ -0.92, -1.724, -1.396 ], [ -1.784, 0.632, -0.792 ], [ 0.412, -0.208, 0.484 ], [ 1.908, 1.608, -0.088 ], [ 0.56, 0.26, 0.672 ], [ -1.048, -0.904, -0.056 ], ... ],
    	[ [ -1.552, -1.164, -0.82 ], [ -0.276, -1.32, 0.768 ], [ -0.692, 1.716, 0.68 ], [ -1.016, 1.112, 0.076 ], [ -0.736, -0.492, -1.988 ], [ 0.328, -1.688, 1.952 ], [ 1.736, 1.032, -0.532 ], [ -0.204, 1.736, -0.396 ], ... ],
    	[ [ -1.212, 0.776, -1.004 ], [ -1.532, 0.508, -1.288 ], [ 0.156, 0.312, -1.004 ], [ -1.856, -1.44, 1.308 ], [ 0.844, -0.516, 0.344 ], [ 0.976, -0.132, 0.888 ], [ -0.268, 1.1, -1.248 ], [ -1.108, 1.708, -1.028 ], ... ],
    	[ [ 0.72, -0.808, -0.948 ], [ 0.584, -0.616, -1.74 ], [ 1.752, 1.444, -1.944 ], [ -1.656, 1.212, 0.264 ], [ -0.272, 1.844, 1.072 ], [ -1.108, 0.104, -0.58 ], [ 1.172, -0.136, 1.48 ], [ 0.48, -1.328, 1.132 ], ... ],
    	...
    ]

Gradient Descent

First, we train using basic gradient descent method apply weak line search conditions.

TrainingTester.java:480 executed in 0.15 seconds (0.000 gc):

    IterativeTrainer iterativeTrainer = new IterativeTrainer(trainable.addRef());
    try {
      iterativeTrainer.setLineSearchFactory(label -> new ArmijoWolfeSearch());
      iterativeTrainer.setOrientation(new GradientDescent());
      iterativeTrainer.setMonitor(TrainingTester.getMonitor(history));
      iterativeTrainer.setTimeout(30, TimeUnit.SECONDS);
      iterativeTrainer.setMaxIterations(250);
      iterativeTrainer.setTerminateThreshold(0);
      return iterativeTrainer.run();
    } finally {
      iterativeTrainer.freeRef();
    }
Logging
Reset training subject: 224439685310
BACKPROP_AGG_SIZE = 3
THREADS = 64
SINGLE_THREADED = false
Initialized CoreSettings = {
"backpropAggregationSize" : 3,
"jvmThreads" : 64,
"singleThreaded" : false
}
Final threshold in iteration 0: 0.0 (> 0.0) after 0.139s (< 30.000s)

Returns

    0.0

This training apply resulted in the following configuration:

TrainingTester.java:610 executed in 0.00 seconds (0.000 gc):

    RefList<double[]> state = network.state();
    assert state != null;
    String description = state.stream().map(RefArrays::toString).reduce((a, b) -> a + "\n" + b)
        .orElse("");
    state.freeRef();
    return description;

Returns

    

And regressed input:

TrainingTester.java:622 executed in 0.01 seconds (0.000 gc):

    return RefArrays.stream(RefUtil.addRef(data)).flatMap(x -> {
      return RefArrays.stream(x);
    }).limit(1).map(x -> {
      String temp_18_0015 = x.prettyPrint();
      x.freeRef();
      return temp_18_0015;
    }).reduce((a, b) -> a + "\n" + b).orElse("");

Returns

    [
    	[ [ 1.604, 0.376, -0.296 ], [ 0.268, -1.556, -0.4 ], [ -1.128, -0.404, -0.708 ], [ 0.748, -0.748, 0.22 ], [ 0.612, -0.84, -0.16 ], [ -0.18, -0.584, -1.14 ], [ 0.48, -1.328, 1.972 ], [ -1.116, 1.528, -1.092 ], ... ],
    	[ [ -1.008, -0.336, 1.376 ], [ 1.836, -0.576, -0.244 ], [ -1.892, 1.992, -1.592 ], [ 0.524, 0.344, 0.712 ], [ -0.636, 0.656, -1.852 ], [ -0.632, 0.724, 0.424 ], [ 1.512, 0.38, 1.252 ], [ -1.772, -1.808, -1.492 ], ... ],
    	[ [ -0.348, 0.764, -0.836 ], [ 1.208, -0.312, -0.272 ], [ 1.136, 0.8, 0.456 ], [ -0.324, -0.364, -1.856 ], [ -0.128, -0.588, 1.168 ], [ -1.748, -0.352, 1.156 ], [ -1.92, -0.6, -0.184 ], [ -0.348, 1.616, 0.056 ], ... ],
    	[ [ -0.632, 1.384, 0.312 ], [ 0.78, -1.244, 0.352 ], [ 0.876, 0.788, 1.528 ], [ 1.88, 0.792, 1.564 ], [ 1.612, 0.736, -0.52 ], [ 0.016, 0.724, -1.0 ], [ -0.372, -1.008, 0.5 ], [ -1.164, 1.02, 0.628 ], ... ],
    	[ [ 0.048, -1.228, -0.72 ], [ -1.268, 0.564, 1.768 ], [ -0.236, 1.136, -0.184 ], [ 0.508, 1.916, 1.16 ], [ -0.912, 1.292, 1.504 ], [ 0.756, 1.004, 0.076 ], [ -1.688, 0.36, 1.776 ], [ -1.072, -1.476, -0.424 ], ... ],
    	[ [ -0.788, 0.66, 0.416 ], [ 0.52, -0.048, 1.364 ], [ -0.796, -1.116, -1.26 ], [ 0.112, 1.5, -0.856 ], [ 1.772, -1.464, -1.212 ], [ 0.348, -0.42, -1.244 ], [ 0.232, -0.308, -1.312 ], [ -1.764, -1.576, -1.572 ], ... ],
    	[ [ 0.42, -1.992, -1.624 ], [ 0.112, 0.128, -1.64 ], [ -0.596, 1.58, 1.844 ], [ 1.636, 0.272, -1.552 ], [ 0.312, 0.496, 0.82 ], [ 0.488, 1.108, -0.692 ], [ 1.36, 1.864, -1.32 ], [ 0.604, 1.016, 0.148 ], ... ],
    	[ [ -1.704, -0.84, -1.74 ], [ -0.42, -1.812, -0.836 ], [ 1.928, -1.244, 1.804 ], [ -1.912, -1.872, -1.916 ], [ 0.84, 0.348, 0.488 ], [ 1.42, 1.456, 0.636 ], [ 1.624, -0.204, -1.268 ], [ -0.164, -1.864, -0.868 ], ... ],
    	...
    ]

To produce the following output:

TrainingTester.java:633 executed in 0.00 seconds (0.000 gc):

    Result[] array = ConstantResult.batchResultArray(pop(RefUtil.addRef(data)));
    @Nullable
    Result eval = layer.eval(array);
    assert eval != null;
    TensorList tensorList = Result.getData(eval);
    String temp_18_0016 = tensorList.stream().limit(1).map(x -> {
      String temp_18_0017 = x.prettyPrint();
      x.freeRef();
      return temp_18_0017;
    }).reduce((a, b) -> a + "\n" + b).orElse("");
    tensorList.freeRef();
    return temp_18_0016;

Returns

    [ 210.48400000000146 ]

Conjugate Gradient Descent

First, we use a conjugate gradient descent method, which converges the fastest for purely linear functions.

TrainingTester.java:452 executed in 0.24 seconds (0.000 gc):

    IterativeTrainer iterativeTrainer = new IterativeTrainer(trainable.addRef());
    try {
      iterativeTrainer.setLineSearchFactory(label -> new QuadraticSearch());
      iterativeTrainer.setOrientation(new GradientDescent());
      iterativeTrainer.setMonitor(TrainingTester.getMonitor(history));
      iterativeTrainer.setTimeout(30, TimeUnit.SECONDS);
      iterativeTrainer.setMaxIterations(250);
      iterativeTrainer.setTerminateThreshold(0);
      return iterativeTrainer.run();
    } finally {
      iterativeTrainer.freeRef();
    }
Logging
Reset training subject: 224605582014
Final threshold in iteration 0: 0.0 (> 0.0) after 0.241s (< 30.000s)

Returns

    0.0

This training apply resulted in the following configuration:

TrainingTester.java:610 executed in 0.00 seconds (0.000 gc):

    RefList<double[]> state = network.state();
    assert state != null;
    String description = state.stream().map(RefArrays::toString).reduce((a, b) -> a + "\n" + b)
        .orElse("");
    state.freeRef();
    return description;

Returns

    

And regressed input:

TrainingTester.java:622 executed in 0.00 seconds (0.000 gc):

    return RefArrays.stream(RefUtil.addRef(data)).flatMap(x -> {
      return RefArrays.stream(x);
    }).limit(1).map(x -> {
      String temp_18_0015 = x.prettyPrint();
      x.freeRef();
      return temp_18_0015;
    }).reduce((a, b) -> a + "\n" + b).orElse("");

Returns

    [
    	[ [ 1.604, 0.376, -0.296 ], [ 0.268, -1.556, -0.4 ], [ -1.128, -0.404, -0.708 ], [ 0.748, -0.748, 0.22 ], [ 0.612, -0.84, -0.16 ], [ -0.18, -0.584, -1.14 ], [ 0.48, -1.328, 1.972 ], [ -1.116, 1.528, -1.092 ], ... ],
    	[ [ -1.008, -0.336, 1.376 ], [ 1.836, -0.576, -0.244 ], [ -1.892, 1.992, -1.592 ], [ 0.524, 0.344, 0.712 ], [ -0.636, 0.656, -1.852 ], [ -0.632, 0.724, 0.424 ], [ 1.512, 0.38, 1.252 ], [ -1.772, -1.808, -1.492 ], ... ],
    	[ [ -0.348, 0.764, -0.836 ], [ 1.208, -0.312, -0.272 ], [ 1.136, 0.8, 0.456 ], [ -0.324, -0.364, -1.856 ], [ -0.128, -0.588, 1.168 ], [ -1.748, -0.352, 1.156 ], [ -1.92, -0.6, -0.184 ], [ -0.348, 1.616, 0.056 ], ... ],
    	[ [ -0.632, 1.384, 0.312 ], [ 0.78, -1.244, 0.352 ], [ 0.876, 0.788, 1.528 ], [ 1.88, 0.792, 1.564 ], [ 1.612, 0.736, -0.52 ], [ 0.016, 0.724, -1.0 ], [ -0.372, -1.008, 0.5 ], [ -1.164, 1.02, 0.628 ], ... ],
    	[ [ 0.048, -1.228, -0.72 ], [ -1.268, 0.564, 1.768 ], [ -0.236, 1.136, -0.184 ], [ 0.508, 1.916, 1.16 ], [ -0.912, 1.292, 1.504 ], [ 0.756, 1.004, 0.076 ], [ -1.688, 0.36, 1.776 ], [ -1.072, -1.476, -0.424 ], ... ],
    	[ [ -0.788, 0.66, 0.416 ], [ 0.52, -0.048, 1.364 ], [ -0.796, -1.116, -1.26 ], [ 0.112, 1.5, -0.856 ], [ 1.772, -1.464, -1.212 ], [ 0.348, -0.42, -1.244 ], [ 0.232, -0.308, -1.312 ], [ -1.764, -1.576, -1.572 ], ... ],
    	[ [ 0.42, -1.992, -1.624 ], [ 0.112, 0.128, -1.64 ], [ -0.596, 1.58, 1.844 ], [ 1.636, 0.272, -1.552 ], [ 0.312, 0.496, 0.82 ], [ 0.488, 1.108, -0.692 ], [ 1.36, 1.864, -1.32 ], [ 0.604, 1.016, 0.148 ], ... ],
    	[ [ -1.704, -0.84, -1.74 ], [ -0.42, -1.812, -0.836 ], [ 1.928, -1.244, 1.804 ], [ -1.912, -1.872, -1.916 ], [ 0.84, 0.348, 0.488 ], [ 1.42, 1.456, 0.636 ], [ 1.624, -0.204, -1.268 ], [ -0.164, -1.864, -0.868 ], ... ],
    	...
    ]

To produce the following output:

TrainingTester.java:633 executed in 0.00 seconds (0.000 gc):

    Result[] array = ConstantResult.batchResultArray(pop(RefUtil.addRef(data)));
    @Nullable
    Result eval = layer.eval(array);
    assert eval != null;
    TensorList tensorList = Result.getData(eval);
    String temp_18_0016 = tensorList.stream().limit(1).map(x -> {
      String temp_18_0017 = x.prettyPrint();
      x.freeRef();
      return temp_18_0017;
    }).reduce((a, b) -> a + "\n" + b).orElse("");
    tensorList.freeRef();
    return temp_18_0016;

Returns

    [ 210.48400000000146 ]

Limited-Memory BFGS

Next, we apply the same optimization using L-BFGS, which is nearly ideal for purely second-order or quadratic functions.

TrainingTester.java:509 executed in 0.04 seconds (0.000 gc):

    IterativeTrainer iterativeTrainer = new IterativeTrainer(trainable.addRef());
    try {
      iterativeTrainer.setLineSearchFactory(label -> new ArmijoWolfeSearch());
      iterativeTrainer.setOrientation(new LBFGS());
      iterativeTrainer.setMonitor(TrainingTester.getMonitor(history));
      iterativeTrainer.setTimeout(30, TimeUnit.SECONDS);
      iterativeTrainer.setIterationsPerSample(100);
      iterativeTrainer.setMaxIterations(250);
      iterativeTrainer.setTerminateThreshold(0);
      return iterativeTrainer.run();
    } finally {
      iterativeTrainer.freeRef();
    }
Logging
Reset training subject: 224864645537
Final threshold in iteration 0: 0.0 (> 0.0) after 0.041s (< 30.000s)

Returns

    0.0

This training apply resulted in the following configuration:

TrainingTester.java:610 executed in 0.00 seconds (0.000 gc):

    RefList<double[]> state = network.state();
    assert state != null;
    String description = state.stream().map(RefArrays::toString).reduce((a, b) -> a + "\n" + b)
        .orElse("");
    state.freeRef();
    return description;

Returns

    

And regressed input:

TrainingTester.java:622 executed in 0.00 seconds (0.000 gc):

    return RefArrays.stream(RefUtil.addRef(data)).flatMap(x -> {
      return RefArrays.stream(x);
    }).limit(1).map(x -> {
      String temp_18_0015 = x.prettyPrint();
      x.freeRef();
      return temp_18_0015;
    }).reduce((a, b) -> a + "\n" + b).orElse("");

Returns

    [
    	[ [ 1.604, 0.376, -0.296 ], [ 0.268, -1.556, -0.4 ], [ -1.128, -0.404, -0.708 ], [ 0.748, -0.748, 0.22 ], [ 0.612, -0.84, -0.16 ], [ -0.18, -0.584, -1.14 ], [ 0.48, -1.328, 1.972 ], [ -1.116, 1.528, -1.092 ], ... ],
    	[ [ -1.008, -0.336, 1.376 ], [ 1.836, -0.576, -0.244 ], [ -1.892, 1.992, -1.592 ], [ 0.524, 0.344, 0.712 ], [ -0.636, 0.656, -1.852 ], [ -0.632, 0.724, 0.424 ], [ 1.512, 0.38, 1.252 ], [ -1.772, -1.808, -1.492 ], ... ],
    	[ [ -0.348, 0.764, -0.836 ], [ 1.208, -0.312, -0.272 ], [ 1.136, 0.8, 0.456 ], [ -0.324, -0.364, -1.856 ], [ -0.128, -0.588, 1.168 ], [ -1.748, -0.352, 1.156 ], [ -1.92, -0.6, -0.184 ], [ -0.348, 1.616, 0.056 ], ... ],
    	[ [ -0.632, 1.384, 0.312 ], [ 0.78, -1.244, 0.352 ], [ 0.876, 0.788, 1.528 ], [ 1.88, 0.792, 1.564 ], [ 1.612, 0.736, -0.52 ], [ 0.016, 0.724, -1.0 ], [ -0.372, -1.008, 0.5 ], [ -1.164, 1.02, 0.628 ], ... ],
    	[ [ 0.048, -1.228, -0.72 ], [ -1.268, 0.564, 1.768 ], [ -0.236, 1.136, -0.184 ], [ 0.508, 1.916, 1.16 ], [ -0.912, 1.292, 1.504 ], [ 0.756, 1.004, 0.076 ], [ -1.688, 0.36, 1.776 ], [ -1.072, -1.476, -0.424 ], ... ],
    	[ [ -0.788, 0.66, 0.416 ], [ 0.52, -0.048, 1.364 ], [ -0.796, -1.116, -1.26 ], [ 0.112, 1.5, -0.856 ], [ 1.772, -1.464, -1.212 ], [ 0.348, -0.42, -1.244 ], [ 0.232, -0.308, -1.312 ], [ -1.764, -1.576, -1.572 ], ... ],
    	[ [ 0.42, -1.992, -1.624 ], [ 0.112, 0.128, -1.64 ], [ -0.596, 1.58, 1.844 ], [ 1.636, 0.272, -1.552 ], [ 0.312, 0.496, 0.82 ], [ 0.488, 1.108, -0.692 ], [ 1.36, 1.864, -1.32 ], [ 0.604, 1.016, 0.148 ], ... ],
    	[ [ -1.704, -0.84, -1.74 ], [ -0.42, -1.812, -0.836 ], [ 1.928, -1.244, 1.804 ], [ -1.912, -1.872, -1.916 ], [ 0.84, 0.348, 0.488 ], [ 1.42, 1.456, 0.636 ], [ 1.624, -0.204, -1.268 ], [ -0.164, -1.864, -0.868 ], ... ],
    	...
    ]

To produce the following output:

TrainingTester.java:633 executed in 0.00 seconds (0.000 gc):

    Result[] array = ConstantResult.batchResultArray(pop(RefUtil.addRef(data)));
    @Nullable
    Result eval = layer.eval(array);
    assert eval != null;
    TensorList tensorList = Result.getData(eval);
    String temp_18_0016 = tensorList.stream().limit(1).map(x -> {
      String temp_18_0017 = x.prettyPrint();
      x.freeRef();
      return temp_18_0017;
    }).reduce((a, b) -> a + "\n" + b).orElse("");
    tensorList.freeRef();
    return temp_18_0016;

Returns

    [ 210.48400000000146 ]

TrainingTester.java:432 executed in 0.01 seconds (0.000 gc):

    return TestUtil.compare(title + " vs Iteration", runs);
Logging
No Data

TrainingTester.java:435 executed in 0.00 seconds (0.000 gc):

    return TestUtil.compareTime(title + " vs Time", runs);
Logging
No Data

Results

TrainingTester.java:255 executed in 0.21 seconds (0.000 gc):

    return grid(inputLearning, modelLearning, completeLearning);

Returns

Result

TrainingTester.java:258 executed in 0.00 seconds (0.000 gc):

    return new ComponentResult(null == inputLearning ? null : inputLearning.value,
        null == modelLearning ? null : modelLearning.value, null == completeLearning ? null : completeLearning.value);

Returns

    {"input":{ "LBFGS": { "type": "NonConverged", "value": NaN }, "CjGD": { "type": "NonConverged", "value": NaN }, "GD": { "type": "NonConverged", "value": NaN } }, "model":null, "complete":null}

LayerTests.java:425 executed in 0.00 seconds (0.000 gc):

    throwException(exceptions.addRef());

Results

detailsresult
{"input":{ "LBFGS": { "type": "NonConverged", "value": NaN }, "CjGD": { "type": "NonConverged", "value": NaN }, "GD": { "type": "NonConverged", "value": NaN } }, "model":null, "complete":null}OK
  {
    "result": "OK",
    "performance": {
      "execution_time": "1.317",
      "gc_time": "0.167"
    },
    "created_on": 1586734812155,
    "file_name": "trainingTest",
    "report": {
      "simpleName": "Basic",
      "canonicalName": "com.simiacryptus.mindseye.layers.java.SumReducerLayerTest.Basic",
      "link": "https://github.com/SimiaCryptus/mindseye-java/tree/93db34cedee48c0202777a2b25deddf1dfaf5731/src/test/java/com/simiacryptus/mindseye/layers/java/SumReducerLayerTest.java",
      "javaDoc": ""
    },
    "training_analysis": {
      "input": {
        "LBFGS": {
          "type": "NonConverged",
          "value": "NaN"
        },
        "CjGD": {
          "type": "NonConverged",
          "value": "NaN"
        },
        "GD": {
          "type": "NonConverged",
          "value": "NaN"
        }
      }
    },
    "archive": "s3://code.simiacrypt.us/tests/com/simiacryptus/mindseye/layers/java/SumReducerLayer/Basic/trainingTest/202004124012",
    "id": "7dd953ce-cba8-44dc-becf-4c89924a765e",
    "report_type": "Components",
    "display_name": "Comparative Training",
    "target": {
      "simpleName": "SumReducerLayer",
      "canonicalName": "com.simiacryptus.mindseye.layers.java.SumReducerLayer",
      "link": "https://github.com/SimiaCryptus/mindseye-java/tree/93db34cedee48c0202777a2b25deddf1dfaf5731/src/main/java/com/simiacryptus/mindseye/layers/java/SumReducerLayer.java",
      "javaDoc": ""
    }
  }