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.64 seconds (2.228 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: 2348600600617
    Reset training subject: 2351007989108
    Adding measurement 35c5ecc1 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=10.610761567950249;dx=-9.567709807557188E-7
    New Minimum: 10.610761567950249 > 10.610758513212204
    WOLFE (weak): th(2.154434690031884)=10.610758513212204; dx=-9.401809271787217E-7 evalInputDelta=3.0547380447387695E-6
    New Minimum: 10.610758513212204 > 10.610755756497383
    WOLFE (weak): th(4.308869380063768)=10.610755756497383; dx=-9.41839133848029E-7 evalInputDelta=5.811452865600586E-6
    New Minimum: 10.610755756497383 > 10.610744670033455
    WOLFE (weak): th(12.926608140191302)=10.610744670033455; dx=-9.415940654909508E-7 evalInputDelta=1.6897916793823242E-5
    New Minimum: 10.610744670033455 > 10.610694468021393
    WOLFE (weak): th(51.70643256076521)=10.610694468021393; dx=-9.378402018689899E-7 evalInputDelta=6.7099928855896E-5
    New Minimum: 10.610694468021393 > 10.610425978899002
    WOLFE (weak): th(258.53216280382605)=10.610425978899002; dx=-9.41854494747907E-7 evalInputDelta=3.3558905124664307E-4
    New Minimum: 10.610425978899002 > 10.6087476760149
    WOLFE (weak): th(1551.1929768229563)=10.6087476760149; dx=-9.418125276165616E-7 evalInputDelta=0.0020138919353485107
    New Minimum: 10.6087476760149 > 10.596672609448433
    WOLFE (weak): th(10858.350837760694)=10.596672609448433; dx=-9.394098016755551E-7 evalInputDelta=0.014088958501815796
    New Minimum: 10.596672609448433 > 10.49841433763504
    WOLFE (weak): th(86866.80670208555)=10.49841433763504; dx=-9.33064021548561E-7 evalInputDelta=0.11234723031520844
    New Minimum: 10.49841433763504 > 9.645014330744743
    END: th(781801.26031877)=9.645014330744743; dx=-8.317785335637205E-7 evalInputDelta=0.9657472372055054
    Fitness changed from 10.610761567950249 to 9.645014330744743
    Iteration 1 complete. Error: 9.645014330744743 Total: 33.0936; Orientation: 0.0090; Line Search: 25.5719
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/82feb65d-a629-4d7f-aebc-33d7d963377a.jpg)
    
    Adding mea

...skipping 5782 bytes...

    ory. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.542e+03, gradient 2.263e-04, dot -0.349; [57e31a92-5da7-4051-a7ff-0f55b24da7a5 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.11949354410171509, 8.048895180225372, 9.645014330744743, 10.610761567950249
    LBFGS Accumulation History: 3 points
    Removed measurement 59999bb6 to history. Total: 3
    th(0)=0.11949354410171509;dx=-5.095638831869469E-8
    New Minimum: 0.11949354410171509 > -0.22896724939346313
    END: th(1.5120000000000002E7)=-0.22896724939346313; dx=-5.1948934382798486E-11 evalInputDelta=0.3484607934951782
    Fitness changed from 0.11949354410171509 to -0.22896724939346313
    Iteration 9 complete. Error: -0.22896724939346313 Total: 7.8023; Orientation: 0.2150; Line Search: 4.9441
    Adding measurement 59e1cb44 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.650e+03, gradient 2.371e-04, dot -0.352; [57e31a92-5da7-4051-a7ff-0f55b24da7a5 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.22896724939346313, 8.048895180225372, 9.645014330744743, 10.610761567950249
    LBFGS Accumulation History: 3 points
    Removed measurement 59e1cb44 to history. Total: 3
    th(0)=-0.22896724939346313;dx=-5.601052864296607E-8
    Armijo: th(3.2575052513282087E7)=0.8025830388069153; dx=6.7777262602403E-8 evalInputDelta=-1.0315502882003784
    New Minimum: -0.22896724939346313 > -0.30646106600761414
    WOLF (strong): th(1.6287526256641043E7)=-0.30646106600761414; dx=3.7425235658779E-8 evalInputDelta=0.077493816614151
    New Minimum: -0.30646106600761414 > -0.47173795104026794
    END: th(5429175.418880348)=-0.47173795104026794; dx=-1.880341340561691E-8 evalInputDelta=0.2427707016468048
    Fitness changed from -0.22896724939346313 to -0.47173795104026794
    Iteration 10 complete. Error: -0.47173795104026794 Total: 13.2315; Orientation: 0.3429; Line Search: 10.2883
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/154f4bb1-6e7e-48bc-a6a3-99164c1d5242.jpg)
    
    Final threshold in iteration 11: -0.47173795104026794 (> -Infinity) after 118.637s (< 3600.000s)
    

Returns:

    -0.47173795104026794