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 69.57 seconds (2.927 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: 577249160220
    Reset training subject: 578818119898
    Adding measurement 69dee3cf to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=26.805083939805627;dx=-9.839498922759703E-6
    New Minimum: 26.805083939805627 > 26.805049973540008
    WOLFE (weak): th(2.154434690031884)=26.805049973540008; dx=-9.841198051789283E-6 evalInputDelta=3.396626561880112E-5
    New Minimum: 26.805049973540008 > 26.805016729049385
    WOLFE (weak): th(4.308869380063768)=26.805016729049385; dx=-9.847635989672407E-6 evalInputDelta=6.721075624227524E-5
    New Minimum: 26.805016729049385 > 26.804883503355086
    WOLFE (weak): th(12.926608140191302)=26.804883503355086; dx=-9.848880078253322E-6 evalInputDelta=2.0043645054101944E-4
    New Minimum: 26.804883503355086 > 26.8042822079733
    WOLFE (weak): th(51.70643256076521)=26.8042822079733; dx=-9.840081344788145E-6 evalInputDelta=8.017318323254585E-4
    New Minimum: 26.8042822079733 > 26.801076089031994
    WOLFE (weak): th(258.53216280382605)=26.801076089031994; dx=-9.851404695548297E-6 evalInputDelta=0.004007850773632526
    New Minimum: 26.801076089031994 > 26.78084168024361
    WOLFE (weak): th(1551.1929768229563)=26.78084168024361; dx=-1.0006640900783252E-5 evalInputDelta=0.024242259562015533
    New Minimum: 26.78084168024361 > 26.62823502998799
    WOLFE (weak): th(10858.350837760694)=26.62823502998799; dx=-1.0556878271722281E-5 evalInputDelta=0.176848909817636
    New Minimum: 26.62823502998799 > 25.383692007511854
    WOLFE (weak): th(86866.80670208555)=25.383692007511854; dx=-8.864539757555649E-6 evalInputDelta=1.4213919322937727
    New Minimum: 25.383692007511854 > 20.325340192764997
    END: th(781801.26031877)=20.325340192764997; dx=-3.5506511547169158E-6 evalInputDelta=6.479743747040629
    Fitness changed from 26.805083939805627 to 20.325340192764997
    Iteration 1 complete. Error: 20.325340192764997 Total: 19.7070; Orientation: 0.0340; Line Search: 14.6608
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/f0ef7306-0c43-463c-85f0-e3a19d94a1d5.jpg)
    
    Adding meas

...skipping 5947 bytes...

    tal: 3
    Rejected: LBFGS Orientation magnitude: 1.663e+03, gradient 3.905e-04, dot -0.402; [8b648a10-65cc-427c-b73c-28897bdfe336 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 2.3036722391843796, 13.043324552476406, 20.325340192764997, 26.805083939805627
    LBFGS Accumulation History: 3 points
    Removed measurement 3617b3 to history. Total: 3
    th(0)=2.3036722391843796;dx=-1.5061066347883839E-7
    Armijo: th(7560000.000000002)=2.338593006134033; dx=4.5561152349832206E-8 evalInputDelta=-0.034920766949653625
    New Minimum: 2.3036722391843796 > 2.037448152899742
    END: th(3780000.000000001)=2.037448152899742; dx=-2.666134507073925E-10 evalInputDelta=0.26622408628463745
    Fitness changed from 2.3036722391843796 to 2.037448152899742
    Iteration 9 complete. Error: 2.037448152899742 Total: 5.9733; Orientation: 0.1044; Line Search: 3.9167
    Adding measurement 65204ef to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.634e+03, gradient 3.834e-04, dot -0.398; [8b648a10-65cc-427c-b73c-28897bdfe336 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 2.037448152899742, 13.043324552476406, 20.325340192764997, 26.805083939805627
    LBFGS Accumulation History: 3 points
    Removed measurement 65204ef to history. Total: 3
    th(0)=2.037448152899742;dx=-1.460419361352374E-7
    Armijo: th(8143763.128320523)=2.2446432933211327; dx=7.250917791727825E-8 evalInputDelta=-0.20719514042139053
    New Minimum: 2.037448152899742 > 1.784633755683899
    WOLF (strong): th(4071881.5641602613)=1.784633755683899; dx=2.6092054993603916E-8 evalInputDelta=0.2528143972158432
    END: th(1357293.854720087)=1.8246022313833237; dx=-9.032887335442167E-8 evalInputDelta=0.21284592151641846
    Fitness changed from 2.037448152899742 to 1.784633755683899
    Iteration 10 complete. Error: 1.784633755683899 Total: 7.0913; Orientation: 0.0892; Line Search: 5.5520
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/27bbf2ab-305b-4a6e-99fb-fe2ec6926194.jpg)
    
    Final threshold in iteration 11: 1.784633755683899 (> -Infinity) after 69.552s (< 3600.000s)
    

Returns:

    1.784633755683899