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 102.27 seconds (5.726 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: 744281794161
    Reset training subject: 745226577274
    Adding measurement 6619353a to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=11.234463341534138;dx=-6.491965153864484E-6
    New Minimum: 11.234463341534138 > 11.234446346759796
    WOLFE (weak): th(2.154434690031884)=11.234446346759796; dx=-6.499123552624376E-6 evalInputDelta=1.6994774341583252E-5
    New Minimum: 11.234446346759796 > 11.234429433941841
    WOLFE (weak): th(4.308869380063768)=11.234429433941841; dx=-6.49921144602977E-6 evalInputDelta=3.390759229660034E-5
    New Minimum: 11.234429433941841 > 11.234361372888088
    WOLFE (weak): th(12.926608140191302)=11.234361372888088; dx=-6.48557817955205E-6 evalInputDelta=1.0196864604949951E-4
    New Minimum: 11.234361372888088 > 11.234056275337934
    WOLFE (weak): th(51.70643256076521)=11.234056275337934; dx=-6.498417466763608E-6 evalInputDelta=4.070661962032318E-4
    New Minimum: 11.234056275337934 > 11.232427962124348
    WOLFE (weak): th(258.53216280382605)=11.232427962124348; dx=-6.501938633421096E-6 evalInputDelta=0.002035379409790039
    New Minimum: 11.232427962124348 > 11.22223487868905
    WOLFE (weak): th(1551.1929768229563)=11.22223487868905; dx=-6.510357166852326E-6 evalInputDelta=0.012228462845087051
    New Minimum: 11.22223487868905 > 11.148363515734673
    WOLFE (weak): th(10858.350837760694)=11.148363515734673; dx=-6.549869619144222E-6 evalInputDelta=0.08609982579946518
    New Minimum: 11.148363515734673 > 10.529899828135967
    WOLFE (weak): th(86866.80670208555)=10.529899828135967; dx=-6.542137456017077E-6 evalInputDelta=0.7045635133981705
    New Minimum: 10.529899828135967 > 5.761563554406166
    END: th(781801.26031877)=5.761563554406166; dx=-4.144330737374321E-6 evalInputDelta=5.472899787127972
    Fitness changed from 11.234463341534138 to 5.761563554406166
    Iteration 1 complete. Error: 5.761563554406166 Total: 9.9367; Orientation: 0.0440; Line Search: 7.4010
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/b8984fc6-e776-4936-bec0-dfe9d33b571c.jpg)
    
    Adding mea

...skipping 24749 bytes...

    1af8f6-6946-430d-959b-7eea12ef39ad = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.9174158722162247, 1.596389189362526, 5.761563554406166, 11.234463341534138
    LBFGS Accumulation History: 3 points
    Removed measurement 4fd6fc27 to history. Total: 3
    th(0)=-1.9174158722162247;dx=-9.846738446672903E-9
    New Minimum: -1.9174158722162247 > -1.9296600371599197
    END: th(5222981.262102863)=-1.9296600371599197; dx=-1.7495112477839092E-9 evalInputDelta=0.012244164943695068
    Fitness changed from -1.9174158722162247 to -1.9296600371599197
    Iteration 29 complete. Error: -1.9296600371599197 Total: 3.9946; Orientation: 0.1889; Line Search: 2.8794
    Adding measurement 791010ba to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 8.648e+02, gradient 1.813e-04, dot -0.359; [c51af8f6-6946-430d-959b-7eea12ef39ad = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.9296600371599197, 1.596389189362526, 5.761563554406166, 11.234463341534138
    LBFGS Accumulation History: 3 points
    Removed measurement 791010ba to history. Total: 3
    th(0)=-1.9296600371599197;dx=-3.265962954068148E-8
    Armijo: th(1.1252572016460918E7)=-0.021601930260658264; dx=2.794515947134261E-7 evalInputDelta=-1.9080581068992615
    Armijo: th(5626286.008230459)=-1.5710648372769356; dx=1.2239630142552173E-7 evalInputDelta=-0.35859519988298416
    New Minimum: -1.9296600371599197 > -1.93955322727561
    WOLF (strong): th(1875428.669410153)=-1.93955322727561; dx=1.7806667738668755E-8 evalInputDelta=0.009893190115690231
    New Minimum: -1.93955322727561 > -1.9439514577388763
    END: th(468857.16735253826)=-1.9439514577388763; dx=-2.0365247707555863E-8 evalInputDelta=0.014291420578956604
    Fitness changed from -1.9296600371599197 to -1.9439514577388763
    Iteration 30 complete. Error: -1.9439514577388763 Total: 4.1818; Orientation: 0.1342; Line Search: 3.4290
    <a id="p-21"></a>Iteration 30
    <a id="p-20"></a>![Iteration 30](etc/7a458334-4993-462a-bf88-d000bace45ac.jpg)
    
    Final threshold in iteration 31: -1.9439514577388763 (> -Infinity) after 102.248s (< 3600.000s)
    

Returns:

    -1.9439514577388763