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 13.45 seconds (0.340 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: 909589352950300
    Reset training subject: 909589829586800
    Adding measurement 1693b8dc to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=1.5682096630334854;dx=-1.0197441640945738E-6
    New Minimum: 1.5682096630334854 > 1.5682082027196884
    WOLFE (weak): th(2.154434690031884)=1.5682082027196884; dx=-1.0197473899308392E-6 evalInputDelta=1.4603137969970703E-6
    New Minimum: 1.5682082027196884 > 1.5682066231966019
    WOLFE (weak): th(4.308869380063768)=1.5682066231966019; dx=-1.0197475551846318E-6 evalInputDelta=3.039836883544922E-6
    New Minimum: 1.5682066231966019 > 1.5682007670402527
    WOLFE (weak): th(12.926608140191302)=1.5682007670402527; dx=-1.0197298011983554E-6 evalInputDelta=8.89599323272705E-6
    New Minimum: 1.5682007670402527 > 1.568174570798874
    WOLFE (weak): th(51.70643256076521)=1.568174570798874; dx=-1.0196371100845003E-6 evalInputDelta=3.509223461151123E-5
    New Minimum: 1.568174570798874 > 1.5680343061685562
    WOLFE (weak): th(258.53216280382605)=1.5680343061685562; dx=-1.0188037060384479E-6 evalInputDelta=1.7535686492919922E-4
    New Minimum: 1.5680343061685562 > 1.5671572238206863
    WOLFE (weak): th(1551.1929768229563)=1.5671572238206863; dx=-1.0161972993900048E-6 evalInputDelta=0.0010524392127990723
    New Minimum: 1.5671572238206863 > 1.560774303972721
    WOLFE (weak): th(10858.350837760694)=1.560774303972721; dx=-9.991251425830749E-7 evalInputDelta=0.007435359060764313
    New Minimum: 1.560774303972721 > 1.5075277090072632
    END: th(86866.80670208555)=1.5075277090072632; dx=-8.18167116692432E-7 evalInputDelta=0.06068195402622223
    Fitness changed from 1.5682096630334854 to 1.5075277090072632
    Iteration 1 complete. Error: 1.5075277090072632 Total: 5.7660; Orientation: 0.0035; Line Search: 4.4143
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/4873659d-1a26-4fe5-b241-dc0aeb353076.jpg)
    
    Adding measurement 3ed6437b to history. Total: 1
    LBFGS Accumulation History: 2 points
    th(0)=1.5075277090072632;dx=-1.10092217502978

...skipping 1651 bytes...

    ess changed from 1.1565120816230774 to 0.9089703559875488
    Iteration 4 complete. Error: 0.9089703559875488 Total: 1.7046; Orientation: 0.1061; Line Search: 1.1303
    <a id="p-9"></a>Iteration 4
    <a id="p-8"></a>![Iteration 4](etc/7415a36c-0d4e-4890-8690-b93bf6e94c8d.jpg)
    
    Adding measurement 2125bb4e to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.609e+03, gradient 4.585e-04, dot -0.981; [d321e718-bd7d-4ff4-85a0-45bfface7b62 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.5075277090072632, 1.3694100677967072, 1.1565120816230774, 0.9089703559875488
    LBFGS Accumulation History: 3 points
    Removed measurement 3ed6437b to history. Total: 4
    th(0)=0.9089703559875488;dx=-2.1021474910555415E-7
    New Minimum: 0.9089703559875488 > 0.617662638425827
    END: th(1871488.617712673)=0.617662638425827; dx=-1.3012440717986305E-7 evalInputDelta=0.2913077175617218
    Fitness changed from 0.9089703559875488 to 0.617662638425827
    Iteration 5 complete. Error: 0.617662638425827 Total: 1.5084; Orientation: 0.1079; Line Search: 0.9181
    <a id="p-11"></a>Iteration 5
    <a id="p-10"></a>![Iteration 5](etc/6eab83e4-5b52-4775-ad80-2296a41cd842.jpg)
    
    Adding measurement 6074ed28 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 2.712e+03, gradient 3.373e-04, dot -0.982; [d321e718-bd7d-4ff4-85a0-45bfface7b62 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.3694100677967072, 1.1565120816230774, 0.9089703559875488, 0.617662638425827
    LBFGS Accumulation History: 3 points
    Removed measurement 75b76c78 to history. Total: 4
    th(0)=0.617662638425827;dx=-1.137751786835657E-7
    New Minimum: 0.617662638425827 > 0.2840883135795593
    END: th(4032000.0000000014)=0.2840883135795593; dx=-6.604725990349644E-8 evalInputDelta=0.3335743248462677
    Fitness changed from 0.617662638425827 to 0.2840883135795593
    Iteration 6 complete. Error: 0.2840883135795593 Total: 1.4721; Orientation: 0.1071; Line Search: 0.9109
    Final threshold in iteration 7: 0.2840883135795593 (> -Infinity) after 13.452s (< 720.000s)
    

Returns:

    0.2840883135795593