Iteration 1 Iteration 1

Iteration 2 Iteration 2

Iteration 3 Iteration 3

Iteration 4 Iteration 4

Iteration 5 Iteration 5

Code from BasicOptimizer.scala:88 executed in 1816.83 seconds (5.096 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: 22288445918425
    Reset training subject: 22339538504822
    Adding measurement eb3cea6 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=9.011332757771015;dx=-5.683442033152347E-7
    New Minimum: 9.011332757771015 > 9.011330373585224
    WOLFE (weak): th(2.154434690031884)=9.011330373585224; dx=-5.523653479864325E-7 evalInputDelta=2.384185791015625E-6
    New Minimum: 9.011330373585224 > 9.011328615248203
    WOLFE (weak): th(4.308869380063768)=9.011328615248203; dx=-5.476354661588377E-7 evalInputDelta=4.1425228118896484E-6
    New Minimum: 9.011328615248203 > 9.011320620775223
    WOLFE (weak): th(12.926608140191302)=9.011320620775223; dx=-5.475105547785252E-7 evalInputDelta=1.2136995792388916E-5
    New Minimum: 9.011320620775223 > 9.011284306645393
    WOLFE (weak): th(51.70643256076521)=9.011284306645393; dx=-5.475606192698869E-7 evalInputDelta=4.8451125621795654E-5
    New Minimum: 9.011284306645393 > 9.011091962456703
    WOLFE (weak): th(258.53216280382605)=9.011091962456703; dx=-5.49994270698641E-7 evalInputDelta=2.407953143119812E-4
    New Minimum: 9.011091962456703 > 9.009886890649796
    WOLFE (weak): th(1551.1929768229563)=9.009886890649796; dx=-5.540802552570203E-7 evalInputDelta=0.001445867121219635
    New Minimum: 9.009886890649796 > 9.001224160194397
    WOLFE (weak): th(10858.350837760694)=9.001224160194397; dx=-5.441171186541487E-7 evalInputDelta=0.010108597576618195
    New Minimum: 9.001224160194397 > 8.93068490922451
    WOLFE (weak): th(86866.80670208555)=8.93068490922451; dx=-5.413290004451031E-7 evalInputDelta=0.08064784854650497
    New Minimum: 8.93068490922451 > 8.394334606826305
    END: th(781801.26031877)=8.394334606826305; dx=-3.8184561320829145E-7 evalInputDelta=0.6169981509447098
    Fitness changed from 9.011332757771015 to 8.394334606826305
    Iteration 1 complete. Error: 8.394334606826305 Total: 670.8532; Orientation: 0.0515; Line Search: 519.8368
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/00c78fd2-1844-46d2-953e-d1cd3b2528ef.jpg)
    
    Adding measurement 2cde2

...skipping 2872 bytes...

    omplete. Error: 5.993306055665016 Total: 222.7909; Orientation: 1.2942; Line Search: 151.6275
    <a id="p-11"></a>Iteration 5
    <a id="p-10"></a>![Iteration 5](etc/758118b5-2d69-48cb-bd43-76010e8021d5.jpg)
    
    Adding measurement 7642aa1b to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.690e+03, gradient 4.700e-04, dot -0.337; [adfdbad8-6599-4202-942b-be099e4e3b8d = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 5.993306055665016, 7.609875366091728, 8.394334606826305, 9.011332757771015
    LBFGS Accumulation History: 3 points
    Removed measurement 7642aa1b to history. Total: 3
    th(0)=5.993306055665016;dx=-2.190565652093714E-7
    Armijo: th(9072000.0)=6.613194361329079; dx=2.0082951332941265E-8 evalInputDelta=-0.6198883056640625
    New Minimum: 5.993306055665016 > 5.669203244149685
    END: th(4536000.0)=5.669203244149685; dx=-6.3539479374452166E-9 evalInputDelta=0.32410281151533127
    Fitness changed from 5.993306055665016 to 5.669203244149685
    Iteration 6 complete. Error: 5.669203244149685 Total: 205.3895; Orientation: 1.2659; Line Search: 153.3893
    Adding measurement 29a6fada to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 5.623e+03, gradient 4.488e-04, dot -0.331; [adfdbad8-6599-4202-942b-be099e4e3b8d = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 5.669203244149685, 7.609875366091728, 8.394334606826305, 9.011332757771015
    LBFGS Accumulation History: 3 points
    Removed measurement 29a6fada to history. Total: 3
    th(0)=5.669203244149685;dx=-1.998913766089359E-7
    Armijo: th(9772515.753984625)=6.415528081357479; dx=2.6158122354867994E-8 evalInputDelta=-0.7463248372077942
    New Minimum: 5.669203244149685 > 5.356238529086113
    END: th(4886257.876992312)=5.356238529086113; dx=-9.399379015652256E-10 evalInputDelta=0.31296471506357193
    Fitness changed from 5.669203244149685 to 5.356238529086113
    Iteration 7 complete. Error: 5.356238529086113 Total: 202.2375; Orientation: 1.2849; Line Search: 150.7893
    Final threshold in iteration 7: 5.356238529086113 (> -Infinity) after 1816.827s (< 1800.000s)
    

Returns:

    5.356238529086113