Iteration 1 Iteration 1

Iteration 2 Iteration 2

Iteration 3 Iteration 3

Iteration 4 Iteration 4

Iteration 5 Iteration 5

Code from BasicOptimizer.scala:75 executed in 130.32 seconds (0.983 gc):

    val lineSearchInstance: LineSearchStrategy = lineSearchFactory
    IterativeTrainer.wrap(trainable)
      .setOrientation(orientation())
      .setMonitor(new TrainingMonitor() {
        override def clear(): Unit = trainingMonitor.clear()
  
        override def log(msg: String): Unit = trainingMonitor.log(msg)
  
        override def onStepFail(currentPoint: Step): Boolean = {
          BasicOptimizer.this.onStepFail(trainable, currentPoint)
        }
  
        override def onStepComplete(currentPoint: Step): Unit = {
          if (0 < logEvery && (0 == currentPoint.iteration % logEvery || currentPoint.iteration < logEvery)) {
            val image = currentImage
            timelineAnimation += image
            val caption = "Iteration " + currentPoint.iteration
            out.p(caption + "\n" + out.jpg(image, caption))
          }
          BasicOptimizer.this.onStepComplete(trainable, currentPoint)
          trainingMonitor.onStepComplete(currentPoint)
          super.onStepComplete(currentPoint)
        }
      })
      .setTimeout(trainingMinutes, TimeUnit.MINUTES)
      .setMaxIterations(trainingIterations)
      .setLineSearchFactory((_: CharSequence) => lineSearchInstance)
      .setTerminateThreshold(java.lang.Double.NEGATIVE_INFINITY)
      .runAndFree
      .asInstanceOf[lang.Double]

Logging:

    Reset training subject: 922128276589400
    Reset training subject: 922132714387700
    Adding measurement 1d743ebc to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=0.9987005740404129;dx=-1.6713688943894371E-7
    New Minimum: 0.9987005740404129 > 0.9987004548311234
    WOLFE (weak): th(2.154434690031884)=0.9987004548311234; dx=-1.6713703972971214E-7 evalInputDelta=1.1920928955078125E-7
    New Minimum: 0.9987004548311234 > 0.9987003207206726
    WOLFE (weak): th(4.308869380063768)=0.9987003207206726; dx=-1.671367027540444E-7 evalInputDelta=2.5331974029541016E-7
    New Minimum: 0.9987003207206726 > 0.9986992627382278
    WOLFE (weak): th(12.926608140191302)=0.9986992627382278; dx=-1.6713605392416393E-7 evalInputDelta=1.3113021850585938E-6
    New Minimum: 0.9986992627382278 > 0.9986952692270279
    WOLFE (weak): th(51.70643256076521)=0.9986952692270279; dx=-1.6713852885712961E-7 evalInputDelta=5.304813385009766E-6
    New Minimum: 0.9986952692270279 > 0.9986749589443207
    WOLFE (weak): th(258.53216280382605)=0.9986749589443207; dx=-1.6712373487691878E-7 evalInputDelta=2.561509609222412E-5
    New Minimum: 0.9986749589443207 > 0.9985468685626984
    WOLFE (weak): th(1551.1929768229563)=0.9985468685626984; dx=-1.6706752024538005E-7 evalInputDelta=1.5370547771453857E-4
    New Minimum: 0.9985468685626984 > 0.9976255595684052
    WOLFE (weak): th(10858.350837760694)=0.9976255595684052; dx=-1.6675469980494153E-7 evalInputDelta=0.0010750144720077515
    New Minimum: 0.9976255595684052 > 0.9901918321847916
    WOLFE (weak): th(86866.80670208555)=0.9901918321847916; dx=-1.629695151610109E-7 evalInputDelta=0.008508741855621338
    New Minimum: 0.9901918321847916 > 0.9310942590236664
    END: th(781801.26031877)=0.9310942590236664; dx=-1.295550919908278E-7 evalInputDelta=0.06760631501674652
    Fitness changed from 0.9987005740404129 to 0.9310942590236664
    Iteration 1 complete. Error: 0.9310942590236664 Total: 57.2271; Orientation: 0.0324; Line Search: 44.3363
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1]

...skipping 1930 bytes...

    otal: 13.9551; Orientation: 0.9684; Line Search: 8.6883
    <a id="p-9"></a>Iteration 4
    <a id="p-8"></a>![Iteration 4](etc/62d43ce7-a03b-4cd5-b681-d28c0685bf10.jpg)
    
    Adding measurement 19a20895 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.113e+03, gradient 2.750e-04, dot -0.703; [68f61e86-1622-49d3-9823-96b5c4557f45 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.9310942590236664, 0.8393487632274628, 0.7377278506755829, 0.6499077826738358
    LBFGS Accumulation History: 3 points
    Removed measurement 12070da2 to history. Total: 4
    th(0)=0.6499077826738358;dx=-7.56291052898295E-8
    New Minimum: 0.6499077826738358 > 0.6340043246746063
    END: th(1.684339755941405E7)=0.6340043246746063; dx=-7.890411173070995E-9 evalInputDelta=0.01590345799922943
    Fitness changed from 0.6499077826738358 to 0.6340043246746063
    Iteration 5 complete. Error: 0.6340043246746063 Total: 14.1349; Orientation: 0.9664; Line Search: 8.7414
    <a id="p-11"></a>Iteration 5
    <a id="p-10"></a>![Iteration 5](etc/6db13006-b91f-491e-8833-cad08eb064f7.jpg)
    
    Adding measurement 6396a2dd to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.364e+03, gradient 2.862e-04, dot -0.668; [68f61e86-1622-49d3-9823-96b5c4557f45 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.8393487632274628, 0.7377278506755829, 0.6499077826738358, 0.6340043246746063
    LBFGS Accumulation History: 3 points
    Removed measurement 310f77c4 to history. Total: 4
    th(0)=0.6340043246746063;dx=-8.191478568689401E-8
    Armijo: th(3.6288E7)=0.7829135656356812; dx=-1.2902039845028618E-9 evalInputDelta=-0.14890924096107483
    New Minimum: 0.6340043246746063 > 0.5191021859645844
    END: th(1.8144E7)=0.5191021859645844; dx=-6.807060251498459E-9 evalInputDelta=0.11490213871002197
    Fitness changed from 0.6340043246746063 to 0.5191021859645844
    Iteration 6 complete. Error: 0.5191021859645844 Total: 19.0141; Orientation: 1.0098; Line Search: 13.1995
    Final threshold in iteration 7: 0.5191021859645844 (> -Infinity) after 130.317s (< 720.000s)
    

Returns:

    0.5191021859645844