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 8262307386242506752

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.05 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.068, -1.024, -0.408 ], [ -0.56, 0.74, -0.136 ], [ -0.42, 0.048, 1.976 ], [ 0.188, 0.3, 1.388 ], [ -1.12, -0.324, 1.492 ], [ 1.22, -0.668, -0.364 ], [ -1.828, 0.896, -1.156 ], [ 1.1, -0.316, 0.696 ], ... ],
    	[ [ -0.124, 0.656, 0.844 ], [ -0.336, 1.044, -0.416 ], [ -1.044, 1.528, 1.148 ], [ -1.2, -1.716, 0.136 ], [ -0.192, 1.428, 1.828 ], [ -1.82, 0.472, 0.34 ], [ -1.136, 0.304, -0.952 ], [ 1.3, 1.332, -0.388 ], ... ],
    	[ [ -1.336, 1.724, -0.484 ], [ 0.288, -0.856, -0.508 ], [ -1.184, -0.528, -1.452 ], [ -0.304, 0.624, -1.16 ], [ -0.264, -1.128, 0.248 ], [ 1.232, -1.712, 0.852 ], [ 1.052, 0.376, -0.392 ], [ 0.7, -1.108, 0.644 ], ... ],
    	[ [ 1.012, 0.248, -0.296 ], [ 0.344, -0.652, 1.94 ], [ -1.284, -0.896, -0.804 ], [ 0.48, -1.996, 0.572 ], [ 0.992, -1.632, 0.612 ], [ 0.3, -1.692, -0.232 ], [ -1.192, 0.976, -1.02 ], [ 0.904, -0.716, -1.716 ], ... ],
    	[ [ 0.268, 1.736, -1.128 ], [ -0.492, -0.624, -1.932 ], [ 0.532, 0.6, -1.612 ], [ -0.344, -1.192, 1.408 ], [ -0.608, -1.672, 1.684 ], [ 1.516, 1.868, -1.02 ], [ -1.672, 0.904, -1.784 ], [ -0.904, -0.744, 1.46 ], ... ],
    	[ [ -0.404, 0.024, 0.376 ], [ 1.196, -1.72, 1.216 ], [ -0.32, 1.356, -1.016 ], [ -0.924, 1.168, 1.124 ], [ -1.792, 1.536, 1.432 ], [ -0.636, 0.876, -0.864 ], [ -0.504, 1.344, -1.288 ], [ 0.548, -1.516, 1.964 ], ... ],
    	[ [ -1.468, -0.66, 0.472 ], [ 1.248, 0.796, -0.448 ], [ 0.812, -1.136, -0.704 ], [ 1.704, 0.352, 1.956 ], [ -1.668, -0.98, 1.16 ], [ -0.876, -1.704, 1.712 ], [ 0.716, 1.704, 0.448 ], [ -0.468, -1.184, 0.672 ], ... ],
    	[ [ -1.82, 0.94, 0.68 ], [ 1.276, -1.932, 0.168 ], [ 1.008, -1.412, 0.428 ], [ -1.372, -0.468, -1.144 ], [ 1.208, -0.556, 0.524 ], [ 1.924, 1.704, 0.176 ], [ 1.82, -0.476, 1.376 ], [ -0.416, -0.02, 1.272 ], ... ],
    	...
    ]
    [
    	[ [ -0.764, -1.836, 1.824 ], [ 0.832, 0.824, -0.48 ], [ 0.332, 0.936, 1.656 ], [ 1.896, -1.364, -0.668 ], [ -0.348, 1.18, -0.988 ], [ -0.388, -1.12, 1.952 ], [ 1.62, -0.232, -0.076 ], [ 1.628, -1.584, -0.672 ], ... ],
    	[ [ -0.12, 1.468, -1.592 ], [ -0.272, 0.768, 1.648 ], [ 1.572, -1.872, -0.004 ], [ 0.932, -0.136, 1.428 ], [ -0.712, -1.744, 1.508 ], [ 0.48, 0.496, -0.06 ], [ -0.124, 1.98, 1.008 ], [ 0.18, 0.024, 0.732 ], ... ],
    	[ [ -0.192, 0.816, -1.7 ], [ 1.668, -0.476, 0.348 ], [ -1.804, 1.304, -0.564 ], [ 0.068, -0.736, 0.868 ], [ 0.512, -0.34, 1.14 ], [ 1.612, 0.564, 0.716 ], [ 0.976, 0.004, -0.104 ], [ -0.864, -0.428, -1.74 ], ... ],
    	[ [ -1.252, -0.744, 1.576 ], [ 1.704, 1.368, -0.16 ], [ -0.592, -0.34, 1.636 ], [ 1.704, 0.144, 1.292 ], [ 1.992, 1.424, 0.036 ], [ -0.616, -1.568, 0.568 ], [ 1.768, 1.856, 1.088 ], [ 0.848, -0.436, -0.888 ], ... ],
    	[ [ -1.568, -0.968, 0.896 ], [ 0.424, -0.688, -1.036 ], [ 0.904, 0.532, -1.08 ], [ -1.244, 1.6, -1.776 ], [ -1.44, 1.6, 1.368 ], [ -0.236, -0.812, 0.976 ], [ -0.468, 1.636, -0.66 ], [ -1.352, -2.0, -0.216 ], ... ],
    	[ [ -1.436, -1.636, -0.212 ], [ 1.3, 1.508, 1.448 ], [ -1.296, -1.276, -1.668 ], [ -0.196, 0.324, 0.328 ], [ 1.816, -0.24, -0.376 ], [ -1.056, -0.504, -1.316 ], [ -0.584, -1.716, 0.388 ], [ 0.564, 0.164, -1.928 ], ... ],
    	[ [ -1.012, -0.008, -0.508 ], [ -1.64, -1.824, 1.836 ], [ 0.848, -1.676, 1.264 ], [ -0.676, -1.044, -1.304 ], [ 0.388, 0.844, 0.912 ], [ -1.12, 1.328, 0.596 ], [ -0.588, 0.132, 0.036 ], [ 0.904, 1.724, -0.652 ], ... ],
    	[ [ 1.672, 1.456, -0.656 ], [ 1.28, -1.62, 1.112 ], [ -1.988, 0.556, 1.86 ], [ -1.696, 1.932, -0.524 ], [ -0.716, -0.188, -1.504 ], [ -1.872, -0.196, 1.86 ], [ -0.008, 1.708, -1.38 ], [ -0.94, 1.048, 1.032 ], ... ],
    	...
    ]
    [
    	[ [ 1.44, -0.508, -0.088 ], [ 1.972, 0.728, -0.632 ], [ 1.18, 1.052, 1.432 ], [ 0.88, -1.772, -0.216 ], [ -1.148, 1.072, -0.656 ], [ -0.956, -1.896, -1.304 ], [ 1.704, -0.488, 0.036 ], [ 1.488, -1.26, 0.008 ], ... ],
    	[ [ -1.908, 1.044, -1.808 ], [ -0.24, -1.412, 1.536 ], [ 1.756, 0.888, 1.744 ], [ 1.324, -0.648, -1.396 ], [ -1.428, -1.328, 1.176 ], [ -1.132, 0.8, -1.056 ], [ 0.424, 0.144, -0.428 ], [ -1.64, 0.376, -0.028 ], ... ],
    	[ [ 1.672, -1.528, -1.824 ], [ 1.308, 1.432, 0.96 ], [ 1.524, 0.044, -0.032 ], [ 1.04, -0.604, 1.736 ], [ 1.124, 0.772, 1.124 ], [ 0.336, -0.736, -1.212 ], [ 1.528, 1.388, -0.276 ], [ -1.82, -0.336, 1.244 ], ... ],
    	[ [ 0.28, -1.476, -1.456 ], [ 1.304, -0.264, -1.016 ], [ -1.108, -1.612, -1.916 ], [ 1.992, 0.652, -1.808 ], [ -1.92, 1.256, -1.444 ], [ 1.068, -1.784, 0.06 ], [ -0.78, 0.332, 1.188 ], [ -0.944, 0.536, -0.88 ], ... ],
    	[ [ 1.596, -0.424, 1.368 ], [ 0.212, 0.384, 1.636 ], [ 0.012, 1.464, -0.924 ], [ 1.584, 0.832, -1.772 ], [ 1.664, -1.568, 1.664 ], [ -1.944, 1.968, 0.092 ], [ 1.684, -0.06, -0.268 ], [ 1.172, 0.472, -0.552 ], ... ],
    	[ [ -0.112, -1.308, 1.328 ], [ -1.76, -0.504, -1.892 ], [ -1.352, 1.428, 1.964 ], [ 0.256, -1.236, 1.044 ], [ -0.988, 1.868, -1.836 ], [ 0.696, 0.884, 0.624 ], [ -0.74, 0.748, -0.208 ], [ 1.672, 1.092, -1.484 ], ... ],
    	[ [ -1.932, 1.46, -1.836 ], [ -0.072, -0.76, 0.172 ], [ 1.26, -1.42, -1.352 ], [ 0.876, 0.708, -0.444 ], [ 1.028, -0.156, 0.376 ], [ -0.48, -0.176, -1.652 ], [ 0.168, -1.78, 1.148 ], [ 1.34, 0.468, -1.564 ], ... ],
    	[ [ 1.832, 0.812, -0.856 ], [ -0.504, 1.184, -0.888 ], [ -0.116, -0.176, 0.9 ], [ -0.432, -0.992, 1.312 ], [ 1.724, -1.46, 0.824 ], [ -1.56, 0.692, -0.372 ], [ 0.688, -1.208, 0.188 ], [ 0.364, -0.64, -1.0 ], ... ],
    	...
    ]
    [
    	[ [ -1.928, -0.528, 1.576 ], [ -1.42, -0.372, -0.14 ], [ -0.556, 1.596, -1.032 ], [ -0.064, -1.384, -0.328 ], [ 1.136, 0.06, -0.008 ], [ 0.112, -0.608, 1.612 ], [ 0.152, 0.936, 1.652 ], [ -0.6, 1.852, 2.0 ], ... ],
    	[ [ -0.956, 0.6, 1.484 ], [ -0.808, -1.884, 1.316 ], [ -0.572, -1.448, 0.72 ], [ 0.852, -0.384, 0.636 ], [ 1.344, -1.964, -0.196 ], [ -0.32, -0.036, 0.016 ], [ 1.168, -1.336, -1.46 ], [ 1.456, -0.644, -0.788 ], ... ],
    	[ [ 0.436, -1.524, 1.196 ], [ -1.992, -0.828, -1.892 ], [ 1.464, -1.16, 1.668 ], [ 1.988, 0.76, -1.748 ], [ 1.408, -0.564, 0.164 ], [ -1.58, -0.528, -1.184 ], [ 1.164, 1.756, -1.184 ], [ 1.856, -0.576, -1.264 ], ... ],
    	[ [ 0.76, -1.488, 0.676 ], [ -1.952, 1.864, 0.136 ], [ 0.692, -0.476, -1.58 ], [ -0.724, 1.672, 1.02 ], [ 1.476, 0.456, -0.364 ], [ 1.476, 1.844, 1.052 ], [ -1.324, 1.38, 0.876 ], [ 0.4, 1.572, 0.38 ], ... ],
    	[ [ -1.56, 0.832, -1.152 ], [ -1.24, 1.56, -0.184 ], [ 0.956, 0.636, -1.436 ], [ 0.436, 0.824, 1.52 ], [ -1.332, -0.008, -1.508 ], [ -1.172, -1.316, -1.144 ], [ 1.856, 0.308, -0.052 ], [ -0.476, 0.44, -1.768 ], ... ],
    	[ [ 1.428, 0.72, 0.336 ], [ 0.376, -0.696, 1.648 ], [ 0.764, 1.564, 0.288 ], [ 0.664, -1.976, 0.092 ], [ 1.904, -0.108, 0.136 ], [ 0.308, -1.644, 0.024 ], [ 1.572, 0.908, -0.576 ], [ -0.54, 0.952, -0.036 ], ... ],
    	[ [ 1.096, 0.28, -0.896 ], [ 1.828, 1.116, -0.864 ], [ -0.568, 0.744, -0.804 ], [ 0.036, -1.116, -1.804 ], [ 0.072, -1.908, 1.728 ], [ -0.792, -1.604, 0.952 ], [ -1.032, 1.032, 1.62 ], [ 1.488, 1.4, -0.524 ], ... ],
    	[ [ 1.14, 1.008, 0.772 ], [ -1.972, 0.116, -0.172 ], [ 1.02, 1.672, -1.788 ], [ 1.028, 1.308, 1.792 ], [ 0.908, -1.908, -1.724 ], [ 1.328, -1.444, -1.464 ], [ 0.46, 0.024, -1.568 ], [ -1.368, 0.372, -1.24 ], ... ],
    	...
    ]
    [
    	[ [ 1.916, 0.788, -0.756 ], [ -0.54, 1.896, 1.368 ], [ 0.872, 1.64, -1.508 ], [ 0.72, 1.768, 0.452 ], [ 1.004, -1.588, -1.508 ], [ 0.572, -1.732, -1.912 ], [ 0.068, 1.888, 0.528 ], [ 1.484, 0.24, 0.56 ], ... ],
    	[ [ -0.488, -1.596, 0.676 ], [ -0.908, 1.48, -0.112 ], [ -1.804, 0.192, -0.336 ], [ 1.184, -0.38, 1.036 ], [ 1.256, -1.504, 1.02 ], [ -1.436, 1.284, 1.504 ], [ -1.796, 1.536, 0.408 ], [ 1.596, 1.216, -0.064 ], ... ],
    	[ [ -0.324, 0.68, 0.98 ], [ 0.64, -1.0, 0.832 ], [ -1.78, -1.552, -1.132 ], [ -1.456, -1.604, -1.912 ], [ -0.9, -1.368, 1.644 ], [ 1.744, -1.548, 0.98 ], [ 0.756, 1.34, 1.04 ], [ 0.996, -1.764, 0.496 ], ... ],
    	[ [ -0.708, -0.488, -0.672 ], [ 1.68, 0.692, -0.236 ], [ -1.396, 0.616, 1.016 ], [ 0.66, -1.512, 1.544 ], [ -0.452, -0.412, 1.224 ], [ 0.636, 1.6, -1.832 ], [ 0.056, -0.844, 1.888 ], [ -0.78, 1.524, -0.44 ], ... ],
    	[ [ -1.016, 1.712, 0.96 ], [ -1.78, 1.716, -0.34 ], [ 1.444, -0.244, 0.788 ], [ -1.936, -1.82, 0.796 ], [ -0.352, 0.952, -1.928 ], [ 1.328, -1.488, -1.284 ], [ 0.804, -0.48, -0.648 ], [ 1.004, 0.54, 1.484 ], ... ],
    	[ [ 0.28, -0.184, 1.024 ], [ -0.02, -0.176, 1.696 ], [ -1.816, 1.828, -0.6 ], [ 0.728, 0.696, -0.708 ], [ -0.752, 1.204, -1.924 ], [ -1.38, 1.852, 1.16 ], [ 0.792, 1.996, 1.248 ], [ 2.0, 1.304, -0.584 ], ... ],
    	[ [ 0.028, 0.876, -0.896 ], [ 1.724, 0.2, -1.028 ], [ 0.844, -0.508, 1.484 ], [ 1.22, 1.668, -1.936 ], [ 0.64, -0.392, 1.856 ], [ 0.596, -1.824, -1.752 ], [ -0.876, 0.572, 0.82 ], [ 1.872, 0.676, 0.38 ], ... ],
    	[ [ 1.796, 0.62, 0.972 ], [ 0.428, 0.12, -0.916 ], [ -1.52, -0.104, -1.54 ], [ -0.092, -0.836, -1.616 ], [ -1.348, 1.908, -1.924 ], [ -1.556, -0.508, 1.088 ], [ -1.264, 0.852, -0.616 ], [ -0.932, -1.876, -0.984 ], ... ],
    	...
    ]

Gradient Descent

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

TrainingTester.java:480 executed in 0.55 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: 278497616911
Final threshold in iteration 0: -319.2799999999998 (> 0.0) after 0.544s (< 30.000s)

Returns

    -319.2799999999998

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.804, -1.392, 0.38 ], [ -0.892, 1.504, 0.232 ], [ 0.892, 1.52, -0.708 ], [ 0.364, -0.632, -0.86 ], [ -1.356, -1.044, 0.74 ], [ -1.836, 0.328, 0.78 ], [ -1.224, -0.408, -1.924 ], [ 0.952, 0.264, 1.3 ], ... ],
    	[ [ -1.704, 1.276, 1.628 ], [ -0.736, 0.624, -1.732 ], [ -0.856, 0.488, 1.516 ], [ -1.404, 1.488, -0.332 ], [ 0.988, -0.152, -1.232 ], [ 0.432, -1.992, 0.428 ], [ -1.496, -0.928, -0.312 ], [ 1.844, 0.608, 0.772 ], ... ],
    	[ [ -1.276, -0.056, -1.564 ], [ -0.544, -0.108, -1.256 ], [ -1.68, -1.188, -0.992 ], [ -1.328, 0.096, -1.892 ], [ 0.856, -0.588, 1.552 ], [ 0.836, -0.372, -0.764 ], [ 1.544, -0.64, -0.196 ], [ 1.86, -0.804, -0.832 ], ... ],
    	[ [ -0.564, 1.224, -1.624 ], [ -0.38, -0.92, 0.008 ], [ -0.432, 1.94, 1.284 ], [ -0.96, -1.848, -0.884 ], [ 0.764, -0.056, -1.156 ], [ -0.972, -1.932, -0.308 ], [ -0.052, -1.568, -0.032 ], [ -0.68, 1.152, -0.568 ], ... ],
    	[ [ -1.808, -0.372, 1.132 ], [ 0.648, 1.396, -1.528 ], [ 0.044, -0.904, 0.56 ], [ 1.168, 1.464, -0.532 ], [ -1.716, 1.68, 1.156 ], [ 1.14, 0.036, 0.656 ], [ -1.496, -1.276, -1.032 ], [ 0.024, 1.388, 0.348 ], ... ],
    	[ [ 0.892, 0.628, -0.1 ], [ 1.56, -0.492, 0.368 ], [ 0.94, -1.484, 1.496 ], [ 1.832, -1.084, -1.18 ], [ -0.444, -0.596, -1.968 ], [ 1.54, 0.152, 1.908 ], [ 0.268, 0.432, -0.676 ], [ -1.58, -1.156, 1.948 ], ... ],
    	[ [ -1.892, -0.62, -1.196 ], [ 1.464, -1.992, -0.064 ], [ 1.828, -1.008, -1.676 ], [ -0.556, 1.896, 0.56 ], [ 0.66, -1.18, 1.712 ], [ 0.984, 0.416, -1.136 ], [ -0.068, 1.712, -0.44 ], [ 0.268, -0.892, 1.54 ], ... ],
    	[ [ 0.724, -1.868, -1.16 ], [ 0.492, 1.212, 1.428 ], [ 0.352, -1.7, -0.628 ], [ -1.268, -1.416, 0.624 ], [ -0.012, 0.208, 0.172 ], [ 0.316, 1.46, -0.128 ], [ 1.612, -0.432, 1.428 ], [ 1.496, -0.804, 0.356 ], ... ],
    	...
    ]

To produce the following output:

TrainingTester.java:633 executed in 0.02 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

    [
    	[ [ -319.2800000000001 ] ]
    ]

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.40 seconds (0.212 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: 279124690347
Final threshold in iteration 0: -319.27999999999975 (> 0.0) after 0.404s (< 30.000s)

Returns

    -319.27999999999975

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.804, -1.392, 0.38 ], [ -0.892, 1.504, 0.232 ], [ 0.892, 1.52, -0.708 ], [ 0.364, -0.632, -0.86 ], [ -1.356, -1.044, 0.74 ], [ -1.836, 0.328, 0.78 ], [ -1.224, -0.408, -1.924 ], [ 0.952, 0.264, 1.3 ], ... ],
    	[ [ -1.704, 1.276, 1.628 ], [ -0.736, 0.624, -1.732 ], [ -0.856, 0.488, 1.516 ], [ -1.404, 1.488, -0.332 ], [ 0.988, -0.152, -1.232 ], [ 0.432, -1.992, 0.428 ], [ -1.496, -0.928, -0.312 ], [ 1.844, 0.608, 0.772 ], ... ],
    	[ [ -1.276, -0.056, -1.564 ], [ -0.544, -0.108, -1.256 ], [ -1.68, -1.188, -0.992 ], [ -1.328, 0.096, -1.892 ], [ 0.856, -0.588, 1.552 ], [ 0.836, -0.372, -0.764 ], [ 1.544, -0.64, -0.196 ], [ 1.86, -0.804, -0.832 ], ... ],
    	[ [ -0.564, 1.224, -1.624 ], [ -0.38, -0.92, 0.008 ], [ -0.432, 1.94, 1.284 ], [ -0.96, -1.848, -0.884 ], [ 0.764, -0.056, -1.156 ], [ -0.972, -1.932, -0.308 ], [ -0.052, -1.568, -0.032 ], [ -0.68, 1.152, -0.568 ], ... ],
    	[ [ -1.808, -0.372, 1.132 ], [ 0.648, 1.396, -1.528 ], [ 0.044, -0.904, 0.56 ], [ 1.168, 1.464, -0.532 ], [ -1.716, 1.68, 1.156 ], [ 1.14, 0.036, 0.656 ], [ -1.496, -1.276, -1.032 ], [ 0.024, 1.388, 0.348 ], ... ],
    	[ [ 0.892, 0.628, -0.1 ], [ 1.56, -0.492, 0.368 ], [ 0.94, -1.484, 1.496 ], [ 1.832, -1.084, -1.18 ], [ -0.444, -0.596, -1.968 ], [ 1.54, 0.152, 1.908 ], [ 0.268, 0.432, -0.676 ], [ -1.58, -1.156, 1.948 ], ... ],
    	[ [ -1.892, -0.62, -1.196 ], [ 1.464, -1.992, -0.064 ], [ 1.828, -1.008, -1.676 ], [ -0.556, 1.896, 0.56 ], [ 0.66, -1.18, 1.712 ], [ 0.984, 0.416, -1.136 ], [ -0.068, 1.712, -0.44 ], [ 0.268, -0.892, 1.54 ], ... ],
    	[ [ 0.724, -1.868, -1.16 ], [ 0.492, 1.212, 1.428 ], [ 0.352, -1.7, -0.628 ], [ -1.268, -1.416, 0.624 ], [ -0.012, 0.208, 0.172 ], [ 0.316, 1.46, -0.128 ], [ 1.612, -0.432, 1.428 ], [ 1.496, -0.804, 0.356 ], ... ],
    	...
    ]

To produce the following output:

TrainingTester.java:633 executed in 0.02 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

    [
    	[ [ -319.2800000000001 ] ]
    ]

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 16.17 seconds (2.225 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: 279618296995
Reset training subject: 279829607137
Adding measurement 4968665 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD
Non-optimal measurement 5.6843418860808015E-14 < 5.6843418860808015E-14. Total: 1
th(0)=5.6843418860808015E-14;dx=-4.2341307605058143E-19
Non-optimal measurement 5.6843418860808015E-14 < 5.6843418860808015E-14. Total: 1
Armijo: th(2.154434690031884)=5.6843418860808015E-14; dx=6.567792895084631E-13 evalInputDelta=0.0
Adding measurement 510b7a48 to history. Total: 1
New Minimum: 5.6843418860808015E-14 > -1.7643519640841986E-7
WOLF (strong): th(1.077217345015942)=-1.7643519640841986E-7; dx=3.28433837447176E-13 evalInputDelta=1.7643525325183872E-7
Non-optimal measurement -4.407678488860256E-8 < -1.7643519640841986E-7. Total: 2
WOLF (strong): th(0.3590724483386473)=-4.407678488860256E-8; dx=1.0948193489423466E-13 evalInputDelta=4.407684173202142E-8
Non-optimal measurement -1.46669776768249E-8 < -1.7643519640841986E-7. Total: 2
WOLF (strong): th(0.08976811208466183)=-1.46669776768249E-8; dx=2.7369020156710015E-14 evalInputDelta=1.4667034520243761E-8
Non-optimal measurement -3.6646611079049763E-9 < -1.7643519640841986E-7. Total: 2
WOLF (strong): th(0.017953622416932366)=-3.6646611079049763E-9; dx=5.501158563327017E-15 evalInputDelta=3.664717951323837E-9
Non-optimal measurement -7.309381544473581E-10 < -1.7643519640841986E-7. Total: 2
WOLF (strong): th(0.002992270402822061)=-7.309381544473581E-10; dx=9.500468154168243E-16 evalInputDelta=7.309949978662189E-10
Adding measurement 30748033 to history. Total: 2
New Minimum: -1.7643519640841986E-7 > -319.2800000001117
WOLF (strong): th(4.2746720040315154E-4)=-319.2800000001117; dx=1.5127758215827365E-16 evalInputDelta=319.2800000001118
Non-optimal measurement -1.446096575818956E-11 < -319.2800000001117. Total: 3
WOLF (strong): th(5.343340005039394E-5)=-1.446096575818956E-11; dx=2.0277298740970935E-18 evalInputDelta=1.4517809177050367E-11
Non-optimal measurement -2.1600499167107045E-13 < -319.2800000001117. Total: 3
WOLFE (weak): th(5.9370444500437714E-6)=-2.1600499167107045E-13; dx=-4.2341307605058143E-19 evalInputDelta=2.7284841053187846E-13
Non-optimal measurement 5.6843418860808015E-14 < -319.2800000001117. Total: 3
Armijo: th(2.9685222250218857E-5)=5.6843418860808015E-14; dx=2.9127097319524084E-19 evalInputDelta=0.0
Non-optimal measurement 6.821210263296962E-14 < -319.2800000001117. Total: 3
Armijo: th(1.7811133350131314E-5)=6.821210263296962E-14; dx=-2.9499328595169687E-19 evalInputDelta=-1.13686837721616E-14
Non-optimal measurement 1.1368683772161604E-14 < -319.2800000001117. Total: 3
END: th(1.1874088900087543E-5)=1.1368683772161604E-14; dx=-3.3407756989483137E-19 evalInputDelta=4.5474735088646414E-14
Fitness changed from 5.6843418860808015E-14 to -319.2800000001117
Iteration 1 complete. Error: -319.2800000001117 Total: 9.0682; Orientation: 0.2926; Line Search: 8.2015
Non-optimal measurement 5.6843418860808015E-14 < -319.2800000001117. Total: 3
LBFGS Accumulation History: 3 points
Non-optimal measurement 5.6843418860808015E-14 < -319.2800000001117. Total: 3
th(0)=5.6843418860808015E-14;dx=-5.780462487125532E-14
Non-optimal measurement -1.446096575818956E-11 < -319.2800000001117. Total: 3
New Minimum: 5.6843418860808015E-14 > -1.446096575818956E-11
WOLF (strong): th(2.558194903887114E-5)=-1.446096575818956E-11; dx=1.0133372480336168E-12 evalInputDelta=1.4517809177050367E-11
Non-optimal measurement 2.4836026568664237E-10 < -319.2800000001117. Total: 3
Armijo: th(1.279097451943557E-5)=2.4836026568664237E-10; dx=4.702631364149354E-13 evalInputDelta=-2.4830342226778156E-10
Non-optimal measurement 1.314901965088211E-10 < -319.2800000001117. Total: 3
Armijo: th(4.26365817314519E-6)=1.314901965088211E-10; dx=1.0908885773656305E-13 evalInputDelta=-1.3143335308996028E-10
Non-optimal measurement 4.583853296935558E-11 < -319.2800000001117. Total: 3
Armijo: th(1.0659145432862975E-6)=4.583853296935558E-11; dx=-2.703365001371177E-15 evalInputDelta=-4.5781689550494774E-11
Non-optimal measurement -1.0436451702844351E-11 < -319.2800000001117. Total: 3
WOLFE (weak): th(2.131829086572595E-7)=-1.0436451702844351E-11; dx=-5.671583722304799E-14 evalInputDelta=1.049329512170516E-11
Non-optimal measurement -1.425632945029065E-11 < -319.2800000001117. Total: 3
END: th(6.395487259717785E-7)=-1.425632945029065E-11; dx=-4.313606046285545E-14 evalInputDelta=1.4313172869151459E-11
Fitness changed from 5.6843418860808015E-14 to -1.446096575818956E-11
Iteration 2 complete. Error: -1.446096575818956E-11 Total: 4.6839; Orientation: 0.2856; Line Search: 3.9381
Non-optimal measurement -1.3346834748517723E-11 < -319.2800000001117. Total: 3
LBFGS Accumulation History: 3 points
Non-optimal measurement 2.4836026568664237E-10 < -319.2800000001117. Total: 3
th(0)=2.4836026568664237E-10;dx=-1.776638503663246E-11
Non-optimal measurement 2.4836026568664237E-10 < -319.2800000001117. Total: 3
Armijo: th(1.3778659611992948E-6)=2.4836026568664237E-10; dx=-1.2244367373357253E-13 evalInputDelta=0.0
Non-optimal measurement 7.435119186993689E-12 < -319.2800000001117. Total: 3
END: th(6.889329805996474E-7)=7.435119186993689E-12; dx=-8.792564526530109E-12 evalInputDelta=2.4092514649964867E-10
Fitness changed from -1.3346834748517723E-11 to -1.3346834748517723E-11
Static Iteration Total: 2.4205; Orientation: 0.2880; Line Search: 1.9609
Iteration 3 failed. Error: -1.3346834748517723E-11
Previous Error: 0.0 -> -1.3346834748517723E-11
Optimization terminated 3
Final threshold in iteration 3: -1.3346834748517723E-11 (> 0.0) after 16.173s (< 30.000s)

Returns

    -1.3346834748517723E-11

Training Converged

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

    return TestUtil.compare(title + " vs Iteration", runs);
Logging
Plotting range=[1.0, 0.0], [2.0, 1.0]; valueStats=DoubleSummaryStatistics{count=0, sum=0.000000, min=Infinity, average=0.000000, max=-Infinity}
Only 0 points for LBFGS

Returns

Result

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.00 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": -319.2800000001117 }, "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": -319.2800000001117 }, "CjGD": { "type": "NonConverged", "value": NaN }, "GD": { "type": "NonConverged", "value": NaN } }, "model":null, "complete":null}OK
  {
    "result": "OK",
    "performance": {
      "execution_time": "21.622",
      "gc_time": "2.645"
    },
    "created_on": 1586734909198,
    "file_name": "trainingTest",
    "report": {
      "simpleName": "Asymmetric",
      "canonicalName": "com.simiacryptus.mindseye.layers.cudnn.SumReducerLayerTest.Asymmetric",
      "link": "https://github.com/SimiaCryptus/mindseye-cudnn/tree/59d5b3318556370acb2d83ee6ec123ce0fc6974f/src/test/java/com/simiacryptus/mindseye/layers/cudnn/SumReducerLayerTest.java",
      "javaDoc": ""
    },
    "training_analysis": {
      "input": {
        "LBFGS": {
          "type": "NonConverged",
          "value": -319.2800000001117
        },
        "CjGD": {
          "type": "NonConverged",
          "value": "NaN"
        },
        "GD": {
          "type": "NonConverged",
          "value": "NaN"
        }
      }
    },
    "archive": "s3://code.simiacrypt.us/tests/com/simiacryptus/mindseye/layers/cudnn/SumReducerLayer/Asymmetric/trainingTest/202004124149",
    "id": "18acb8cb-8e66-4fcf-afbd-5ba0500a89f5",
    "report_type": "Components",
    "display_name": "Comparative Training",
    "target": {
      "simpleName": "SumReducerLayer",
      "canonicalName": "com.simiacryptus.mindseye.layers.cudnn.SumReducerLayer",
      "link": "https://github.com/SimiaCryptus/mindseye-cudnn/tree/59d5b3318556370acb2d83ee6ec123ce0fc6974f/src/main/java/com/simiacryptus/mindseye/layers/cudnn/SumReducerLayer.java",
      "javaDoc": ""
    }
  }