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 668.75 seconds (6.667 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: 12679881038806
    Reset training subject: 12694907638223
    Adding measurement 2ee4bb8a to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=8.388948366045952;dx=-4.465929541477457E-7
    New Minimum: 8.388948366045952 > 8.388947948813438
    WOLFE (weak): th(2.154434690031884)=8.388947948813438; dx=-4.464527682244279E-7 evalInputDelta=4.172325134277344E-7
    New Minimum: 8.388947948813438 > 8.388947017490864
    WOLFE (weak): th(4.308869380063768)=8.388947017490864; dx=-4.464523694880991E-7 evalInputDelta=1.3485550880432129E-6
    New Minimum: 8.388947017490864 > 8.388941682875156
    WOLFE (weak): th(12.926608140191302)=8.388941682875156; dx=-4.46452558660919E-7 evalInputDelta=6.683170795440674E-6
    New Minimum: 8.388941682875156 > 8.388920307159424
    WOLFE (weak): th(51.70643256076521)=8.388920307159424; dx=-4.464445934586526E-7 evalInputDelta=2.8058886528015137E-5
    New Minimum: 8.388920307159424 > 8.388807624578476
    WOLFE (weak): th(258.53216280382605)=8.388807624578476; dx=-4.464488356610781E-7 evalInputDelta=1.407414674758911E-4
    New Minimum: 8.388807624578476 > 8.388103939592838
    WOLFE (weak): th(1551.1929768229563)=8.388103939592838; dx=-4.4634526414719786E-7 evalInputDelta=8.444264531135559E-4
    New Minimum: 8.388103939592838 > 8.383039347827435
    WOLFE (weak): th(10858.350837760694)=8.383039347827435; dx=-4.458523708139275E-7 evalInputDelta=0.0059090182185173035
    New Minimum: 8.383039347827435 > 8.341535054147243
    WOLFE (weak): th(86866.80670208555)=8.341535054147243; dx=-4.4119626344718904E-7 evalInputDelta=0.047413311898708344
    New Minimum: 8.341535054147243 > 7.985336095094681
    END: th(781801.26031877)=7.985336095094681; dx=-3.9153844162517E-7 evalInputDelta=0.40361227095127106
    Fitness changed from 8.388948366045952 to 7.985336095094681
    Iteration 1 complete. Error: 7.985336095094681 Total: 186.4526; Orientation: 0.0724; Line Search: 141.6929
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/a0f6b816-567e-4477-b19b-939be08090af.jpg)
    
    Adding measurement 

...skipping 5638 bytes...

    entation magnitude: 5.300e+03, gradient 1.834e-04, dot -0.370; [33d09f8d-18f8-4a60-9678-18557360556a = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.9694202095270157, 7.299667961895466, 7.985336095094681, 8.388948366045952
    LBFGS Accumulation History: 3 points
    Removed measurement 317d9ac to history. Total: 3
    th(0)=0.9694202095270157;dx=-3.362688142485861E-8
    New Minimum: 0.9694202095270157 > 0.9297793358564377
    WOLF (strong): th(3.0240000000000004E7)=0.9297793358564377; dx=1.2942970285899766E-8 evalInputDelta=0.039640873670578
    New Minimum: 0.9297793358564377 > 0.7361426204442978
    END: th(1.5120000000000002E7)=0.7361426204442978; dx=-2.619363313081735E-10 evalInputDelta=0.2332775890827179
    Fitness changed from 0.9694202095270157 to 0.7361426204442978
    Iteration 9 complete. Error: 0.7361426204442978 Total: 58.8354; Orientation: 1.5972; Line Search: 43.1762
    Adding measurement 7a4a2b77 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.467e+03, gradient 2.255e-04, dot -0.278; [33d09f8d-18f8-4a60-9678-18557360556a = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.7361426204442978, 7.299667961895466, 7.985336095094681, 8.388948366045952
    LBFGS Accumulation History: 3 points
    Removed measurement 7a4a2b77 to history. Total: 3
    th(0)=0.7361426204442978;dx=-5.086904892586743E-8
    New Minimum: 0.7361426204442978 > 0.6877256482839584
    WOLF (strong): th(3.2575052513282087E7)=0.6877256482839584; dx=1.9285294521226864E-8 evalInputDelta=0.048416972160339355
    New Minimum: 0.6877256482839584 > 0.5424972996115685
    END: th(1.6287526256641043E7)=0.5424972996115685; dx=-6.802679430941311E-9 evalInputDelta=0.19364532083272934
    Fitness changed from 0.7361426204442978 to 0.5424972996115685
    Iteration 10 complete. Error: 0.5424972996115685 Total: 59.1880; Orientation: 1.5942; Line Search: 42.9211
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/bfab10e3-4e6c-4352-a0ae-f301deb6a0ac.jpg)
    
    Final threshold in iteration 11: 0.5424972996115685 (> -Infinity) after 668.746s (< 3600.000s)
    

Returns:

    0.5424972996115685