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 265.33 seconds (7.998 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: 607849692325500
    Reset training subject: 607855109972500
    Adding measurement 1eb5d2c to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=6.962661594152451;dx=-2.225103222069378E-6
    New Minimum: 6.962661594152451 > 6.962654486298561
    WOLFE (weak): th(2.154434690031884)=6.962654486298561; dx=-2.226361465577037E-6 evalInputDelta=7.107853889465332E-6
    New Minimum: 6.962654486298561 > 6.962647020816803
    WOLFE (weak): th(4.308869380063768)=6.962647020816803; dx=-2.2233695516525465E-6 evalInputDelta=1.4573335647583008E-5
    New Minimum: 6.962647020816803 > 6.962616816163063
    WOLFE (weak): th(12.926608140191302)=6.962616816163063; dx=-2.2258026735773527E-6 evalInputDelta=4.477798938751221E-5
    New Minimum: 6.962616816163063 > 6.962482646107674
    WOLFE (weak): th(51.70643256076521)=6.962482646107674; dx=-2.225719039587599E-6 evalInputDelta=1.789480447769165E-4
    New Minimum: 6.962482646107674 > 6.961766272783279
    WOLFE (weak): th(258.53216280382605)=6.961766272783279; dx=-2.2233019732506174E-6 evalInputDelta=8.953213691711426E-4
    New Minimum: 6.961766272783279 > 6.957290351390839
    WOLFE (weak): th(1551.1929768229563)=6.957290351390839; dx=-2.2227133985589075E-6 evalInputDelta=0.0053712427616119385
    New Minimum: 6.957290351390839 > 6.92519511282444
    WOLFE (weak): th(10858.350837760694)=6.92519511282444; dx=-2.2057286999064006E-6 evalInputDelta=0.03746648132801056
    New Minimum: 6.92519511282444 > 6.674582451581955
    WOLFE (weak): th(86866.80670208555)=6.674582451581955; dx=-2.03868306916397E-6 evalInputDelta=0.2880791425704956
    New Minimum: 6.674582451581955 > 5.2228458523750305
    END: th(781801.26031877)=5.2228458523750305; dx=-8.5869797124305E-7 evalInputDelta=1.73981574177742
    Fitness changed from 6.962661594152451 to 5.2228458523750305
    Iteration 1 complete. Error: 5.2228458523750305 Total: 72.8546; Orientation: 0.0138; Line Search: 56.5515
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/62210e91-8966-4fb0-96cb-ed0f4ae1c856.jpg

...skipping 6000 bytes...

    
    Adding measurement 51cd4474 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.711e+03, gradient 3.900e-04, dot -0.559; [94db0226-8fda-47fd-a796-f5c909661d86 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.6460732221603394, 4.040468156337738, 5.2228458523750305, 6.962661594152451
    LBFGS Accumulation History: 3 points
    Removed measurement 51cd4474 to history. Total: 3
    th(0)=1.6460732221603394;dx=-1.5140846923366164E-7
    Armijo: th(5040000.0)=1.922020822763443; dx=8.175299182888471E-8 evalInputDelta=-0.27594760060310364
    New Minimum: 1.6460732221603394 > 1.5573532283306122
    WOLF (strong): th(2520000.0)=1.5573532283306122; dx=3.927290398617201E-8 evalInputDelta=0.08871999382972717
    New Minimum: 1.5573532283306122 > 1.5173573344945908
    END: th(840000.0)=1.5173573344945908; dx=-7.970777774075503E-8 evalInputDelta=0.1287158876657486
    Fitness changed from 1.6460732221603394 to 1.5173573344945908
    Iteration 9 complete. Error: 1.5173573344945908 Total: 28.4716; Orientation: 0.1579; Line Search: 22.9919
    Adding measurement 5e421682 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.839e+03, gradient 2.788e-04, dot -0.727; [94db0226-8fda-47fd-a796-f5c909661d86 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.5173573344945908, 4.040468156337738, 5.2228458523750305, 6.962661594152451
    LBFGS Accumulation History: 3 points
    Removed measurement 5e421682 to history. Total: 3
    th(0)=1.5173573344945908;dx=-7.715598712852853E-8
    New Minimum: 1.5173573344945908 > 1.3868726938962936
    END: th(1809725.1396267824)=1.3868726938962936; dx=-5.961496289083222E-8 evalInputDelta=0.13048464059829712
    Fitness changed from 1.5173573344945908 to 1.3868726938962936
    Iteration 10 complete. Error: 1.3868726938962936 Total: 16.5648; Orientation: 0.1579; Line Search: 10.9162
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/3fd1919a-ad20-4832-8775-cfb55efb856d.jpg)
    
    Final threshold in iteration 11: 1.3868726938962936 (> -Infinity) after 265.332s (< 3600.000s)
    

Returns:

    1.3868726938962936