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 408.96 seconds (3.814 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: 7366966112201
    Reset training subject: 7376141678755
    Adding measurement 228a21e3 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=-0.0031513869762420654;dx=-2.520807124932826E-8
    New Minimum: -0.0031513869762420654 > -0.003151446580886841
    WOLFE (weak): th(2.154434690031884)=-0.003151446580886841; dx=-2.5196271741804535E-8 evalInputDelta=5.9604644775390625E-8
    WOLFE (weak): th(4.308869380063768)=-0.003151416778564453; dx=-2.5183719491532133E-8 evalInputDelta=2.9802322387695312E-8
    New Minimum: -0.003151446580886841 > -0.0031517446041107178
    WOLFE (weak): th(12.926608140191302)=-0.0031517446041107178; dx=-2.521758033955618E-8 evalInputDelta=3.5762786865234375E-7
    New Minimum: -0.0031517446041107178 > -0.003152698278427124
    WOLFE (weak): th(51.70643256076521)=-0.003152698278427124; dx=-2.5209992227868882E-8 evalInputDelta=1.3113021850585938E-6
    New Minimum: -0.003152698278427124 > -0.0031576156616210938
    WOLFE (weak): th(258.53216280382605)=-0.0031576156616210938; dx=-2.5208540385326507E-8 evalInputDelta=6.22868537902832E-6
    New Minimum: -0.0031576156616210938 > -0.003187626600265503
    WOLFE (weak): th(1551.1929768229563)=-0.003187626600265503; dx=-2.5212994086067822E-8 evalInputDelta=3.62396240234375E-5
    New Minimum: -0.003187626600265503 > -0.003404587507247925
    WOLFE (weak): th(10858.350837760694)=-0.003404587507247925; dx=-2.520688335062203E-8 evalInputDelta=2.532005310058594E-4
    New Minimum: -0.003404587507247925 > -0.005173921585083008
    WOLFE (weak): th(86866.80670208555)=-0.005173921585083008; dx=-2.5164714479393003E-8 evalInputDelta=0.0020225346088409424
    New Minimum: -0.005173921585083008 > -0.021179556846618652
    WOLFE (weak): th(781801.26031877)=-0.021179556846618652; dx=-2.468962000011884E-8 evalInputDelta=0.018028169870376587
    New Minimum: -0.021179556846618652 > -0.16561555862426758
    END: th(7818012.6031877)=-0.16561555862426758; dx=-2.1300131260052086E-8 evalInputDelta=0.1624641716480255
    Fitness changed from -0.0031513869762420654 to -0.1

...skipping 6283 bytes...

    c436 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.185383677482605, -0.40097612142562866, -0.16561555862426758, -0.0031513869762420654
    LBFGS Accumulation History: 3 points
    Removed measurement 60f6ea6b to history. Total: 3
    th(0)=-1.185383677482605;dx=-6.490815868841525E-9
    Armijo: th(1.5120000000000006E8)=-0.7693528532981873; dx=9.180770364419467E-10 evalInputDelta=-0.4160308241844177
    New Minimum: -1.185383677482605 > -1.2175276279449463
    END: th(7.560000000000003E7)=-1.2175276279449463; dx=-6.218257350662583E-10 evalInputDelta=0.03214395046234131
    Fitness changed from -1.185383677482605 to -1.2175276279449463
    Iteration 9 complete. Error: -1.2175276279449463 Total: 34.9032; Orientation: 0.8095; Line Search: 25.4094
    Adding measurement 68c82e91 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 2.006e+04, gradient 8.387e-05, dot -0.401; [fb973740-e748-48b6-9b98-6b8bc7f1c436 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.2175276279449463, -0.40097612142562866, -0.16561555862426758, -0.0031513869762420654
    LBFGS Accumulation History: 3 points
    Removed measurement 68c82e91 to history. Total: 3
    th(0)=-1.2175276279449463;dx=-7.024166812224236E-9
    Armijo: th(1.6287526256641048E8)=-0.6318152248859406; dx=1.6804480629493048E-9 evalInputDelta=-0.5857124030590057
    New Minimum: -1.2175276279449463 > -1.2200273722410202
    WOLF (strong): th(8.143763128320524E7)=-1.2200273722410202; dx=1.2382827817857883E-10 evalInputDelta=0.0024997442960739136
    New Minimum: -1.2200273722410202 > -1.3343026489019394
    END: th(2.7145877094401747E7)=-1.3343026489019394; dx=-3.888482572937108E-9 evalInputDelta=0.1167750209569931
    Fitness changed from -1.2175276279449463 to -1.3343026489019394
    Iteration 10 complete. Error: -1.3343026489019394 Total: 41.4023; Orientation: 0.8433; Line Search: 32.6599
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/e9a96a29-d6a1-437c-9002-34ce7fe27ac9.jpg)
    
    Final threshold in iteration 11: -1.3343026489019394 (> -Infinity) after 408.956s (< 3600.000s)
    

Returns:

    -1.3343026489019394