Iteration 1 Iteration 1

Iteration 2 Iteration 2

Iteration 3 Iteration 3

Iteration 4 Iteration 4

Iteration 5 Iteration 5

Iteration 10 Iteration 10

Iteration 15 Iteration 15

Iteration 20 Iteration 20

Iteration 25 Iteration 25

Iteration 30 Iteration 30

Code from BasicOptimizer.scala:88 executed in 97.08 seconds (4.071 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: 1165955607681
    Reset training subject: 1166696827844
    Adding measurement 15282088 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=0.4179123193025589;dx=-1.7585741550939922E-6
    New Minimum: 0.4179123193025589 > 0.417907252907753
    WOLFE (weak): th(2.154434690031884)=0.417907252907753; dx=-1.757569236741082E-6 evalInputDelta=5.066394805908203E-6
    New Minimum: 0.417907252907753 > 0.41790224611759186
    WOLFE (weak): th(4.308869380063768)=0.41790224611759186; dx=-1.7579371691910493E-6 evalInputDelta=1.0073184967041016E-5
    New Minimum: 0.41790224611759186 > 0.41788215935230255
    WOLFE (weak): th(12.926608140191302)=0.41788215935230255; dx=-1.7516293304927288E-6 evalInputDelta=3.0159950256347656E-5
    New Minimum: 0.41788215935230255 > 0.4177921265363693
    WOLFE (weak): th(51.70643256076521)=0.4177921265363693; dx=-1.7566125233777725E-6 evalInputDelta=1.201927661895752E-4
    New Minimum: 0.4177921265363693 > 0.41731148958206177
    WOLFE (weak): th(258.53216280382605)=0.41731148958206177; dx=-1.7555800584934264E-6 evalInputDelta=6.008297204971313E-4
    New Minimum: 0.41731148958206177 > 0.41430890560150146
    WOLFE (weak): th(1551.1929768229563)=0.41430890560150146; dx=-1.7517075689711741E-6 evalInputDelta=0.003603413701057434
    New Minimum: 0.41430890560150146 > 0.39277034997940063
    WOLFE (weak): th(10858.350837760694)=0.39277034997940063; dx=-1.7414515913707995E-6 evalInputDelta=0.025141969323158264
    New Minimum: 0.39277034997940063 > 0.22164008021354675
    WOLFE (weak): th(86866.80670208555)=0.22164008021354675; dx=-1.648061125977775E-6 evalInputDelta=0.19627223908901215
    New Minimum: 0.22164008021354675 > -0.8607159554958344
    END: th(781801.26031877)=-0.8607159554958344; dx=-7.059949903875136E-7 evalInputDelta=1.2786282747983932
    Fitness changed from 0.4179123193025589 to -0.8607159554958344
    Iteration 1 complete. Error: -0.8607159554958344 Total: 9.3682; Orientation: 0.0033; Line Search: 7.2260
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/bff0a96e-0f92

...skipping 24643 bytes...

    ation: 0.1761; Line Search: 2.0504
    Adding measurement 358dc568 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 2.119e+03, gradient 6.863e-05, dot -0.614; [3af98431-c263-4f77-9208-287ab308502a = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -2.031043343245983, -1.3265092447400093, -0.8607159554958344, 0.4179123193025589
    LBFGS Accumulation History: 3 points
    Removed measurement 358dc568 to history. Total: 3
    th(0)=-2.031043343245983;dx=-4.626047731076835E-9
    New Minimum: -2.031043343245983 > -2.0449617505073547
    END: th(7834471.893154291)=-2.0449617505073547; dx=-3.5406950586777343E-9 evalInputDelta=0.013918407261371613
    Fitness changed from -2.031043343245983 to -2.0449617505073547
    Iteration 29 complete. Error: -2.0449617505073547 Total: 2.2873; Orientation: 0.1050; Line Search: 1.4181
    Adding measurement 3660470e to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.867e+03, gradient 7.731e-05, dot -0.472; [3af98431-c263-4f77-9208-287ab308502a = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -2.0449617505073547, -1.3265092447400093, -0.8607159554958344, 0.4179123193025589
    LBFGS Accumulation History: 3 points
    Removed measurement 3660470e to history. Total: 3
    th(0)=-2.0449617505073547;dx=-5.918381882759646E-9
    Armijo: th(1.6878858024691373E7)=-1.9307943917810917; dx=7.703841503583282E-9 evalInputDelta=-0.11416735872626305
    Armijo: th(8439429.012345687)=-2.029276669025421; dx=2.45558291734965E-9 evalInputDelta=-0.015685081481933594
    New Minimum: -2.0449617505073547 > -2.0507993772625923
    END: th(2813143.004115229)=-2.0507993772625923; dx=-2.7832930087401466E-9 evalInputDelta=0.005837626755237579
    Fitness changed from -2.0449617505073547 to -2.0507993772625923
    Iteration 30 complete. Error: -2.0507993772625923 Total: 3.6662; Orientation: 0.1105; Line Search: 2.8618
    <a id="p-21"></a>Iteration 30
    <a id="p-20"></a>![Iteration 30](etc/d1fbaeec-3f09-4af1-b1f5-b01858ce96bd.jpg)
    
    Final threshold in iteration 31: -2.0507993772625923 (> -Infinity) after 97.077s (< 3600.000s)
    

Returns:

    -2.0507993772625923