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 136.03 seconds (3.658 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: 1295202097153
    Reset training subject: 1298394434527
    Adding measurement 48ca57cb to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=11.78841844201088;dx=-1.4200067752343383E-7
    New Minimum: 11.78841844201088 > 11.788418091833591
    WOLFE (weak): th(2.154434690031884)=11.788418091833591; dx=-1.4170457687992856E-7 evalInputDelta=3.501772880554199E-7
    New Minimum: 11.788418091833591 > 11.788417033851147
    WOLFE (weak): th(4.308869380063768)=11.788417033851147; dx=-1.4163532909844425E-7 evalInputDelta=1.4081597328186035E-6
    New Minimum: 11.788417033851147 > 11.788414642214775
    WOLFE (weak): th(12.926608140191302)=11.788414642214775; dx=-1.419219570390668E-7 evalInputDelta=3.7997961044311523E-6
    New Minimum: 11.788414642214775 > 11.78840110450983
    WOLFE (weak): th(51.70643256076521)=11.78840110450983; dx=-1.4135864371016618E-7 evalInputDelta=1.7337501049041748E-5
    New Minimum: 11.78840110450983 > 11.788330741226673
    WOLFE (weak): th(258.53216280382605)=11.788330741226673; dx=-1.4184157666539288E-7 evalInputDelta=8.770078420639038E-5
    New Minimum: 11.788330741226673 > 11.787889748811722
    WOLFE (weak): th(1551.1929768229563)=11.787889748811722; dx=-1.418630753308062E-7 evalInputDelta=5.286931991577148E-4
    New Minimum: 11.787889748811722 > 11.784717909991741
    WOLFE (weak): th(10858.350837760694)=11.784717909991741; dx=-1.418854492142667E-7 evalInputDelta=0.003700532019138336
    New Minimum: 11.784717909991741 > 11.758892245590687
    WOLFE (weak): th(86866.80670208555)=11.758892245590687; dx=-1.4082557915323922E-7 evalInputDelta=0.02952619642019272
    New Minimum: 11.758892245590687 > 11.52491344511509
    WOLFE (weak): th(781801.26031877)=11.52491344511509; dx=-1.3616025673464414E-7 evalInputDelta=0.2635049968957901
    New Minimum: 11.52491344511509 > 9.598679721355438
    END: th(7818012.6031877)=9.598679721355438; dx=-7.216498844571082E-8 evalInputDelta=2.1897387206554413
    Fitness changed from 11.78841844201088 to 9.598679721355438
    Iteration 1 complete. Error: 9.5986797213554

...skipping 6082 bytes...

    from 0.8831278085708618 to 0.5896726250648499
    Iteration 8 complete. Error: 0.5896726250648499 Total: 14.5323; Orientation: 0.1908; Line Search: 10.9012
    Adding measurement 7b23154f to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.931e+03, gradient 1.025e-04, dot -0.267; [fa45d459-1c47-4700-89bb-afd7fe470bf5 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.5896726250648499, 6.553332269191742, 9.598679721355438, 11.78841844201088
    LBFGS Accumulation History: 3 points
    Removed measurement 7b23154f to history. Total: 3
    th(0)=0.5896726250648499;dx=-1.0211077830672846E-8
    New Minimum: 0.5896726250648499 > 0.41968855261802673
    END: th(3.7800000000000015E7)=0.41968855261802673; dx=-3.4494277905916947E-9 evalInputDelta=0.16998407244682312
    Fitness changed from 0.5896726250648499 to 0.41968855261802673
    Iteration 9 complete. Error: 0.41968855261802673 Total: 8.5956; Orientation: 0.1809; Line Search: 5.6638
    Adding measurement 2aad75b2 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.656e+03, gradient 9.886e-05, dot -0.256; [fa45d459-1c47-4700-89bb-afd7fe470bf5 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.41968855261802673, 6.553332269191742, 9.598679721355438, 11.78841844201088
    LBFGS Accumulation History: 3 points
    Removed measurement 2aad75b2 to history. Total: 3
    th(0)=0.41968855261802673;dx=-9.475548156272404E-9
    Armijo: th(8.143763128320524E7)=0.7802872061729431; dx=5.876128332332601E-10 evalInputDelta=-0.3605986535549164
    New Minimum: 0.41968855261802673 > 0.37667757272720337
    END: th(4.071881564160262E7)=0.37667757272720337; dx=-2.116023389920099E-9 evalInputDelta=0.043010979890823364
    Fitness changed from 0.41968855261802673 to 0.37667757272720337
    Iteration 10 complete. Error: 0.37667757272720337 Total: 11.3372; Orientation: 0.1403; Line Search: 8.3839
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/72a9f7d3-84ce-46e2-9d17-b9bd507bb345.jpg)
    
    Final threshold in iteration 11: 0.37667757272720337 (> -Infinity) after 136.024s (< 1800.000s)
    

Returns:

    0.37667757272720337