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 827131378843982848

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.04 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.852 ], [ -0.764 ], [ 0.424 ], [ 1.992 ], [ -1.332 ], [ -0.02 ], [ -0.348 ], [ -0.792 ], ... ],
    	[ [ 1.932 ], [ 0.128 ], [ 1.408 ], [ -1.12 ], [ 1.612 ], [ -1.1 ], [ -1.272 ], [ 1.008 ], ... ],
    	[ [ 1.588 ], [ 1.016 ], [ -0.428 ], [ 0.964 ], [ 1.004 ], [ 1.412 ], [ -0.28 ], [ -0.524 ], ... ],
    	[ [ -1.944 ], [ 0.752 ], [ 1.372 ], [ -0.084 ], [ 0.756 ], [ -1.304 ], [ -0.696 ], [ -0.876 ], ... ],
    	[ [ -1.972 ], [ -0.704 ], [ -1.976 ], [ -0.236 ], [ 0.02 ], [ 1.316 ], [ 1.8 ], [ 0.84 ], ... ],
    	[ [ 1.912 ], [ -0.908 ], [ 1.992 ], [ -1.588 ], [ 0.172 ], [ -0.996 ], [ 1.104 ], [ -0.34 ], ... ],
    	[ [ -1.932 ], [ 0.572 ], [ -1.66 ], [ 1.32 ], [ -0.692 ], [ 1.588 ], [ 1.68 ], [ 0.3 ], ... ],
    	[ [ -0.428 ], [ 1.22 ], [ 1.896 ], [ -1.74 ], [ -1.328 ], [ -0.916 ], [ -1.136 ], [ 0.572 ], ... ],
    	...
    ]
    [
    	[ [ 1.82 ], [ -1.016 ], [ 1.06 ], [ 0.884 ], [ -0.676 ], [ 0.384 ], [ 1.18 ], [ -0.708 ], ... ],
    	[ [ 1.3 ], [ 0.712 ], [ -1.272 ], [ 1.62 ], [ -1.716 ], [ 0.34 ], [ -1.984 ], [ 0.204 ], ... ],
    	[ [ 1.556 ], [ -0.204 ], [ 0.5 ], [ -1.724 ], [ -0.808 ], [ -0.056 ], [ -1.348 ], [ 1.44 ], ... ],
    	[ [ 1.328 ], [ 1.14 ], [ -0.188 ], [ 1.616 ], [ -1.0 ], [ -0.996 ], [ -1.528 ], [ 0.752 ], ... ],
    	[ [ -1.252 ], [ -0.96 ], [ -0.972 ], [ -1.84 ], [ -0.252 ], [ -1.588 ], [ -1.276 ], [ 1.652 ], ... ],
    	[ [ 0.056 ], [ -1.56 ], [ -1.904 ], [ 0.876 ], [ 1.376 ], [ -1.504 ], [ 1.708 ], [ -1.396 ], ... ],
    	[ [ -0.728 ], [ -1.044 ], [ 1.768 ], [ -0.48 ], [ 1.02 ], [ -0.936 ], [ -0.348 ], [ 1.836 ], ... ],
    	[ [ 1.776 ], [ -1.732 ], [ -0.276 ], [ 0.176 ], [ -0.724 ], [ -1.28 ], [ 0.74 ], [ -1.392 ], ... ],
    	...
    ]
    [
    	[ [ -1.028 ], [ 1.608 ], [ 0.552 ], [ 0.46 ], [ -0.204 ], [ -1.14 ], [ 0.68 ], [ 1.096 ], ... ],
    	[ [ 0.316 ], [ 0.012 ], [ 0.136 ], [ -0.616 ], [ -1.204 ], [ 0.064 ], [ -1.924 ], [ -0.416 ], ... ],
    	[ [ 1.828 ], [ 0.684 ], [ 1.524 ], [ -1.108 ], [ -0.02 ], [ -0.308 ], [ 0.076 ], [ -0.608 ], ... ],
    	[ [ 0.192 ], [ 1.752 ], [ 1.328 ], [ 1.944 ], [ -1.256 ], [ -1.188 ], [ -0.776 ], [ -1.116 ], ... ],
    	[ [ 0.856 ], [ -0.988 ], [ -1.668 ], [ -0.632 ], [ -1.684 ], [ -1.464 ], [ -1.116 ], [ 0.368 ], ... ],
    	[ [ 1.428 ], [ -1.944 ], [ -1.596 ], [ 1.664 ], [ -0.828 ], [ -1.712 ], [ -1.296 ], [ -1.256 ], ... ],
    	[ [ 0.828 ], [ 1.924 ], [ 0.08 ], [ 1.0 ], [ -0.584 ], [ 0.856 ], [ -1.184 ], [ -0.12 ], ... ],
    	[ [ 1.924 ], [ 0.156 ], [ -1.096 ], [ 1.552 ], [ -1.46 ], [ 1.348 ], [ 1.488 ], [ -1.72 ], ... ],
    	...
    ]
    [
    	[ [ 1.252 ], [ -0.108 ], [ -1.652 ], [ -0.06 ], [ 1.796 ], [ 1.728 ], [ 0.112 ], [ 0.496 ], ... ],
    	[ [ -0.892 ], [ 1.552 ], [ -0.928 ], [ 0.168 ], [ -0.64 ], [ -0.128 ], [ -1.884 ], [ 1.028 ], ... ],
    	[ [ 0.62 ], [ 0.772 ], [ 1.664 ], [ -1.46 ], [ -0.156 ], [ -1.1 ], [ 0.508 ], [ 0.168 ], ... ],
    	[ [ 0.58 ], [ -0.288 ], [ 1.256 ], [ 1.768 ], [ -0.84 ], [ -1.56 ], [ 0.344 ], [ 1.928 ], ... ],
    	[ [ 0.888 ], [ -0.46 ], [ -0.456 ], [ 0.296 ], [ -1.684 ], [ -0.608 ], [ 0.716 ], [ 1.92 ], ... ],
    	[ [ -1.42 ], [ 0.66 ], [ -0.86 ], [ 0.028 ], [ 0.212 ], [ -1.556 ], [ 1.652 ], [ 1.904 ], ... ],
    	[ [ 1.572 ], [ -0.8 ], [ 0.06 ], [ -0.832 ], [ -1.348 ], [ -1.996 ], [ -0.452 ], [ -0.036 ], ... ],
    	[ [ -1.472 ], [ 0.704 ], [ 1.624 ], [ 0.448 ], [ 0.304 ], [ -1.364 ], [ -1.868 ], [ 0.028 ], ... ],
    	...
    ]
    [
    	[ [ 1.668 ], [ 1.276 ], [ -1.768 ], [ 1.952 ], [ 1.26 ], [ 0.936 ], [ 1.764 ], [ -1.324 ], ... ],
    	[ [ -1.044 ], [ 0.692 ], [ -0.14 ], [ 1.68 ], [ 1.128 ], [ 0.836 ], [ -0.244 ], [ 1.544 ], ... ],
    	[ [ -0.1 ], [ -0.364 ], [ -0.4 ], [ -1.732 ], [ -1.324 ], [ -0.684 ], [ 1.652 ], [ -0.74 ], ... ],
    	[ [ -0.336 ], [ 1.588 ], [ -1.52 ], [ -0.488 ], [ 0.852 ], [ 1.504 ], [ 0.636 ], [ 0.74 ], ... ],
    	[ [ -1.276 ], [ 1.504 ], [ -0.756 ], [ -1.344 ], [ 0.752 ], [ -0.692 ], [ 0.1 ], [ 1.556 ], ... ],
    	[ [ -1.188 ], [ 0.016 ], [ 1.556 ], [ 0.472 ], [ -0.864 ], [ -0.704 ], [ 0.604 ], [ 1.332 ], ... ],
    	[ [ -0.796 ], [ -1.72 ], [ 1.528 ], [ 1.272 ], [ -1.244 ], [ 0.4 ], [ -1.72 ], [ 0.004 ], ... ],
    	[ [ 0.952 ], [ -1.772 ], [ 0.228 ], [ -0.592 ], [ -1.432 ], [ 0.668 ], [ 1.208 ], [ 1.12 ], ... ],
    	...
    ]

Gradient Descent

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

TrainingTester.java:480 executed in 13.20 seconds (0.591 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: 5540129239552
Reset training subject: 5540362819259
Constructing line search parameters: GD
th(0)=0.8345742189300001;dx=-6.250103956125004E-7
New Minimum: 0.8345742189300001 > 0.8345728723868288
WOLFE (weak): th(2.154434690031884)=0.8345728723868288; dx=-6.250095540224513E-7 evalInputDelta=1.3465431712988973E-6
New Minimum: 0.8345728723868288 > 0.8345715258454705
WOLFE (weak): th(4.308869380063768)=0.8345715258454705; dx=-6.250087124324028E-7 evalInputDelta=2.6930845296035955E-6
New Minimum: 0.8345715258454705 > 0.8345661396981692
WOLFE (weak): th(12.926608140191302)=0.8345661396981692; dx=-6.250053460722077E-7 evalInputDelta=8.079231830881994E-6
New Minimum: 0.8345661396981692 > 0.8345419023943169
WOLFE (weak): th(51.70643256076521)=0.8345419023943169; dx=-6.249901974513314E-7 evalInputDelta=3.231653568314119E-5
New Minimum: 0.8345419023943169 > 0.8344126466953332
WOLFE (weak): th(258.53216280382605)=0.8344126466953332; dx=-6.249094048066547E-7 evalInputDelta=1.6157223466684023E-4
New Minimum: 0.8344126466953332 > 0.8336051771625707
WOLFE (weak): th(1551.1929768229563)=0.8336051771625707; dx=-6.244044507774279E-7 evalInputDelta=9.690417674294016E-4
New Minimum: 0.8336051771625707 > 0.8278106652428183
WOLFE (weak): th(10858.350837760694)=0.8278106652428183; dx=-6.207687817669947E-7 evalInputDelta=0.006763553687181734
New Minimum: 0.8278106652428183 > 0.7817553835076245
WOLFE (weak): th(86866.80670208555)=0.7817553835076245; dx=-5.91077484848459E-7 evalInputDelta=0.05281883542237553
New Minimum: 0.7817553835076245 > 0.4653198697350655
END: th(781801.26031877)=0.4653198697350655; dx=-3.1961419873613423E-7 evalInputDelta=0.36925434919493455
Fitness changed from 0.8345742189300001 to 0.4653198697350655
Iteration 1 complete. Error: 0.4653198697350655 Total: 3.8128; Orientation: 0.1378; Line Search: 3.2010
th(0)=0.4653198697350655;dx=-1.634424591188319E-7
New Minimum: 0.4653198697350655 > 0.33468352432373355
WOLF (strong): th(1684339.7559414052)=0.33468352432373355; dx=2.753023587457755E-9 evalInputDelta=0.13063634541133196
END: th(842169.8779707026)=0.3638990479536143; dx=-7.74135117117455E-8 evalInputDelta=0.10142082178145123
Fitness changed from 0.4653198697350655 to 0.33468352432373355
Iteration 2 complete. Error: 0.33468352432373355 Total: 0.8450; Orientation: 0.1356; Line Search: 0.5935
th(0)=0.33468352432373355;dx=-1.451183359169494E-10
New Minimum: 0.33468352432373355 > 0.3345695142508718
WOLF (strong): th(1814400.0)=0.3345695142508718; dx=1.944585701287125E-11 evalInputDelta=1.140100728617699E-4
END: th(907200.0)=0.3345891961283462; dx=-6.283623945203912E-11 evalInputDelta=9.432819538734982E-5
Fitness changed from 0.33468352432373355 to 0.3345695142508718
Iteration 3 complete. Error: 0.3345695142508718 Total: 0.8400; Orientation: 0.1285; Line Search: 0.5650
Low gradient: 1.614231965897327E-6
th(0)=0.3345695142508718;dx=-2.60574483972475E-12
New Minimum: 0.3345695142508718 > 0.33456753198950834
WOLF (strong): th(1954503.150796925)=0.33456753198950834; dx=5.773404724095316E-13 evalInputDelta=1.9822613634423725E-6
END: th(977251.5753984625)=0.33456774545140605; dx=-1.0142021836576082E-12 evalInputDelta=1.768799465728943E-6
Fitness changed from 0.3345695142508718 to 0.33456753198950834
Iteration 4 complete. Error: 0.33456753198950834 Total: 0.8040; Orientation: 0.1302; Line Search: 0.5634
Low gradient: 3.576564487673227E-7
th(0)=0.33456753198950834;dx=-1.2791813534485251E-13
New Minimum: 0.33456753198950834 > 0.33456743986662973
WOLF (strong): th(2105424.6949267564)=0.33456743986662973; dx=4.040811533266971E-14 evalInputDelta=9.21228786032735E-8
END: th(1052712.3474633782)=0.33456744162828833; dx=-4.3755010006091474E-14 evalInputDelta=9.036122000649627E-8
Fitness changed from 0.33456753198950834 to 0.33456743986662973
Iteration 5 complete. Error: 0.33456743986662973 Total: 0.8281; Orientation: 0.1273; Line Search: 0.5917
Low gradient: 1.1298025094175682E-7
th(0)=0.33456743986662973;dx=-1.2764537102862345E-14
New Minimum: 0.33456743986662973 > 0.3345674314349509
WOLF (strong): th(2268000.0)=0.3345674314349509; dx=5.329194240445051E-15 evalInputDelta=8.4316788551142E-9
New Minimum: 0.3345674314349509 > 0.33456743052121746
END: th(1134000.0)=0.33456743052121746; dx=-3.717671431208642E-15 evalInputDelta=9.345412277372844E-9
Fitness changed from 0.33456743986662973 to 0.33456743052121746
Iteration 6 complete. Error: 0.33456743052121746 Total: 0.9048; Orientation: 0.1372; Line Search: 0.6469
Low gradient: 3.290549808678655E-8
th(0)=0.33456743052121746;dx=-1.0827718043395131E-15
New Minimum: 0.33456743052121746 > 0.3345674298955332
WOLF (strong): th(2443128.938496156)=0.3345674298955332; dx=5.705726512664585E-16 evalInputDelta=6.256842821628084E-10
New Minimum: 0.3345674298955332 > 0.33456742970345854
END: th(1221564.469248078)=0.33456742970345854; dx=-2.560995765365347E-16 evalInputDelta=8.177589161384446E-10
Fitness changed from 0.33456743052121746 to 0.33456742970345854
Iteration 7 complete. Error: 0.33456742970345854 Total: 1.1597; Orientation: 0.1405; Line Search: 0.9002
Low gradient: 7.782881020706183E-9
th(0)=0.33456742970345854;dx=-6.057323698246852E-17
New Minimum: 0.33456742970345854 > 0.3345674296751514
WOLF (strong): th(2631780.868658446)=0.3345674296751514; dx=3.906144191952072E-17 evalInputDelta=2.830713441426269E-11
New Minimum: 0.3345674296751514 > 0.3345674296565279
END: th(1315890.434329223)=0.3345674296565279; dx=-1.0755897531475988E-17 evalInputDelta=4.693062605198861E-11
Fitness changed from 0.33456742970345854 to 0.3345674296565279
Iteration 8 complete. Error: 0.3345674296565279 Total: 0.8590; Orientation: 0.1330; Line Search: 0.6094
Low gradient: 1.381994341537557E-9
th(0)=0.3345674296565279;dx=-1.909908360041824E-18
New Minimum: 0.3345674296565279 > 0.33456742965591035
WOLF (strong): th(2835000.0000000005)=0.33456742965591035; dx=1.4742105154075564E-18 evalInputDelta=6.175615574477433E-13
New Minimum: 0.33456742965591035 > 0.3345674296550199
END: th(1417500.0000000002)=0.3345674296550199; dx=-2.1784892231596167E-19 evalInputDelta=1.5080159343483501E-12
Fitness changed from 0.3345674296565279 to 0.3345674296550199
Iteration 9 complete. Error: 0.3345674296550199 Total: 0.8003; Orientation: 0.1250; Line Search: 0.5701
Low gradient: 1.5763372958068043E-10
th(0)=0.3345674296550199;dx=-2.4848392701515088E-20
New Minimum: 0.3345674296550199 > 0.3345674296550164
WOLF (strong): th(3053911.173120196)=0.3345674296550164; dx=2.2579597364226365E-20 evalInputDelta=3.497202527569243E-15
New Minimum: 0.3345674296550164 > 0.334567429655
END: th(1526955.586560098)=0.334567429655; dx=-1.1343976686340602E-21 evalInputDelta=1.9872992140790302E-14
Fitness changed from 0.3345674296550199 to 0.334567429655
Iteration 10 complete. Error: 0.334567429655 Total: 0.8003; Orientation: 0.1237; Line Search: 0.5705
Zero gradient: 7.19641457225974E-12
th(0)=0.334567429655;dx=-5.178838269583235E-23
WOLF (strong): th(3289726.085823058)=0.334567429655; dx=5.469261323902983E-23 evalInputDelta=0.0
New Minimum: 0.334567429655 > 0.33456742965499997
WOLF (strong): th(1644863.042911529)=0.33456742965499997; dx=1.4521152763459764E-24 evalInputDelta=5.551115123125783E-17
END: th(548287.6809705097)=0.334567429655; dx=-3.404155004028264E-23 evalInputDelta=0.0
Fitness changed from 0.334567429655 to 0.33456742965499997
Iteration 11 complete. Error: 0.33456742965499997 Total: 0.9526; Orientation: 0.1238; Line Search: 0.7223
Zero gradient: 2.017831604565288E-13
th(0)=0.33456742965499997;dx=-4.071644384382525E-26
END: th(1181250.0000000005)=0.33456742965499997; dx=-1.0656256926405846E-26 evalInputDelta=0.0
Fitness changed from 0.33456742965499997 to 0.33456742965499997
Static Iteration Total: 0.5821; Orientation: 0.1248; Line Search: 0.3503
Iteration 12 failed. Error: 0.33456742965499997
Previous Error: 0.0 -> 0.33456742965499997
Optimization terminated 12
Final threshold in iteration 12: 0.33456742965499997 (> 0.0) after 13.189s (< 30.000s)

Returns

    0.33456742965499997

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.612 ], [ -1.944 ], [ 0.42399999949068784 ], [ -1.844 ], [ -1.412 ], [ -0.015526503453663076 ], [ -1.348 ], [ -0.756 ], ... ],
    	[ [ 1.9320000008398233 ], [ 0.12799999923603175 ], [ 1.408000000381081 ], [ -0.184 ], [ 1.612000000348572 ], [ -1.816 ], [ -0.74 ], [ 1.0080000003919176 ], ... ],
    	[ [ -0.332 ], [ -0.332 ], [ -1.728 ], [ 0.9640000001914435 ], [ 1.0040000000072242 ], [ 1.4119999998699628 ], [ -0.592 ], [ -1.472 ], ... ],
    	[ [ -0.007978897608132418 ], [ -1.808 ], [ 1.3720000002727168 ], [ -1.552 ], [ -0.856 ], [ -1.248 ], [ -0.76 ], [ -0.03698326864310031 ], ... ],
    	[ [ -0.010890117005694283 ], [ -0.014232628165857797 ], [ -0.004744209388619275 ], [ -0.007763251726831538 ], [ 0.019999999777853203 ], [ 1.3160000003052261 ], [ -0.34 ], [ -0.864 ], ... ],
    	[ [ -1.632 ], [ -0.0029112193975618303 ], [ -0.996 ], [ -0.46 ], [ -0.072 ], [ -1.756 ], [ -0.684 ], [ -0.012830929937402147 ], ... ],
    	[ [ -1.652 ], [ 0.5719999995141667 ], [ -0.01628126403821617 ], [ 1.3200000001643526 ], [ -0.032023413373180154 ], [ 1.5880000001769952 ], [ -1.6 ], [ 0.29999999988260534 ], ... ],
    	[ [ -1.44 ], [ -1.5 ], [ 1.896000000830793 ], [ -0.014232628165857797 ], [ -0.848 ], [ -0.048412500352046806 ], [ -0.916 ], [ 0.5720000001101703 ], ... ],
    	...
    ]

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

    [
    	[ [ 0.0 ], [ 0.0 ], [ 0.42399999949068784 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 1.9320000008398233 ], [ 0.12799999923603175 ], [ 1.408000000381081 ], [ 0.0 ], [ 1.612000000348572 ], [ 0.0 ], [ 0.0 ], [ 1.0080000003919176 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.9640000001914435 ], [ 1.0040000000072242 ], [ 1.4119999998699628 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 1.3720000002727168 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.019999999777853203 ], [ 1.3160000003052261 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.5719999995141667 ], [ 0.0 ], [ 1.3200000001643526 ], [ 0.0 ], [ 1.5880000001769952 ], [ 0.0 ], [ 0.29999999988260534 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 1.896000000830793 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.5720000001101703 ], ... ],
    	...
    ]

Conjugate Gradient Descent

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

TrainingTester.java:452 executed in 11.74 seconds (0.199 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: 5553391178460
Reset training subject: 5553507994184
Constructing line search parameters: GD
F(0.0) = LineSearchPoint{point=PointSample{avg=0.8345742189300001}, derivative=-6.250103956125004E-7}
F(1.0E-10) = LineSearchPoint{point=PointSample{avg=0.8345742189300001}, derivative=-6.250103956125004E-7}, evalInputDelta = 0.0
New Minimum: 0.8345742189300001 > 0.8345742189299996
F(7.000000000000001E-10) = LineSearchPoint{point=PointSample{avg=0.8345742189299996}, derivative=-6.250103956125002E-7}, evalInputDelta = -4.440892098500626E-16
New Minimum: 0.8345742189299996 > 0.834574218929997
F(4.900000000000001E-9) = LineSearchPoint{point=PointSample{avg=0.834574218929997}, derivative=-6.250103956124985E-7}, evalInputDelta = -3.1086244689504383E-15
New Minimum: 0.834574218929997 > 0.8345742189299786
F(3.430000000000001E-8) = LineSearchPoint{point=PointSample{avg=0.8345742189299786}, derivative=-6.250103956124867E-7}, evalInputDelta = -2.142730437526552E-14
New Minimum: 0.8345742189299786 > 0.83457421892985
F(2.4010000000000004E-7) = LineSearchPoint{point=PointSample{avg=0.83457421892985}, derivative=-6.250103956124066E-7}, evalInputDelta = -1.5010215292932116E-13
New Minimum: 0.83457421892985 > 0.8345742189289496
F(1.6807000000000003E-6) = LineSearchPoint{point=PointSample{avg=0.8345742189289496}, derivative=-6.250103956118435E-7}, evalInputDelta = -1.0504930259003231E-12
New Minimum: 0.8345742189289496 > 0.8345742189226468
F(1.1764900000000001E-5) = LineSearchPoint{point=PointSample{avg=0.8345742189226468}, derivative=-6.250103956079041E-7}, evalInputDelta = -7.353229136697337E-12
New Minimum: 0.8345742189226468 > 0.8345742188785277
F(8.235430000000001E-5) = LineSearchPoint{point=PointSample{avg=0.8345742188785277}, derivative=-6.250103955803294E-7}, evalInputDelta = -5.147238191227643E-11
New Minimum: 0.8345742188785277 > 0.834574218569694
F(5.764801000000001E-4) = LineSearchPoint{point=PointSample{avg=0.834574218569694}, derivative=-6.25010395387309E-7}, evalInputDelta = -3.6030600725212025E-10
New Minimum: 0.834574218569694 > 0.8345742164078578
F(0.004035360700000001) = LineSearchPoint{point=PointSample{avg=0.8345742164078578}, derivative=-6.250103940361615E-7}, evalInputDelta = -2.5221422728094467E-9
New Minimum: 0.8345742164078578 > 0.8345742012750035
F(0.028247524900000005) = LineSearchPoint{point=PointSample{avg=0.8345742012750035}, derivative=-6.250103845781274E-7}, evalInputDelta = -1.765499657579994E-8
New Minimum: 0.8345742012750035 > 0.8345740953450307
F(0.19773267430000002) = LineSearchPoint{point=PointSample{avg=0.8345740953450307}, derivative=-6.250103183718888E-7}, evalInputDelta = -1.2358496936926144E-7
New Minimum: 0.8345740953450307 > 0.8345733538355354
F(1.3841287201) = LineSearchPoint{point=PointSample{avg=0.8345733538355354}, derivative=-6.250098549282261E-7}, evalInputDelta = -8.650944646193537E-7
New Minimum: 0.8345733538355354 > 0.8345681632844627
F(9.688901040700001) = LineSearchPoint{point=PointSample{avg=0.8345681632844627}, derivative=-6.250066108225796E-7}, evalInputDelta = -6.055645537350607E-6
New Minimum: 0.8345681632844627 > 0.8345318301813187
F(67.8223072849) = LineSearchPoint{point=PointSample{avg=0.8345318301813187}, derivative=-6.249839020830584E-7}, evalInputDelta = -4.238874868134346E-5
New Minimum: 0.8345318301813187 > 0.8342775354231289
F(474.7561509943) = LineSearchPoint{point=PointSample{avg=0.8342775354231289}, derivative=-6.248249409064052E-7}, evalInputDelta = -2.9668350687117595E-4
New Minimum: 0.8342775354231289 > 0.8324992833429132
F(3323.2930569601003) = LineSearchPoint{point=PointSample{avg=0.8324992833429132}, derivative=-6.237122126698335E-7}, evalInputDelta = -0.0020749355870868236
New Minimum: 0.8324992833429132 > 0.8201402689099524
F(23263.0513987207) = LineSearchPoint{point=PointSample{avg=0.8201402689099524}, derivative=-6.159231150138319E-7}, evalInputDelta = -0.014433950020047659
New Minimum: 0.8201402689099524 > 0.7379759241781361
F(162841.3597910449) = LineSearchPoint{point=PointSample{avg=0.7379759241781361}, derivative=-5.613994314218258E-7}, evalInputDelta = -0.09659829475186399
New Minimum: 0.7379759241781361 > 0.37591456970195714
F(1139889.5185373144) = LineSearchPoint{point=PointSample{avg=0.37591456970195714}, derivative=-1.79733646277782E-7}, evalInputDelta = -0.4586596492280429
F(7979226.6297612) = LineSearchPoint{point=PointSample{avg=1.7045641988339821}, derivative=4.1614488938721695E-7}, evalInputDelta = 0.8699899799039821
F(613786.6638277846) = LineSearchPoint{point=PointSample{avg=0.524533270010076}, derivative=-3.852459921245746E-7}, evalInputDelta = -0.31004094891992406
F(4296506.646794492) = LineSearchPoint{point=PointSample{avg=0.6026053888922084}, derivative=1.8358564048892738E-7}, evalInputDelta = -0.23196883003779167
0.6026053888922084 <= 0.8345742189300001
F(3321017.1694780854) = LineSearchPoint{point=PointSample{avg=0.4526974499711498}, derivative=1.2391079788412013E-7}, evalInputDelta = -0.38187676895885025
Right bracket at 3321017.1694780854
F(2771546.957084171) = LineSearchPoint{point=PointSample{avg=0.3937908259423125}, derivative=9.045488867844948E-8}, evalInputDelta = -0.44078339298768754
Right bracket at 2771546.957084171
New Minimum: 0.37591456970195714 > 0.36592341884783985
F(2421145.649047826) = LineSearchPoint{point=PointSample{avg=0.36592341884783985}, derivative=6.844795702303733E-8}, evalInputDelta = -0.4686508000821602
Right bracket at 2421145.649047826
New Minimum: 0.36592341884783985 > 0.35144591557866744
F(2182165.9429087345) = LineSearchPoint{point=PointSample{avg=0.35144591557866744}, derivative=5.252727602811492E-8}, evalInputDelta = -0.4831283033513326
Right bracket at 2182165.9429087345
New Minimum: 0.35144591557866744 > 0.3435862525054699
F(2012989.7662619576) = LineSearchPoint{point=PointSample{avg=0.3435862525054699}, derivative=4.0193067109587885E-8}, evalInputDelta = -0.49098796642453013
Right bracket at 2012989.7662619576
New Minimum: 0.3435862525054699 > 0.33928798459199416
F(1891360.4644011485) = LineSearchPoint{point=PointSample{avg=0.33928798459199416}, derivative=3.031154653099698E-8}, evalInputDelta = -0.4952862343380059
Right bracket at 1891360.4644011485
New Minimum: 0.33928798459199416 > 0.33697499253299756
F(1803876.6537171018) = LineSearchPoint{point=PointSample{avg=0.33697499253299756}, derivative=2.243795477604218E-8}, evalInputDelta = -0.4975992263970025
Right bracket at 1803876.6537171018
New Minimum: 0.33697499253299756 > 0.3357615876744092
F(1741361.546908392) = LineSearchPoint{point=PointSample{avg=0.3357615876744092}, derivative=1.6285969906019926E-8}, evalInputDelta = -0.49881263125559083
Right bracket at 1741361.546908392
New Minimum: 0.3357615876744092 > 0.3351442004150127
F(1697138.9951003524) = LineSearchPoint{point=PointSample{avg=0.3351442004150127}, derivative=1.1584082776055364E-8}, evalInputDelta = -0.49943001851498736
Right bracket at 1697138.9951003524
New Minimum: 0.3351442004150127 > 0.33483970864137613
F(1666256.2286467701) = LineSearchPoint{point=PointSample{avg=0.33483970864137613}, derivative=8.103757393358143E-9}, evalInputDelta = -0.4997345102886239
Right bracket at 1666256.2286467701
New Minimum: 0.33483970864137613 > 0.3346934042008559
F(1644928.422013453) = LineSearchPoint{point=PointSample{avg=0.3346934042008559}, derivative=5.599021297398897E-9}, evalInputDelta = -0.49988081472914414
Right bracket at 1644928.422013453
Converged to right
Fitness changed from 0.8345742189300001 to 0.3346934042008559
Iteration 1 complete. Error: 0.3346934042008559 Total: 9.9047; Orientation: 0.1614; Line Search: 9.3800
F(0.0) = LineSearchPoint{point=PointSample{avg=0.3346934042008559}, derivative=-1.5722199481990592E-10}
New Minimum: 0.3346934042008559 > 0.33456772578078686
F(1644928.422013453) = LineSearchPoint{point=PointSample{avg=0.33456772578078686}, derivative=4.414835083166047E-12}, evalInputDelta = -1.2567842006905305E-4
0.33456772578078686 <= 0.3346934042008559
New Minimum: 0.33456772578078686 > 0.334567626605
F(1599999.9999999998) = LineSearchPoint{point=PointSample{avg=0.334567626605}, derivative=-4.742716096869458E-28}, evalInputDelta = -1.2577759585591375E-4
Left bracket at 1599999.9999999998
F(1622464.2110067264) = LineSearchPoint{point=PointSample{avg=0.33456765139894673}, derivative=2.2074175415830205E-12}, evalInputDelta = -1.257528019091847E-4
Right bracket at 1622464.2110067264
Converged to left
Fitness changed from 0.3346934042008559 to 0.334567626605
Iteration 2 complete. Error: 0.334567626605 Total: 1.2910; Orientation: 0.1235; Line Search: 1.0597
Zero gradient: 4.0478075001624696E-22
F(0.0) = LineSearchPoint{point=PointSample{avg=0.334567626605}, derivative=-1.638474555837154E-43}
F(1599999.9999999998) = LineSearchPoint{point=PointSample{avg=0.334567626605}, derivative=0.0}, evalInputDelta = 0.0
0.334567626605 <= 0.334567626605
Converged to right
Fitness changed from 0.334567626605 to 0.334567626605
Static Iteration Total: 0.5402; Orientation: 0.1131; Line Search: 0.3312
Iteration 3 failed. Error: 0.334567626605
Previous Error: 0.0 -> 0.334567626605
Optimization terminated 3
Final threshold in iteration 3: 0.334567626605 (> 0.0) after 11.736s (< 30.000s)

Returns

    0.334567626605

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.612 ], [ -1.944 ], [ 0.424 ], [ -1.844 ], [ -1.412 ], [ -0.01617423192484313 ], [ -1.348 ], [ -0.756 ], ... ],
    	[ [ 1.932 ], [ 0.128 ], [ 1.408 ], [ -0.184 ], [ 1.612 ], [ -1.816 ], [ -0.74 ], [ 1.008 ], ... ],
    	[ [ -0.332 ], [ -0.332 ], [ -1.728 ], [ 0.964 ], [ 1.004 ], [ 1.412 ], [ -0.592 ], [ -1.472 ], ... ],
    	[ [ -0.00831175807248885 ], [ -1.808 ], [ 1.372 ], [ -1.552 ], [ -0.856 ], [ -1.248 ], [ -0.76 ], [ -0.03852612187653626 ], ... ],
    	[ [ -0.011344426558396958 ], [ -0.014826379264439526 ], [ -0.004942126421479842 ], [ -0.008087115962421565 ], [ 0.019999999999999997 ], [ 1.316 ], [ -0.34 ], [ -0.864 ], ... ],
    	[ [ -1.632 ], [ -0.00303266848590808 ], [ -0.996 ], [ -0.46 ], [ -0.072 ], [ -1.756 ], [ -0.684 ], [ -0.013366205549002308 ], ... ],
    	[ [ -1.652 ], [ 0.572 ], [ -0.01696047931007849 ], [ 1.32 ], [ -0.03335935334498896 ], [ 1.588 ], [ -1.6 ], [ 0.3 ], ... ],
    	[ [ -1.44 ], [ -1.5 ], [ 1.896 ], [ -0.014826379264439526 ], [ -0.848 ], [ -0.0504321537101009 ], [ -0.916 ], [ 0.572 ], ... ],
    	...
    ]

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

    [
    	[ [ 0.0 ], [ 0.0 ], [ 0.424 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 1.932 ], [ 0.128 ], [ 1.408 ], [ 0.0 ], [ 1.612 ], [ 0.0 ], [ 0.0 ], [ 1.008 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.964 ], [ 1.004 ], [ 1.412 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 1.372 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.019999999999999997 ], [ 1.316 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.572 ], [ 0.0 ], [ 1.32 ], [ 0.0 ], [ 1.588 ], [ 0.0 ], [ 0.3 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 1.896 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.572 ], ... ],
    	...
    ]

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 46.06 seconds (0.754 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: 5565184346062
Reset training subject: 5565295819276
Adding measurement d88770 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD
Non-optimal measurement 0.8345742189300001 < 0.8345742189300001. Total: 1
th(0)=0.8345742189300001;dx=-6.250103956125004E-7
Adding measurement 110e1032 to history. Total: 1
New Minimum: 0.8345742189300001 > 0.8345728723868288
WOLFE (weak): th(2.154434690031884)=0.8345728723868288; dx=-6.250095540224513E-7 evalInputDelta=1.3465431712988973E-6
Adding measurement 757d6cfe to history. Total: 2
New Minimum: 0.8345728723868288 > 0.8345715258454705
WOLFE (weak): th(4.308869380063768)=0.8345715258454705; dx=-6.250087124324028E-7 evalInputDelta=2.6930845296035955E-6
Adding measurement 7f068214 to history. Total: 3
New Minimum: 0.8345715258454705 > 0.8345661396981692
WOLFE (weak): th(12.926608140191302)=0.8345661396981692; dx=-6.250053460722077E-7 evalInputDelta=8.079231830881994E-6
Adding measurement 60ab4749 to history. Total: 4
New Minimum: 0.8345661396981692 > 0.8345419023943169
WOLFE (weak): th(51.70643256076521)=0.8345419023943169; dx=-6.249901974513314E-7 evalInputDelta=3.231653568314119E-5
Adding measurement 2170078d to history. Total: 5
New Minimum: 0.8345419023943169 > 0.8344126466953332
WOLFE (weak): th(258.53216280382605)=0.8344126466953332; dx=-6.249094048066547E-7 evalInputDelta=1.6157223466684023E-4
Adding measurement 67bf040a to history. Total: 6
New Minimum: 0.8344126466953332 > 0.8336051771625707
WOLFE (weak): th(1551.1929768229563)=0.8336051771625707; dx=-6.244044507774279E-7 evalInputDelta=9.690417674294016E-4
Adding measurement 2ddba52 to history. Total: 7
New Minimum: 0.8336051771625707 > 0.8278106652428183
WOLFE (weak): th(10858.350837760694)=0.8278106652428183; dx=-6.207687817669947E-7 evalInputDelta=0.006763553687181734
Adding measurement 610a025a to history. Total: 8
New Minimum: 0.8278106652428183 > 0.7817553835076245
WOLFE (weak): th(86866.80670208555)=0.7817553835076245; dx=-5.91077484848459E-7 evalInputDelta=0.05281883542237553
Adding measurement 893f81f to history. Total: 9
New Minimum: 0.7817553835076245 > 0.4653198697350655
END: th(781801.26031877)=0.4653198697350655; dx=-3.1961419873613423E-7 evalInputDelta=0.36925434919493455
Fitness changed from 0.8345742189300001 to 0.4653198697350655
Iteration 1 complete. Error: 0.4653198697350655 Total: 3.5168; Orientation: 0.1557; Line Search: 3.0259
Non-optimal measurement 0.4653198697350655 < 0.4653198697350655. Total: 10
Rejected: LBFGS Orientation magnitude: 6.468e+02, gradient 4.043e-04, dot -1.000; [9ed6184a-f371-4c8b-968c-6a92328f5c90 = 1.000/1.000e+00, fff78a1a-f0d4-4077-997b-429c9f01e05e = 1.000/1.000e+00, 7c043685-6427-4a1d-a942-b70a610429c6 = 1.000/1.000e+00, 00ce4f54-88a9-4b8f-9467-784bcd76becd = 1.000/1.000e+00, 11b481f4-e71b-420d-b9df-87b403fb6e18 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 0.4653198697350655, 0.7817553835076245, 0.8278106652428183, 0.8336051771625707, 0.8344126466953332, 0.8345419023943169, 0.8345661396981692, 0.8345715258454705, 0.8345728723868288, 0.8345742189300001
Rejected: LBFGS Orientation magnitude: 6.468e+02, gradient 4.043e-04, dot -1.000; [11b481f4-e71b-420d-b9df-87b403fb6e18 = 1.000/1.000e+00, fff78a1a-f0d4-4077-997b-429c9f01e05e = 1.000/1.000e+00, 7c043685-6427-4a1d-a942-b70a610429c6 = 1.000/1.000e+00, 9ed6184a-f371-4c8b-968c-6a92328f5c90 = 1.000/1.000e+00, 00ce4f54-88a9-4b8f-9467-784bcd76becd = 1.000/1.000e+00]
Orientation rejected. Popping history element from 0.4653198697350655, 0.7817553835076245, 0.8278106652428183, 0.8336051771625707, 0.8344126466953332, 0.8345419023943169, 0.8345661396981692, 0.8345715258454705, 0.8345728723868288
Rejected: LBFGS Orientation magnitude: 6.468e+02, gradient 4.043e-04, dot -1.000; [00ce4f54-88a9-4b8f-9467-784bcd76becd = 1.000/1.000e+00, 11b481f4-e71b-420d-b9df-87b403fb6e18 = 1.000/1.000e+00, fff78a1a-f0d4-4077-997b-429c9f01e05e = 1.000/1.000e+00, 7c043685-6427-4a1d-a942-b70a610429c6 = 1.000/1.000e+00, 9ed6184a-f371-4c8b-968c-6a92328f5c90 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 0.4653198697350655, 0.7817553835076245, 0.8278106652428183, 0.8336051771625707, 0.8344126466953332, 0.8345419023943169, 0.8345661396981692, 0.8345715258454705
Rejected: LBFGS Orientation magnitude: 6.468e+02, gradient 4.043e-04, dot -1.000; [9ed6184a-f371-4c8b-968c-6a92328f5c90 = 1.000/1.000e+00, 00ce4f54-88a9-4b8f-9467-784bcd76becd = 1.000/1.000e+00, 11b481f4-e71b-420d-b9df-87b403fb6e18 = 1.000/1.000e+00, 7c043685-6427-4a1d-a942-b70a610429c6 = 1.000/1.000e+00, fff78a1a-f0d4-4077-997b-429c9f01e05e = 1.000/1.000e+00]
Orientation rejected. Popping history element from 0.4653198697350655, 0.7817553835076245, 0.8278106652428183, 0.8336051771625707, 0.8344126466953332, 0.8345419023943169, 0.8345661396981692
Rejected: LBFGS Orientation magnitude: 6.468e+02, gradient 4.043e-04, dot -1.000; [11b481f4-e71b-420d-b9df-87b403fb6e18 = 1.000/1.000e+00, 7c043685-6427-4a1d-a942-b70a610429c6 = 1.000/1.000e+00, fff78a1a-f0d4-4077-997b-429c9f01e05e = 1.000/1.000e+00, 00ce4f54-88a9-4b8f-9467-784bcd76becd = 1.000/1.000e+00, 9ed6184a-f371-4c8b-968c-6a92328f5c90 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 0.4653198697350655, 0.7817553835076245, 0.8278106652428183, 0.8336051771625707, 0.8344126466953332, 0.8345419023943169
Rejected: LBFGS Orientation magnitude: 6.468e+02, gradient 4.043e-04, dot -1.000; [7c043685-6427-4a1d-a942-b70a610429c6 = 1.000/1.000e+00, 11b481f4-e71b-420d-b9df-87b403fb6e18 = 1.000/1.000e+00, 00ce4f54-88a9-4b8f-9467-784bcd76becd = 1.000/1.000e+00, fff78a1a-f0d4-4077-997b-429c9f01e05e = 1.000/1.000e+00, 9ed6184a-f371-4c8b-968c-6a92328f5c90 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 0.4653198697350655, 0.7817553835076245, 0.8278106652428183, 0.8336051771625707, 0.8344126466953332
Rejected: LBFGS Orientation magnitude: 6.468e+02, gradient 4.043e-04, dot -1.000; [11b481f4-e71b-420d-b9df-87b403fb6e18 = 1.000/1.000e+00, fff78a1a-f0d4-4077-997b-429c9f01e05e = 1.000/1.000e+00, 9ed6184a-f371-4c8b-968c-6a92328f5c90 = 1.000/1.000e+00, 7c043685-6427-4a1d-a942-b70a610429c6 = 1.000/1.000e+00, 00ce4f54-88a9-4b8f-9467-784bcd76becd = 1.000/1.000e+00]
Orientation rejected. Popping history element from 0.4653198697350655, 0.7817553835076245, 0.8278106652428183, 0.8336051771625707
LBFGS Accumulation History: 3 points
Removed measurement 893f81f to history. Total: 9
Removed measurement 610a025a to history. Total: 8
Removed measurement 2ddba52 to history. Total: 7
Removed measurement 67bf040a to history. Total: 6
Removed measurement 2170078d to history. Total: 5
Removed measurement 60ab4749 to history. Total: 4
Removed measurement 7f068214 to history. Total: 3
Adding measurement 246e488 to history. Total: 3
th(0)=0.4653198697350655;dx=-1.634424591188319E-7
Adding measurement 3d236d7b to history. Total: 4
New Minimum: 0.4653198697350655 > 0.33468352432373355
WOLF (strong): th(1684339.7559414052)=0.33468352432373355; dx=2.753023587457755E-9 evalInputDelta=0.13063634541133196
Non-optimal measurement 0.3638990479536143 < 0.33468352432373355. Total: 5
END: th(842169.8779707026)=0.3638990479536143; dx=-7.74135117117455E-8 evalInputDelta=0.10142082178145123
Fitness changed from 0.4653198697350655 to 0.33468352432373355
Iteration 2 complete. Error: 0.33468352432373355 Total: 42.5473; Orientation: 41.7133; Line Search: 0.7203
Final threshold in iteration 2: 0.33468352432373355 (> 0.0) after 46.064s (< 30.000s)

Returns

    0.33468352432373355

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.612 ], [ -1.944 ], [ 0.39359393073657634 ], [ -1.844 ], [ -1.412 ], [ -0.015526503453663076 ], [ -1.348 ], [ -0.756 ], ... ],
    	[ [ 1.9821376674024536 ], [ 0.08239089610486461 ], [ 1.4307506404772423 ], [ -0.184 ], [ 1.6328098275455347 ], [ -1.816 ], [ -0.74 ], [ 1.031397578121145 ], ... ],
    	[ [ -0.332 ], [ -0.332 ], [ -1.728 ], [ 0.9754292317089464 ], [ 1.0044312917626017 ], [ 1.4042367482731684 ], [ -0.592 ], [ -1.472 ], ... ],
    	[ [ -0.007978897608132418 ], [ -1.808 ], [ 1.3882812640382163 ], [ -1.552 ], [ -0.856 ], [ -1.248 ], [ -0.76 ], [ -0.03698326864310031 ], ... ],
    	[ [ -0.010890117005694283 ], [ -0.014232628165857797 ], [ -0.004744209388619275 ], [ -0.007763251726831538 ], [ 0.006737778299996111 ], [ 1.3342220769699242 ], [ -0.34 ], [ -0.864 ], ... ],
    	[ [ -1.632 ], [ -0.0029112193975618303 ], [ -0.996 ], [ -0.46 ], [ -0.072 ], [ -1.756 ], [ -0.684 ], [ -0.012830929937402147 ], ... ],
    	[ [ -1.652 ], [ 0.5429956289650321 ], [ -0.01628126403821617 ], [ 1.32981188759919 ], [ -0.032023413373180154 ], [ 1.598566648183743 ], [ -1.6 ], [ 0.2929915088577215 ], ... ],
    	[ [ -1.44 ], [ -1.5 ], [ 1.9455985526992015 ], [ -0.014232628165857797 ], [ -0.848 ], [ -0.048412500352046806 ], [ -0.916 ], [ 0.5785771993796767 ], ... ],
    	...
    ]

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

    [
    	[ [ 0.0 ], [ 0.0 ], [ 0.39359393073657634 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 1.9821376674024536 ], [ 0.08239089610486461 ], [ 1.4307506404772423 ], [ 0.0 ], [ 1.6328098275455347 ], [ 0.0 ], [ 0.0 ], [ 1.031397578121145 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.9754292317089464 ], [ 1.0044312917626017 ], [ 1.4042367482731684 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 1.3882812640382163 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.006737778299996111 ], [ 1.3342220769699242 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], ... ],
    	[ [ 0.0 ], [ 0.5429956289650321 ], [ 0.0 ], [ 1.32981188759919 ], [ 0.0 ], [ 1.598566648183743 ], [ 0.0 ], [ 0.2929915088577215 ], ... ],
    	[ [ 0.0 ], [ 0.0 ], [ 1.9455985526992015 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.0 ], [ 0.5785771993796767 ], ... ],
    	...
    ]

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

    return TestUtil.compare(title + " vs Iteration", runs);
Logging
Plotting range=[1.0, -0.4755163401506804], [11.0, -0.33224840215821777]; valueStats=DoubleSummaryStatistics{count=15, sum=5.280377, min=0.334567, average=0.352025, max=0.465320}
Plotting 11 points for GD
Plotting 2 points for CjGD
Plotting 2 points for LBFGS

Returns

Result

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

    return TestUtil.compareTime(title + " vs Time", runs);
Logging
Plotting range=[0.0, -0.4755163401506804], [42.547, -0.33224840215821777]; valueStats=DoubleSummaryStatistics{count=15, sum=5.280377, min=0.334567, average=0.352025, max=0.465320}
Plotting 11 points for GD
Plotting 2 points for CjGD
Plotting 2 points for LBFGS

Returns

Result

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": 0.33468352432373355 }, "CjGD": { "type": "NonConverged", "value": 0.334567626605 }, "GD": { "type": "NonConverged", "value": 0.33456742965499997 } }, "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": 0.33468352432373355 }, "CjGD": { "type": "NonConverged", "value": 0.334567626605 }, "GD": { "type": "NonConverged", "value": 0.33456742965499997 } }, "model":null, "complete":null}OK
  {
    "result": "OK",
    "performance": {
      "execution_time": "72.399",
      "gc_time": "1.805"
    },
    "created_on": 1586740171398,
    "file_name": "trainingTest",
    "report": {
      "simpleName": "ReLu_Double",
      "canonicalName": "com.simiacryptus.mindseye.layers.cudnn.ActivationLayerTest.ReLu_Double",
      "link": "https://github.com/SimiaCryptus/mindseye-cudnn/tree/59d5b3318556370acb2d83ee6ec123ce0fc6974f/src/test/java/com/simiacryptus/mindseye/layers/cudnn/ActivationLayerTest.java",
      "javaDoc": ""
    },
    "training_analysis": {
      "input": {
        "LBFGS": {
          "type": "NonConverged",
          "value": 0.33468352432373355
        },
        "CjGD": {
          "type": "NonConverged",
          "value": 0.334567626605
        },
        "GD": {
          "type": "NonConverged",
          "value": 0.33456742965499997
        }
      }
    },
    "archive": "s3://code.simiacrypt.us/tests/com/simiacryptus/mindseye/layers/cudnn/ActivationLayer/ReLu_Double/trainingTest/202004130931",
    "id": "e3e457a6-da92-4a69-a7d2-59a38fb93eb0",
    "report_type": "Components",
    "display_name": "Comparative Training",
    "target": {
      "simpleName": "ActivationLayer",
      "canonicalName": "com.simiacryptus.mindseye.layers.cudnn.ActivationLayer",
      "link": "https://github.com/SimiaCryptus/mindseye-cudnn/tree/59d5b3318556370acb2d83ee6ec123ce0fc6974f/src/main/java/com/simiacryptus/mindseye/layers/cudnn/ActivationLayer.java",
      "javaDoc": ""
    }
  }