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 196.48 seconds (2.978 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: 861189097238
    Reset training subject: 864780800693
    Adding measurement 7a38c01c to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=12.319869726896286;dx=-2.9971681619987964E-7
    New Minimum: 12.319869726896286 > 12.31986840069294
    WOLFE (weak): th(2.154434690031884)=12.31986840069294; dx=-2.97937793921826E-7 evalInputDelta=1.3262033462524414E-6
    New Minimum: 12.31986840069294 > 12.319866672158241
    WOLFE (weak): th(4.308869380063768)=12.319866672158241; dx=-2.9786546858941214E-7 evalInputDelta=3.0547380447387695E-6
    New Minimum: 12.319866672158241 > 12.31986141204834
    WOLFE (weak): th(12.926608140191302)=12.31986141204834; dx=-2.975934103094258E-7 evalInputDelta=8.314847946166992E-6
    New Minimum: 12.31986141204834 > 12.319836020469666
    WOLFE (weak): th(51.70643256076521)=12.319836020469666; dx=-2.978789094654661E-7 evalInputDelta=3.37064266204834E-5
    New Minimum: 12.319836020469666 > 12.31970189511776
    WOLFE (weak): th(258.53216280382605)=12.31970189511776; dx=-2.97958247182738E-7 evalInputDelta=1.6783177852630615E-4
    New Minimum: 12.31970189511776 > 12.318862408399582
    WOLFE (weak): th(1551.1929768229563)=12.318862408399582; dx=-2.9788375246008635E-7 evalInputDelta=0.0010073184967041016
    New Minimum: 12.318862408399582 > 12.312821701169014
    WOLFE (weak): th(10858.350837760694)=12.312821701169014; dx=-2.977636236597166E-7 evalInputDelta=0.007048025727272034
    New Minimum: 12.312821701169014 > 12.26360222697258
    WOLFE (weak): th(86866.80670208555)=12.26360222697258; dx=-2.9636341175787323E-7 evalInputDelta=0.056267499923706055
    New Minimum: 12.26360222697258 > 11.827402085065842
    WOLFE (weak): th(781801.26031877)=11.827402085065842; dx=-2.7844070870050485E-7 evalInputDelta=0.49246764183044434
    New Minimum: 11.827402085065842 > 9.410870149731636
    END: th(7818012.6031877)=9.410870149731636; dx=-8.263061220972124E-8 evalInputDelta=2.90899957716465
    Fitness changed from 12.319869726896286 to 9.410870149731636
    Iteration 1 complete. Error: 9.410870149731636 Total:

...skipping 6388 bytes...

    , dot -0.530; [b1580920-d848-4823-afb0-90449245cccc = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.952836737036705, 7.416960716247559, 9.410870149731636, 12.319869726896286
    LBFGS Accumulation History: 3 points
    Removed measurement 7f78dd3f to history. Total: 3
    th(0)=1.952836737036705;dx=-2.8260921512454462E-8
    New Minimum: 1.952836737036705 > 1.8533341586589813
    WOLF (strong): th(2.5200000000000007E7)=1.8533341586589813; dx=6.523398881546096E-9 evalInputDelta=0.0995025783777237
    New Minimum: 1.8533341586589813 > 1.689701870083809
    END: th(1.2600000000000004E7)=1.689701870083809; dx=-1.3164355119322971E-9 evalInputDelta=0.2631348669528961
    Fitness changed from 1.952836737036705 to 1.689701870083809
    Iteration 9 complete. Error: 1.689701870083809 Total: 15.8789; Orientation: 0.3446; Line Search: 11.5343
    Adding measurement 5bf2c852 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.084e+04, gradient 1.685e-04, dot -0.505; [b1580920-d848-4823-afb0-90449245cccc = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.689701870083809, 7.416960716247559, 9.410870149731636, 12.319869726896286
    LBFGS Accumulation History: 3 points
    Removed measurement 5bf2c852 to history. Total: 3
    th(0)=1.689701870083809;dx=-2.8347580838956652E-8
    Armijo: th(2.7145877094401743E7)=1.729794666171074; dx=5.7254609314147386E-9 evalInputDelta=-0.040092796087265015
    New Minimum: 1.689701870083809 > 1.5042836368083954
    WOLF (strong): th(1.3572938547200872E7)=1.5042836368083954; dx=2.7414335400176295E-9 evalInputDelta=0.1854182332754135
    END: th(4524312.849066957)=1.5275295972824097; dx=-1.553204463163491E-8 evalInputDelta=0.16217227280139923
    Fitness changed from 1.689701870083809 to 1.5042836368083954
    Iteration 10 complete. Error: 1.5042836368083954 Total: 20.1968; Orientation: 0.3218; Line Search: 16.2309
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/a2eb95c0-8fb4-4393-babe-7a05a61791f2.jpg)
    
    Final threshold in iteration 11: 1.5042836368083954 (> -Infinity) after 196.479s (< 3600.000s)
    

Returns:

    1.5042836368083954