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 15.97 seconds (0.391 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: 906031771852000
    Reset training subject: 906032449128200
    Adding measurement 5bb45afc to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=1.7080485224723816;dx=-2.9102613641890225E-7
    New Minimum: 1.7080485224723816 > 1.7080480456352234
    WOLFE (weak): th(2.154434690031884)=1.7080480456352234; dx=-2.9102315798896103E-7 evalInputDelta=4.76837158203125E-7
    New Minimum: 1.7080480456352234 > 1.7080474346876144
    WOLFE (weak): th(4.308869380063768)=1.7080474346876144; dx=-2.910231988621816E-7 evalInputDelta=1.087784767150879E-6
    New Minimum: 1.7080474346876144 > 1.708044782280922
    WOLFE (weak): th(12.926608140191302)=1.708044782280922; dx=-2.910235732981719E-7 evalInputDelta=3.7401914596557617E-6
    New Minimum: 1.708044782280922 > 1.7080335766077042
    WOLFE (weak): th(51.70643256076521)=1.7080335766077042; dx=-2.910267445335985E-7 evalInputDelta=1.49458646774292E-5
    New Minimum: 1.7080335766077042 > 1.7079735398292542
    WOLFE (weak): th(258.53216280382605)=1.7079735398292542; dx=-2.9103702486959843E-7 evalInputDelta=7.49826431274414E-5
    New Minimum: 1.7079735398292542 > 1.7075971066951752
    WOLFE (weak): th(1551.1929768229563)=1.7075971066951752; dx=-2.9111242942889173E-7 evalInputDelta=4.514157772064209E-4
    New Minimum: 1.7075971066951752 > 1.7048838883638382
    WOLFE (weak): th(10858.350837760694)=1.7048838883638382; dx=-2.9194874939407946E-7 evalInputDelta=0.003164634108543396
    New Minimum: 1.7048838883638382 > 1.6825695186853409
    WOLFE (weak): th(86866.80670208555)=1.6825695186853409; dx=-2.944568344367644E-7 evalInputDelta=0.02547900378704071
    New Minimum: 1.6825695186853409 > 1.4924086779356003
    END: th(781801.26031877)=1.4924086779356003; dx=-2.4813358582958716E-7 evalInputDelta=0.2156398445367813
    Fitness changed from 1.7080485224723816 to 1.4924086779356003
    Iteration 1 complete. Error: 1.4924086779356003 Total: 6.9464; Orientation: 0.0035; Line Search: 5.2456
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/33a91f44-8

...skipping 1918 bytes...

    Orientation: 0.1034; Line Search: 1.0959
    <a id="p-9"></a>Iteration 4
    <a id="p-8"></a>![Iteration 4](etc/d9a9f19c-953a-4263-acc7-58eb4602f6a7.jpg)
    
    Adding measurement 52a23575 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 7.749e+03, gradient 2.002e-04, dot -0.962; [ac8be6fe-fe29-4b15-959c-4ce0a3559ead = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.4924086779356003, 1.168387994170189, 0.8096969425678253, 0.3398881256580353
    LBFGS Accumulation History: 3 points
    Removed measurement bb160fb to history. Total: 4
    th(0)=0.3398881256580353;dx=-4.0063842716314406E-8
    New Minimum: 0.3398881256580353 > -0.1289495974779129
    END: th(1.684339755941405E7)=-0.1289495974779129; dx=-1.7160343570447153E-8 evalInputDelta=0.4688377231359482
    Fitness changed from 0.3398881256580353 to -0.1289495974779129
    Iteration 5 complete. Error: -0.1289495974779129 Total: 2.0002; Orientation: 0.1028; Line Search: 1.0609
    <a id="p-11"></a>Iteration 5
    <a id="p-10"></a>![Iteration 5](etc/5bc27d26-368b-489e-919c-fe2d228a75aa.jpg)
    
    Adding measurement 7e305953 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.580e+03, gradient 9.644e-05, dot -0.980; [ac8be6fe-fe29-4b15-959c-4ce0a3559ead = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.168387994170189, 0.8096969425678253, 0.3398881256580353, -0.1289495974779129
    LBFGS Accumulation History: 3 points
    Removed measurement 65852d05 to history. Total: 4
    th(0)=-0.1289495974779129;dx=-9.300984822124878E-9
    New Minimum: -0.1289495974779129 > -0.2867303937673569
    WOLF (strong): th(3.6288E7)=-0.2867303937673569; dx=2.0967959900752833E-10 evalInputDelta=0.15778079628944397
    END: th(1.8144E7)=-0.2482549399137497; dx=-4.437477823626044E-9 evalInputDelta=0.11930534243583679
    Fitness changed from -0.1289495974779129 to -0.2867303937673569
    Iteration 6 complete. Error: -0.2867303937673569 Total: 2.1889; Orientation: 0.1051; Line Search: 1.5593
    Final threshold in iteration 7: -0.2867303937673569 (> -Infinity) after 15.964s (< 720.000s)
    

Returns:

    -0.2867303937673569