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 125.67 seconds (1.739 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: 14299089859670
    Reset training subject: 14302217080064
    Adding measurement 2ee25d25 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=24.746757388929836;dx=-2.4156585432427027E-5
    New Minimum: 24.746757388929836 > 24.7467046835809
    WOLFE (weak): th(2.154434690031884)=24.7467046835809; dx=-2.459483158334302E-5 evalInputDelta=5.270534893497825E-5
    New Minimum: 24.7467046835809 > 24.746650989050977
    END: th(4.308869380063768)=24.746650989050977; dx=-1.8985890189063778E-5 evalInputDelta=1.0639987885951996E-4
    Fitness changed from 24.746757388929836 to 24.746650989050977
    Iteration 1 complete. Error: 24.746650989050977 Total: 18.7750; Orientation: 0.0031; Line Search: 9.4890
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/25406f1b-f26b-4c45-904e-905b2324955b.jpg)
    
    Adding measurement 2ab189e7 to history. Total: 1
    LBFGS Accumulation History: 2 points
    th(0)=24.746650989050977;dx=-2.37535687486839E-5
    New Minimum: 24.746650989050977 > 24.746434443979524
    WOLFE (weak): th(9.283177667225559)=24.746434443979524; dx=-2.391464304692716E-5 evalInputDelta=2.1654507145285606E-4
    New Minimum: 24.746434443979524 > 24.746217246574815
    WOLFE (weak): th(18.566355334451117)=24.746217246574815; dx=-2.4145710618232613E-5 evalInputDelta=4.3374247616156936E-4
    New Minimum: 24.746217246574815 > 24.745338991633616
    WOLFE (weak): th(55.69906600335335)=24.745338991633616; dx=-2.5018845643046327E-5 evalInputDelta=0.0013119974173605442
    New Minimum: 24.745338991633616 > 24.73909116408322
    WOLFE (weak): th(222.7962640134134)=24.73909116408322; dx=-2.8922275860271013E-5 evalInputDelta=0.007559824967756867
    New Minimum: 24.73909116408322 > 24.719933649816085
    END: th(1113.981320067067)=24.719933649816085; dx=-1.589871479821522E-5 evalInputDelta=0.02671733923489228
    Fitness changed from 24.746650989050977 to 24.719933649816085
    Iteration 2 complete. Error: 24.719933649816085 Total: 22.0307; Orientation: 0.0033; Line Search: 18.8848
    <a id="p-5"></a>Iteration 2
    <a id="p-4">

...skipping 4739 bytes...

    94065964 > 16.85535453259945
    END: th(668388.7920402404)=16.85535453259945; dx=-1.281168949415283E-6 evalInputDelta=2.978580561466515
    Fitness changed from 19.833935094065964 to 16.85535453259945
    Iteration 8 complete. Error: 16.85535453259945 Total: 9.6732; Orientation: 0.2483; Line Search: 6.2673
    Adding measurement 60a4715e to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 9.677e+02, gradient 1.610e-03, dot -0.428; [eda78585-b5db-4efd-bddd-d6a41dc8474e = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 16.85535453259945, 24.719933649816085, 24.746650989050977, 24.746757388929836
    LBFGS Accumulation History: 3 points
    Removed measurement 60a4715e to history. Total: 3
    th(0)=16.85535453259945;dx=-2.2194813642925705E-6
    New Minimum: 16.85535453259945 > 12.468286169692874
    END: th(1440000.0000000005)=12.468286169692874; dx=-6.896422325982663E-7 evalInputDelta=4.387068362906575
    Fitness changed from 16.85535453259945 to 12.468286169692874
    Iteration 9 complete. Error: 12.468286169692874 Total: 9.4753; Orientation: 0.0709; Line Search: 6.2813
    Adding measurement 2295771 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.453e+03, gradient 1.296e-03, dot -0.379; [eda78585-b5db-4efd-bddd-d6a41dc8474e = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 12.468286169692874, 24.719933649816085, 24.746650989050977, 24.746757388929836
    LBFGS Accumulation History: 3 points
    Removed measurement 2295771 to history. Total: 3
    th(0)=12.468286169692874;dx=-1.6216145797479232E-6
    New Minimum: 12.468286169692874 > 9.94575809314847
    END: th(3102385.953645914)=9.94575809314847; dx=-1.376650854384626E-7 evalInputDelta=2.522528076544404
    Fitness changed from 12.468286169692874 to 9.94575809314847
    Iteration 10 complete. Error: 9.94575809314847 Total: 9.4487; Orientation: 0.0665; Line Search: 6.2069
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/f5291638-7488-4726-ac24-f3b71b6f3316.jpg)
    
    Final threshold in iteration 11: 9.94575809314847 (> -Infinity) after 125.673s (< 1800.000s)
    

Returns:

    9.94575809314847