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 928.68 seconds (8.060 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: 8319486723459
    Reset training subject: 8327386366845
    Adding measurement 69b6919c to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=1.5961966663599014;dx=-4.3285826998048816E-8
    New Minimum: 1.5961966663599014 > 1.596196636557579
    WOLFE (weak): th(2.154434690031884)=1.596196636557579; dx=-4.322807612020772E-8 evalInputDelta=2.9802322387695312E-8
    New Minimum: 1.596196636557579 > 1.5961964279413223
    WOLFE (weak): th(4.308869380063768)=1.5961964279413223; dx=-4.3225578870447364E-8 evalInputDelta=2.384185791015625E-7
    New Minimum: 1.5961964279413223 > 1.596195712685585
    WOLFE (weak): th(12.926608140191302)=1.596195712685585; dx=-4.322496887681817E-8 evalInputDelta=9.5367431640625E-7
    New Minimum: 1.596195712685585 > 1.5961927026510239
    WOLFE (weak): th(51.70643256076521)=1.5961927026510239; dx=-4.3227981452841E-8 evalInputDelta=3.9637088775634766E-6
    New Minimum: 1.5961927026510239 > 1.5961764752864838
    WOLFE (weak): th(258.53216280382605)=1.5961764752864838; dx=-4.323321496013436E-8 evalInputDelta=2.0191073417663574E-5
    New Minimum: 1.5961764752864838 > 1.5960759669542313
    WOLFE (weak): th(1551.1929768229563)=1.5960759669542313; dx=-4.3230756555161646E-8 evalInputDelta=1.2069940567016602E-4
    New Minimum: 1.5960759669542313 > 1.5953508466482162
    WOLFE (weak): th(10858.350837760694)=1.5953508466482162; dx=-4.3189619768965334E-8 evalInputDelta=8.458197116851807E-4
    New Minimum: 1.5953508466482162 > 1.5894340723752975
    WOLFE (weak): th(86866.80670208555)=1.5894340723752975; dx=-4.31738083721197E-8 evalInputDelta=0.006762593984603882
    New Minimum: 1.5894340723752975 > 1.535779520869255
    WOLFE (weak): th(781801.26031877)=1.535779520869255; dx=-4.2557125466700204E-8 evalInputDelta=0.06041714549064636
    New Minimum: 1.535779520869255 > 1.061389610171318
    END: th(7818012.6031877)=1.061389610171318; dx=-3.3005676760089244E-8 evalInputDelta=0.5348070561885834
    Fitness changed from 1.5961966663599014 to 1.061389610171318
    Iteration 1 complete. Error: 1.061389610171318 

...skipping 24650 bytes...

    078720093; dx=-2.341469209395989E-10 evalInputDelta=0.004095494747161865
    Fitness changed from -1.9853801131248474 to -1.9894756078720093
    Iteration 28 complete. Error: -1.9894756078720093 Total: 35.8115; Orientation: 0.8448; Line Search: 28.6489
    Adding measurement 7776b98f to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 2.650e+03, gradient 1.541e-05, dot -0.500; [f5fd07a5-226f-44ed-85a1-e53280af49f1 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.9894756078720093, 0.33669278025627136, 1.061389610171318, 1.5961966663599014
    LBFGS Accumulation History: 3 points
    Removed measurement 7776b98f to history. Total: 3
    th(0)=-1.9894756078720093;dx=-2.366826066846051E-10
    New Minimum: -1.9894756078720093 > -1.9926948323845863
    END: th(2.611490631051432E7)=-1.9926948323845863; dx=-1.8750604155557735E-10 evalInputDelta=0.003219224512577057
    Fitness changed from -1.9894756078720093 to -1.9926948323845863
    Iteration 29 complete. Error: -1.9926948323845863 Total: 21.8890; Orientation: 0.8448; Line Search: 14.0039
    Adding measurement 722803c4 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 2.674e+03, gradient 1.578e-05, dot -0.485; [f5fd07a5-226f-44ed-85a1-e53280af49f1 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.9926948323845863, 0.33669278025627136, 1.061389610171318, 1.5961966663599014
    LBFGS Accumulation History: 3 points
    Removed measurement 722803c4 to history. Total: 3
    th(0)=-1.9926948323845863;dx=-2.484159073617995E-10
    New Minimum: -1.9926948323845863 > -1.9935402125120163
    END: th(5.6262860082304604E7)=-1.9935402125120163; dx=-1.2550290423011364E-10 evalInputDelta=8.453801274299622E-4
    Fitness changed from -1.9926948323845863 to -1.9935402125120163
    Iteration 30 complete. Error: -1.9935402125120163 Total: 21.0963; Orientation: 0.8522; Line Search: 13.9883
    <a id="p-21"></a>Iteration 30
    <a id="p-20"></a>![Iteration 30](etc/f9ce59e2-9db4-48fe-a91c-320f16e47b51.jpg)
    
    Final threshold in iteration 31: -1.9935402125120163 (> -Infinity) after 928.678s (< 3600.000s)
    

Returns:

    -1.9935402125120163