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 253.03 seconds (9.123 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: 606959761432300
    Reset training subject: 606966330265000
    Adding measurement 26d6daec to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=25.636927103623748;dx=-1.2711977991360348E-5
    New Minimum: 25.636927103623748 > 25.636886885389686
    WOLFE (weak): th(2.154434690031884)=25.636886885389686; dx=-1.270888015522521E-5 evalInputDelta=4.0218234062194824E-5
    New Minimum: 25.636886885389686 > 25.63684642314911
    WOLFE (weak): th(4.308869380063768)=25.63684642314911; dx=-1.2711236380041962E-5 evalInputDelta=8.06804746389389E-5
    New Minimum: 25.63684642314911 > 25.636685342527926
    WOLFE (weak): th(12.926608140191302)=25.636685342527926; dx=-1.270435337276518E-5 evalInputDelta=2.4176109582185745E-4
    New Minimum: 25.636685342527926 > 25.635956688784063
    WOLFE (weak): th(51.70643256076521)=25.635956688784063; dx=-1.2715122675437277E-5 evalInputDelta=9.704148396849632E-4
    New Minimum: 25.635956688784063 > 25.632062446326017
    WOLFE (weak): th(258.53216280382605)=25.632062446326017; dx=-1.2765650248321541E-5 evalInputDelta=0.004864657297730446
    New Minimum: 25.632062446326017 > 25.607412428595126
    WOLFE (weak): th(1551.1929768229563)=25.607412428595126; dx=-1.3034836592408465E-5 evalInputDelta=0.02951467502862215
    New Minimum: 25.607412428595126 > 25.421220024116337
    WOLFE (weak): th(10858.350837760694)=25.421220024116337; dx=-1.3818346373758365E-5 evalInputDelta=0.21570707950741053
    New Minimum: 25.421220024116337 > 24.008357416838408
    END: th(86866.80670208555)=24.008357416838408; dx=-1.0149274651655142E-5 evalInputDelta=1.6285696867853403
    Fitness changed from 25.636927103623748 to 24.008357416838408
    Iteration 1 complete. Error: 24.008357416838408 Total: 70.4583; Orientation: 0.0387; Line Search: 51.6964
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/79c11b93-1159-42a3-8226-b37b98e7aabd.jpg)
    
    Adding measurement 2ea45459 to history. Total: 1
    LBFGS Accumulation History: 2 points
    th(0)=24.008357416838408;dx=-1.703119112692

...skipping 5598 bytes...

    ation: 0.1505; Line Search: 21.5590
    Adding measurement 57d33377 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.652e+03, gradient 5.421e-04, dot -0.214; [8ead539d-dfc6-4b63-b55f-3b5583e29348 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 3.6399890035390854, 20.665989194065332, 24.008357416838408, 25.636927103623748
    LBFGS Accumulation History: 3 points
    Removed measurement 57d33377 to history. Total: 3
    th(0)=3.6399890035390854;dx=-2.9286762283489513E-7
    New Minimum: 3.6399890035390854 > 3.1454076170921326
    END: th(3360000.0000000014)=3.1454076170921326; dx=-6.701269910147502E-9 evalInputDelta=0.4945813864469528
    Fitness changed from 3.6399890035390854 to 3.1454076170921326
    Iteration 9 complete. Error: 3.1454076170921326 Total: 17.3930; Orientation: 0.1402; Line Search: 10.7780
    Adding measurement 3c81edc6 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 7.453e+02, gradient 7.272e-04, dot -0.130; [8ead539d-dfc6-4b63-b55f-3b5583e29348 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 3.1454076170921326, 20.665989194065332, 24.008357416838408, 25.636927103623748
    LBFGS Accumulation History: 3 points
    Removed measurement 3c81edc6 to history. Total: 3
    th(0)=3.1454076170921326;dx=-5.273478092456608E-7
    Armijo: th(7238900.558507132)=4.840796887874603; dx=2.408278118350512E-7 evalInputDelta=-1.6953892707824707
    Armijo: th(3619450.279253566)=3.3728390634059906; dx=2.678415347075064E-7 evalInputDelta=-0.22743144631385803
    New Minimum: 3.1454076170921326 > 2.682052120566368
    END: th(1206483.4264178553)=2.682052120566368; dx=-3.626463107611524E-8 evalInputDelta=0.46335549652576447
    Fitness changed from 3.1454076170921326 to 2.682052120566368
    Iteration 10 complete. Error: 2.682052120566368 Total: 28.4156; Orientation: 0.1418; Line Search: 22.7128
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/931a41cc-1189-4478-9ba6-a8d66984ee14.jpg)
    
    Final threshold in iteration 11: 2.682052120566368 (> -Infinity) after 253.011s (< 3600.000s)
    

Returns:

    2.682052120566368