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 895.22 seconds (9.882 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: 3772865843824
    Reset training subject: 3793620212003
    Adding measurement 3617e83c to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=9.684801951050758;dx=-4.6874912372461663E-7
    New Minimum: 9.684801951050758 > 9.684800118207932
    WOLFE (weak): th(2.154434690031884)=9.684800118207932; dx=-4.681717909550703E-7 evalInputDelta=1.8328428268432617E-6
    New Minimum: 9.684800118207932 > 9.684798151254654
    WOLFE (weak): th(4.308869380063768)=9.684798151254654; dx=-4.6818761389482216E-7 evalInputDelta=3.7997961044311523E-6
    New Minimum: 9.684798151254654 > 9.68479037284851
    WOLFE (weak): th(12.926608140191302)=9.68479037284851; dx=-4.6820726467465593E-7 evalInputDelta=1.1578202247619629E-5
    New Minimum: 9.68479037284851 > 9.684757202863693
    WOLFE (weak): th(51.70643256076521)=9.684757202863693; dx=-4.6814405672226415E-7 evalInputDelta=4.474818706512451E-5
    New Minimum: 9.684757202863693 > 9.684578210115433
    WOLFE (weak): th(258.53216280382605)=9.684578210115433; dx=-4.6818309439268246E-7 evalInputDelta=2.2374093532562256E-4
    New Minimum: 9.684578210115433 > 9.683460593223572
    WOLFE (weak): th(1551.1929768229563)=9.683460593223572; dx=-4.67948354468728E-7 evalInputDelta=0.0013413578271865845
    New Minimum: 9.683460593223572 > 9.675421193242073
    WOLFE (weak): th(10858.350837760694)=9.675421193242073; dx=-4.669725492618229E-7 evalInputDelta=0.009380757808685303
    New Minimum: 9.675421193242073 > 9.61042295396328
    WOLFE (weak): th(86866.80670208555)=9.61042295396328; dx=-4.5782543354367055E-7 evalInputDelta=0.07437899708747864
    New Minimum: 9.61042295396328 > 9.068432703614235
    END: th(781801.26031877)=9.068432703614235; dx=-3.817762135203268E-7 evalInputDelta=0.6163692474365234
    Fitness changed from 9.684801951050758 to 9.068432703614235
    Iteration 1 complete. Error: 9.068432703614235 Total: 253.3464; Orientation: 0.0625; Line Search: 193.3059
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/07252072-c3e0-4a0c-994a-15b284bac326.jpg)
    
    Adding measurement 2c

...skipping 5670 bytes...

    FGS Orientation magnitude: 5.076e+03, gradient 2.246e-04, dot -0.384; [cb9fc776-2774-4a9c-aecc-108b9d0b6ba9 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 2.0742771476507187, 8.166808068752289, 9.068432703614235, 9.684801951050758
    LBFGS Accumulation History: 3 points
    Removed measurement 36b85bf5 to history. Total: 3
    th(0)=2.0742771476507187;dx=-5.041251747930937E-8
    New Minimum: 2.0742771476507187 > 1.7128559350967407
    WOLF (strong): th(3.0240000000000004E7)=1.7128559350967407; dx=4.650529393590452E-9 evalInputDelta=0.36142121255397797
    New Minimum: 1.7128559350967407 > 1.6042161285877228
    END: th(1.5120000000000002E7)=1.6042161285877228; dx=-4.099202953371348E-9 evalInputDelta=0.4700610190629959
    Fitness changed from 2.0742771476507187 to 1.6042161285877228
    Iteration 9 complete. Error: 1.6042161285877228 Total: 78.7730; Orientation: 1.1617; Line Search: 57.0705
    Adding measurement 2f70d47 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 5.653e+03, gradient 1.632e-04, dot -0.478; [cb9fc776-2774-4a9c-aecc-108b9d0b6ba9 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.6042161285877228, 8.166808068752289, 9.068432703614235, 9.684801951050758
    LBFGS Accumulation History: 3 points
    Removed measurement 2f70d47 to history. Total: 3
    th(0)=1.6042161285877228;dx=-2.6611836884843023E-8
    New Minimum: 1.6042161285877228 > 1.3176277875900269
    WOLF (strong): th(3.2575052513282087E7)=1.3176277875900269; dx=4.387786811994043E-9 evalInputDelta=0.2865883409976959
    New Minimum: 1.3176277875900269 > 1.233075737953186
    END: th(1.6287526256641043E7)=1.233075737953186; dx=-2.7916858220084622E-9 evalInputDelta=0.37114039063453674
    Fitness changed from 1.6042161285877228 to 1.233075737953186
    Iteration 10 complete. Error: 1.233075737953186 Total: 83.3155; Orientation: 1.1862; Line Search: 61.6656
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/85318cc6-40bb-4e2e-a83d-a45a7d905c4e.jpg)
    
    Final threshold in iteration 11: 1.233075737953186 (> -Infinity) after 895.214s (< 1800.000s)
    

Returns:

    1.233075737953186