Iteration 1 Iteration 1

Iteration 2 Iteration 2

Iteration 3 Iteration 3

Iteration 4 Iteration 4

Iteration 5 Iteration 5

Iteration 10 Iteration 10

Code from BasicOptimizer.scala:88 executed in 118.11 seconds (2.295 gc):

    val lineSearchInstance: LineSearchStrategy = lineSearchFactory
    val trainer = new IterativeTrainer(trainable)
    trainer.setOrientation(orientation())
    trainer.setMonitor(new TrainingMonitor() {
      override def clear(): Unit = trainingMonitor.clear()
  
      override def log(msg: String): Unit = {
        trainingMonitor.log(msg)
        BasicOptimizer.this.log(msg)
      }
  
      override def onStepFail(currentPoint: Step): Boolean = {
        BasicOptimizer.this.onStepFail(trainable.addRef().asInstanceOf[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.addRef().asInstanceOf[Trainable], currentPoint)
        trainingMonitor.onStepComplete(currentPoint)
        super.onStepComplete(currentPoint)
      }
    })
    trainer.setTimeout(trainingMinutes, TimeUnit.MINUTES)
    trainer.setMaxIterations(trainingIterations)
    trainer.setLineSearchFactory((_: CharSequence) => lineSearchInstance)
    trainer.setTerminateThreshold(java.lang.Double.NEGATIVE_INFINITY)
    val result = trainer.run.asInstanceOf[lang.Double]
    trainer.freeRef()
    result

Logging:

    Reset training subject: 2657380361108
    Reset training subject: 2659834017470
    Adding measurement 491e8864 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=2.22367987036705;dx=-2.0454529207868077E-7
    New Minimum: 2.22367987036705 > 2.223679319024086
    WOLFE (weak): th(2.154434690031884)=2.223679319024086; dx=-2.0446396993005403E-7 evalInputDelta=5.513429641723633E-7
    New Minimum: 2.223679319024086 > 2.223678708076477
    WOLFE (weak): th(4.308869380063768)=2.223678708076477; dx=-2.0455389008451053E-7 evalInputDelta=1.1622905731201172E-6
    New Minimum: 2.223678708076477 > 2.2236763536930084
    WOLFE (weak): th(12.926608140191302)=2.2236763536930084; dx=-2.0465611654766363E-7 evalInputDelta=3.516674041748047E-6
    New Minimum: 2.2236763536930084 > 2.223666489124298
    WOLFE (weak): th(51.70643256076521)=2.223666489124298; dx=-2.0320153271706293E-7 evalInputDelta=1.3381242752075195E-5
    New Minimum: 2.223666489124298 > 2.2236133217811584
    WOLFE (weak): th(258.53216280382605)=2.2236133217811584; dx=-2.045454254461782E-7 evalInputDelta=6.654858589172363E-5
    New Minimum: 2.2236133217811584 > 2.223281115293503
    WOLFE (weak): th(1551.1929768229563)=2.223281115293503; dx=-2.0453598815583533E-7 evalInputDelta=3.987550735473633E-4
    New Minimum: 2.223281115293503 > 2.220888152718544
    WOLFE (weak): th(10858.350837760694)=2.220888152718544; dx=-2.0430204032479964E-7 evalInputDelta=0.0027917176485061646
    New Minimum: 2.220888152718544 > 2.2014588862657547
    WOLFE (weak): th(86866.80670208555)=2.2014588862657547; dx=-2.0234114531039236E-7 evalInputDelta=0.02222098410129547
    New Minimum: 2.2014588862657547 > 2.0333630591630936
    END: th(781801.26031877)=2.0333630591630936; dx=-1.8335052450396672E-7 evalInputDelta=0.1903168112039566
    Fitness changed from 2.22367987036705 to 2.0333630591630936
    Iteration 1 complete. Error: 2.0333630591630936 Total: 32.7894; Orientation: 0.0088; Line Search: 25.3155
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/38084f4f-2e6a-4ebb-b9b0-4c50ad05081e.jpg)
    
    Addin

...skipping 5797 bytes...

    o history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.176e+03, gradient 1.947e-04, dot -0.416; [3df338f3-6ddc-4344-b3b3-73941fb0bb1f = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.9153652489185333, 1.7082927078008652, 2.0333630591630936, 2.22367987036705
    LBFGS Accumulation History: 3 points
    Removed measurement bda2c14 to history. Total: 3
    th(0)=-0.9153652489185333;dx=-3.7779786724565446E-8
    New Minimum: -0.9153652489185333 > -0.9854956567287445
    WOLF (strong): th(1.5120000000000004E7)=-0.9854956567287445; dx=1.6375119337361134E-8 evalInputDelta=0.07013040781021118
    New Minimum: -0.9854956567287445 > -1.0848155468702316
    END: th(7560000.000000002)=-1.0848155468702316; dx=-4.050190530140585E-9 evalInputDelta=0.1694502979516983
    Fitness changed from -0.9153652489185333 to -1.0848155468702316
    Iteration 9 complete. Error: -1.0848155468702316 Total: 10.2250; Orientation: 0.2168; Line Search: 7.6241
    Adding measurement 42ecfa93 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 5.079e+03, gradient 1.364e-04, dot -0.556; [3df338f3-6ddc-4344-b3b3-73941fb0bb1f = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.0848155468702316, 1.7082927078008652, 2.0333630591630936, 2.22367987036705
    LBFGS Accumulation History: 3 points
    Removed measurement 42ecfa93 to history. Total: 3
    th(0)=-1.0848155468702316;dx=-1.857665245145063E-8
    New Minimum: -1.0848155468702316 > -1.2061441987752914
    WOLF (strong): th(1.6287526256641045E7)=-1.2061441987752914; dx=2.8871024447075785E-9 evalInputDelta=0.12132865190505981
    END: th(8143763.128320523)=-1.1985916197299957; dx=-6.452719520945068E-9 evalInputDelta=0.1137760728597641
    Fitness changed from -1.0848155468702316 to -1.2061441987752914
    Iteration 10 complete. Error: -1.2061441987752914 Total: 9.7933; Orientation: 0.2176; Line Search: 7.2524
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/4226bffa-dcbf-4922-a7c1-1d19a3ef9380.jpg)
    
    Final threshold in iteration 11: -1.2061441987752914 (> -Infinity) after 118.110s (< 3600.000s)
    

Returns:

    -1.2061441987752914