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 1951.52 seconds (4.498 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: 8969652618692
    Reset training subject: 9021182838972
    Adding measurement 65d046f9 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=3.548311024904251;dx=-5.296075353848216E-7
    New Minimum: 3.548311024904251 > 3.5483095347881317
    WOLFE (weak): th(2.154434690031884)=3.5483095347881317; dx=-5.334240621967783E-7 evalInputDelta=1.4901161193847656E-6
    New Minimum: 3.5483095347881317 > 3.5483075082302094
    WOLFE (weak): th(4.308869380063768)=3.5483075082302094; dx=-5.32865406398298E-7 evalInputDelta=3.516674041748047E-6
    New Minimum: 3.5483075082302094 > 3.5483001470565796
    WOLFE (weak): th(12.926608140191302)=3.5483001470565796; dx=-5.349700262791656E-7 evalInputDelta=1.0877847671508789E-5
    New Minimum: 3.5483001470565796 > 3.548266261816025
    WOLFE (weak): th(51.70643256076521)=3.548266261816025; dx=-5.325877766389268E-7 evalInputDelta=4.476308822631836E-5
    New Minimum: 3.548266261816025 > 3.5480860471725464
    WOLFE (weak): th(258.53216280382605)=3.5480860471725464; dx=-5.335650291959313E-7 evalInputDelta=2.2497773170471191E-4
    New Minimum: 3.5480860471725464 > 3.5469625741243362
    WOLFE (weak): th(1551.1929768229563)=3.5469625741243362; dx=-5.286542333340876E-7 evalInputDelta=0.001348450779914856
    New Minimum: 3.5469625741243362 > 3.5388949513435364
    WOLFE (weak): th(10858.350837760694)=3.5388949513435364; dx=-5.258691803878722E-7 evalInputDelta=0.009416073560714722
    New Minimum: 3.5388949513435364 > 3.474654197692871
    WOLFE (weak): th(86866.80670208555)=3.474654197692871; dx=-4.995566223470869E-7 evalInputDelta=0.07365682721138
    New Minimum: 3.474654197692871 > 3.03398334980011
    END: th(781801.26031877)=3.03398334980011; dx=-2.7948499827100706E-7 evalInputDelta=0.5143276751041412
    Fitness changed from 3.548311024904251 to 3.03398334980011
    Iteration 1 complete. Error: 3.03398334980011 Total: 666.5757; Orientation: 0.0482; Line Search: 512.0905
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/b3548271-b34a-4547-b9f1-071d81d766ad.jpg)
    
    Adding meas

...skipping 3813 bytes...

    513713837
    Iteration 6 complete. Error: 0.6817557513713837 Total: 156.5302; Orientation: 1.3684; Line Search: 102.7310
    Adding measurement 73478c80 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.518e+03, gradient 3.770e-04, dot -0.331; [5fb3ad98-e4ae-42e0-832c-b815bb688a0c = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.6817557513713837, 2.43850077688694, 3.03398334980011, 3.548311024904251
    LBFGS Accumulation History: 3 points
    Removed measurement 73478c80 to history. Total: 3
    th(0)=0.6817557513713837;dx=-1.482024304499206E-7
    Armijo: th(1.3030021005312834E7)=1.513479232788086; dx=2.2856551469493127E-8 evalInputDelta=-0.8317234814167023
    New Minimum: 0.6817557513713837 > 0.5796107202768326
    WOLF (strong): th(6515010.502656417)=0.5796107202768326; dx=3.873279092064314E-9 evalInputDelta=0.10214503109455109
    New Minimum: 0.5796107202768326 > 0.3886754661798477
    END: th(2171670.167552139)=0.3886754661798477; dx=-5.256875331818894E-8 evalInputDelta=0.29308028519153595
    Fitness changed from 0.6817557513713837 to 0.3886754661798477
    Iteration 7 complete. Error: 0.3886754661798477 Total: 255.1200; Orientation: 1.2695; Line Search: 203.6117
    Adding measurement 2c19c762 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.039e+03, gradient 2.714e-04, dot -0.392; [5fb3ad98-e4ae-42e0-832c-b815bb688a0c = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.3886754661798477, 2.43850077688694, 3.03398334980011, 3.548311024904251
    LBFGS Accumulation History: 3 points
    Removed measurement 2c19c762 to history. Total: 3
    th(0)=0.3886754661798477;dx=-7.319070500237211E-8
    New Minimum: 0.3886754661798477 > 0.127545565366745
    END: th(4678721.544281682)=0.127545565366745; dx=-3.864336295918722E-8 evalInputDelta=0.2611299008131027
    Fitness changed from 0.3886754661798477 to 0.127545565366745
    Iteration 8 complete. Error: 0.127545565366745 Total: 152.2403; Orientation: 1.2756; Line Search: 100.2562
    Final threshold in iteration 8: 0.127545565366745 (> -Infinity) after 1951.518s (< 1800.000s)
    

Returns:

    0.127545565366745