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 16.64 seconds (0.604 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: 916960299249800
    Reset training subject: 916960903593700
    Adding measurement 21625af9 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=2.6417967677116394;dx=-8.054714358243059E-6
    New Minimum: 2.6417967677116394 > 2.64178416877985
    WOLFE (weak): th(2.154434690031884)=2.64178416877985; dx=-8.053877892269106E-6 evalInputDelta=1.2598931789398193E-5
    New Minimum: 2.64178416877985 > 2.641771338880062
    WOLFE (weak): th(4.308869380063768)=2.641771338880062; dx=-8.053900723504568E-6 evalInputDelta=2.5428831577301025E-5
    New Minimum: 2.641771338880062 > 2.641721189022064
    WOLFE (weak): th(12.926608140191302)=2.641721189022064; dx=-8.052259657219666E-6 evalInputDelta=7.557868957519531E-5
    New Minimum: 2.641721189022064 > 2.6414932534098625
    WOLFE (weak): th(51.70643256076521)=2.6414932534098625; dx=-8.050606324391252E-6 evalInputDelta=3.03514301776886E-4
    New Minimum: 2.6414932534098625 > 2.64027863740921
    WOLFE (weak): th(258.53216280382605)=2.64027863740921; dx=-8.050145492203655E-6 evalInputDelta=0.0015181303024291992
    New Minimum: 2.64027863740921 > 2.6326721906661987
    WOLFE (weak): th(1551.1929768229563)=2.6326721906661987; dx=-8.012159340807153E-6 evalInputDelta=0.009124577045440674
    New Minimum: 2.6326721906661987 > 2.5778156220912933
    WOLFE (weak): th(10858.350837760694)=2.5778156220912933; dx=-7.628950581604424E-6 evalInputDelta=0.06398114562034607
    New Minimum: 2.5778156220912933 > 2.224301964044571
    END: th(86866.80670208555)=2.224301964044571; dx=-3.6609607568811406E-6 evalInputDelta=0.4174948036670685
    Fitness changed from 2.6417967677116394 to 2.224301964044571
    Iteration 1 complete. Error: 2.224301964044571 Total: 6.9576; Orientation: 0.0035; Line Search: 5.3037
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/e48d15f9-f467-4465-a795-929cf941aab4.jpg)
    
    Adding measurement 57cb640d to history. Total: 1
    LBFGS Accumulation History: 2 points
    th(0)=2.224301964044571;dx=-7.090208505089599E-6
    New Minimum: 2.224

...skipping 1616 bytes...

    Fitness changed from 1.4363535344600677 to 1.186357021331787
    Iteration 4 complete. Error: 1.186357021331787 Total: 1.8753; Orientation: 0.1042; Line Search: 1.1813
    <a id="p-9"></a>Iteration 4
    <a id="p-8"></a>![Iteration 4](etc/9dbd746e-c68c-435e-99a1-0ed546bcd2b3.jpg)
    
    Adding measurement 563b1ecf to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 8.828e+02, gradient 8.901e-04, dot -0.781; [8dc6dc15-acb4-4da9-bc4d-cce3f0c6320e = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 2.224301964044571, 1.7653005421161652, 1.4363535344600677, 1.186357021331787
    LBFGS Accumulation History: 3 points
    Removed measurement 57cb640d to history. Total: 4
    th(0)=1.186357021331787;dx=-7.922026375613028E-7
    New Minimum: 1.186357021331787 > 0.9400263726711273
    END: th(1871488.617712673)=0.9400263726711273; dx=-5.938361478720784E-8 evalInputDelta=0.2463306486606598
    Fitness changed from 1.186357021331787 to 0.9400263726711273
    Iteration 5 complete. Error: 0.9400263726711273 Total: 1.8759; Orientation: 0.1050; Line Search: 1.1735
    <a id="p-11"></a>Iteration 5
    <a id="p-10"></a>![Iteration 5](etc/1372cf69-2ce5-4e5d-a2a4-572f8f358054.jpg)
    
    Adding measurement 5d11bf2c to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.237e+03, gradient 6.837e-04, dot -0.779; [8dc6dc15-acb4-4da9-bc4d-cce3f0c6320e = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.7653005421161652, 1.4363535344600677, 1.186357021331787, 0.9400263726711273
    LBFGS Accumulation History: 3 points
    Removed measurement f5a7251 to history. Total: 4
    th(0)=0.9400263726711273;dx=-4.674478004376978E-7
    New Minimum: 0.9400263726711273 > 0.7466156482696533
    END: th(4032000.0000000014)=0.7466156482696533; dx=-9.094720227578675E-9 evalInputDelta=0.193410724401474
    Fitness changed from 0.9400263726711273 to 0.7466156482696533
    Iteration 6 complete. Error: 0.7466156482696533 Total: 2.3895; Orientation: 0.1060; Line Search: 1.6909
    Final threshold in iteration 7: 0.7466156482696533 (> -Infinity) after 16.643s (< 720.000s)
    

Returns:

    0.7466156482696533