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 119.26 seconds (2.215 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: 1768715203205
    Reset training subject: 1771188356923
    Adding measurement 1cde2f13 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=10.524999126791954;dx=-9.134855757128505E-7
    New Minimum: 10.524999126791954 > 10.52499669790268
    WOLFE (weak): th(2.154434690031884)=10.52499669790268; dx=-8.955246901888809E-7 evalInputDelta=2.428889274597168E-6
    New Minimum: 10.52499669790268 > 10.524993792176247
    WOLFE (weak): th(4.308869380063768)=10.524993792176247; dx=-8.969258723500843E-7 evalInputDelta=5.334615707397461E-6
    New Minimum: 10.524993792176247 > 10.524983152747154
    WOLFE (weak): th(12.926608140191302)=10.524983152747154; dx=-8.971797162213768E-7 evalInputDelta=1.5974044799804688E-5
    New Minimum: 10.524983152747154 > 10.524935528635979
    WOLFE (weak): th(51.70643256076521)=10.524935528635979; dx=-8.959635359691017E-7 evalInputDelta=6.35981559753418E-5
    New Minimum: 10.524935528635979 > 10.52467966079712
    WOLFE (weak): th(258.53216280382605)=10.52467966079712; dx=-8.974430726955873E-7 evalInputDelta=3.194659948348999E-4
    New Minimum: 10.52467966079712 > 10.523082196712494
    WOLFE (weak): th(1551.1929768229563)=10.523082196712494; dx=-8.949174336819401E-7 evalInputDelta=0.001916930079460144
    New Minimum: 10.523082196712494 > 10.511585742235184
    WOLFE (weak): th(10858.350837760694)=10.511585742235184; dx=-8.962298954073169E-7 evalInputDelta=0.013413384556770325
    New Minimum: 10.511585742235184 > 10.418014168739319
    WOLFE (weak): th(86866.80670208555)=10.418014168739319; dx=-8.891553372050866E-7 evalInputDelta=0.10698495805263519
    New Minimum: 10.418014168739319 > 9.607885479927063
    END: th(781801.26031877)=9.607885479927063; dx=-7.943815419361923E-7 evalInputDelta=0.917113646864891
    Fitness changed from 10.524999126791954 to 9.607885479927063
    Iteration 1 complete. Error: 9.607885479927063 Total: 33.1131; Orientation: 0.0090; Line Search: 25.7830
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/5d1a6145-b082-425a-8704-80f2ee1c0e75.jpg)
    
    Adding 

...skipping 5810 bytes...

    istory. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.746e+03, gradient 2.188e-04, dot -0.353; [a6f89191-d0c8-49f2-b42b-f1450cfce4d1 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.03172631561756134, 8.055324077606201, 9.607885479927063, 10.524999126791954
    LBFGS Accumulation History: 3 points
    Removed measurement 1d9bab6a to history. Total: 3
    th(0)=0.03172631561756134;dx=-4.7426324634118035E-8
    New Minimum: 0.03172631561756134 > -0.34310635924339294
    END: th(1.5120000000000002E7)=-0.34310635924339294; dx=-3.802484137386266E-9 evalInputDelta=0.3748326748609543
    Fitness changed from 0.03172631561756134 to -0.34310635924339294
    Iteration 9 complete. Error: -0.34310635924339294 Total: 7.8934; Orientation: 0.2181; Line Search: 5.1491
    Adding measurement 2c1b1383 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.571e+03, gradient 2.171e-04, dot -0.359; [a6f89191-d0c8-49f2-b42b-f1450cfce4d1 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.34310635924339294, 8.055324077606201, 9.607885479927063, 10.524999126791954
    LBFGS Accumulation History: 3 points
    Removed measurement 2c1b1383 to history. Total: 3
    th(0)=-0.34310635924339294;dx=-4.7022659799343064E-8
    Armijo: th(3.2575052513282087E7)=0.2250145971775055; dx=4.812636408449593E-8 evalInputDelta=-0.5681209564208984
    New Minimum: -0.34310635924339294 > -0.5026171058416367
    WOLF (strong): th(1.6287526256641043E7)=-0.5026171058416367; dx=2.141386881298697E-8 evalInputDelta=0.1595107465982437
    New Minimum: -0.5026171058416367 > -0.5576994270086288
    END: th(5429175.418880348)=-0.5576994270086288; dx=-1.9939644590993854E-8 evalInputDelta=0.2145930677652359
    Fitness changed from -0.34310635924339294 to -0.5576994270086288
    Iteration 10 complete. Error: -0.5576994270086288 Total: 12.8417; Orientation: 0.2811; Line Search: 9.8908
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/ff321a1f-ad0e-41fa-95c5-1e5dbdae8d8b.jpg)
    
    Final threshold in iteration 11: -0.5576994270086288 (> -Infinity) after 119.256s (< 3600.000s)
    

Returns:

    -0.5576994270086288