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 973.20 seconds (6.191 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: 8372438207707
    Reset training subject: 8391593490879
    Adding measurement 4ba25a51 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=0.5204705446958542;dx=-2.3218710328352823E-8
    New Minimum: 0.5204705446958542 > 0.5204705148935318
    WOLFE (weak): th(2.154434690031884)=0.5204705148935318; dx=-2.322146376754279E-8 evalInputDelta=2.9802322387695312E-8
    New Minimum: 0.5204705148935318 > 0.5204703658819199
    WOLFE (weak): th(4.308869380063768)=0.5204703658819199; dx=-2.3218049410888323E-8 evalInputDelta=1.7881393432617188E-7
    New Minimum: 0.5204703658819199 > 0.5204701274633408
    WOLFE (weak): th(12.926608140191302)=0.5204701274633408; dx=-2.321920698105452E-8 evalInputDelta=4.172325134277344E-7
    New Minimum: 0.5204701274633408 > 0.5204686522483826
    WOLFE (weak): th(51.70643256076521)=0.5204686522483826; dx=-2.3221030763934836E-8 evalInputDelta=1.8924474716186523E-6
    New Minimum: 0.5204686522483826 > 0.520461767911911
    WOLFE (weak): th(258.53216280382605)=0.520461767911911; dx=-2.321903132782573E-8 evalInputDelta=8.77678394317627E-6
    New Minimum: 0.520461767911911 > 0.5204181671142578
    WOLFE (weak): th(1551.1929768229563)=0.5204181671142578; dx=-2.3219159100698144E-8 evalInputDelta=5.237758159637451E-5
    New Minimum: 0.5204181671142578 > 0.5201039761304855
    WOLFE (weak): th(10858.350837760694)=0.5201039761304855; dx=-2.32117875452188E-8 evalInputDelta=3.6656856536865234E-4
    New Minimum: 0.5201039761304855 > 0.5175423622131348
    WOLFE (weak): th(86866.80670208555)=0.5175423622131348; dx=-2.313290604075607E-8 evalInputDelta=0.0029281824827194214
    New Minimum: 0.5175423622131348 > 0.4944986253976822
    WOLFE (weak): th(781801.26031877)=0.4944986253976822; dx=-2.244915838070038E-8 evalInputDelta=0.025971919298171997
    New Minimum: 0.4944986253976822 > 0.3035154938697815
    END: th(7818012.6031877)=0.3035154938697815; dx=-1.5408444334924494E-8 evalInputDelta=0.2169550508260727
    Fitness changed from 0.5204705446958542 to 0.3035154938697815
    Iteration 1 complete. Error: 0.303

...skipping 6308 bytes...

    4312572479248 Total: 105.6254; Orientation: 1.8719; Line Search: 82.1866
    Adding measurement 3d80458a to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.410e+04, gradient 8.518e-05, dot -0.525; [3e34112f-726a-4b24-b87f-cf8311518795 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.8694312572479248, 0.04186788201332092, 0.3035154938697815, 0.5204705446958542
    LBFGS Accumulation History: 3 points
    Removed measurement 3d80458a to history. Total: 3
    th(0)=-0.8694312572479248;dx=-7.253632300016417E-9
    New Minimum: -0.8694312572479248 > -0.9667722284793854
    END: th(2.5200000000000007E7)=-0.9667722284793854; dx=-6.491777721482627E-13 evalInputDelta=0.09734097123146057
    Fitness changed from -0.8694312572479248 to -0.9667722284793854
    Iteration 9 complete. Error: -0.9667722284793854 Total: 59.6493; Orientation: 1.8539; Line Search: 38.2636
    Adding measurement 60b3e5c7 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.516e+04, gradient 6.797e-05, dot -0.621; [3e34112f-726a-4b24-b87f-cf8311518795 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.9667722284793854, 0.04186788201332092, 0.3035154938697815, 0.5204705446958542
    LBFGS Accumulation History: 3 points
    Removed measurement 60b3e5c7 to history. Total: 3
    th(0)=-0.9667722284793854;dx=-4.6183761008683026E-9
    New Minimum: -0.9667722284793854 > -0.9915944784879684
    WOLF (strong): th(5.429175418880349E7)=-0.9915944784879684; dx=1.2794176762337994E-9 evalInputDelta=0.02482225000858307
    New Minimum: -0.9915944784879684 > -1.0452342182397842
    END: th(2.7145877094401743E7)=-1.0452342182397842; dx=-8.857261572421002E-10 evalInputDelta=0.07846198976039886
    Fitness changed from -0.9667722284793854 to -1.0452342182397842
    Iteration 10 complete. Error: -1.0452342182397842 Total: 80.4903; Orientation: 1.8602; Line Search: 59.8418
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/217c64d7-d3d8-4ee4-a059-e7867bd8bd1a.jpg)
    
    Final threshold in iteration 11: -1.0452342182397842 (> -Infinity) after 973.198s (< 3600.000s)
    

Returns:

    -1.0452342182397842