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 228.06 seconds (3.979 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: 3311164704010
    Reset training subject: 3315447853953
    Adding measurement 7466edb1 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=-1.0506779998540878;dx=-8.65793198922601E-8
    New Minimum: -1.0506779998540878 > -1.0506782829761505
    WOLFE (weak): th(2.154434690031884)=-1.0506782829761505; dx=-8.658112719673937E-8 evalInputDelta=2.8312206268310547E-7
    New Minimum: -1.0506782829761505 > -1.0506785362958908
    WOLFE (weak): th(4.308869380063768)=-1.0506785362958908; dx=-8.658553124225179E-8 evalInputDelta=5.364418029785156E-7
    New Minimum: -1.0506785362958908 > -1.050679624080658
    WOLFE (weak): th(12.926608140191302)=-1.050679624080658; dx=-8.656230612611278E-8 evalInputDelta=1.6242265701293945E-6
    New Minimum: -1.050679624080658 > -1.0506845340132713
    WOLFE (weak): th(51.70643256076521)=-1.0506845340132713; dx=-8.658264605710457E-8 evalInputDelta=6.534159183502197E-6
    New Minimum: -1.0506845340132713 > -1.0507105365395546
    WOLFE (weak): th(258.53216280382605)=-1.0507105365395546; dx=-8.658288653060861E-8 evalInputDelta=3.253668546676636E-5
    New Minimum: -1.0507105365395546 > -1.0508731082081795
    WOLFE (weak): th(1551.1929768229563)=-1.0508731082081795; dx=-8.655543351423278E-8 evalInputDelta=1.951083540916443E-4
    New Minimum: -1.0508731082081795 > -1.0520421862602234
    WOLFE (weak): th(10858.350837760694)=-1.0520421862602234; dx=-8.638762383504214E-8 evalInputDelta=0.001364186406135559
    New Minimum: -1.0520421862602234 > -1.0614963993430138
    WOLFE (weak): th(86866.80670208555)=-1.0614963993430138; dx=-8.48941850314122E-8 evalInputDelta=0.010818399488925934
    New Minimum: -1.0614963993430138 > -1.1398293524980545
    END: th(781801.26031877)=-1.1398293524980545; dx=-7.19458508047614E-8 evalInputDelta=0.08915135264396667
    Fitness changed from -1.0506779998540878 to -1.1398293524980545
    Iteration 1 complete. Error: -1.1398293524980545 Total: 60.7318; Orientation: 0.0303; Line Search: 47.1779
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/0dcf9cff-4

...skipping 6073 bytes...

     Orientation magnitude: 2.682e+03, gradient 6.556e-05, dot -0.876; [41162c19-a033-4668-b0fe-262b56951d26 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.5913602262735367, -1.254801832139492, -1.1398293524980545, -1.0506779998540878
    LBFGS Accumulation History: 3 points
    Removed measurement 7fde9f3f to history. Total: 3
    th(0)=-1.5913602262735367;dx=-4.283028207120616E-9
    New Minimum: -1.5913602262735367 > -1.656221553683281
    END: th(2.016E7)=-1.656221553683281; dx=-2.0569570110146222E-9 evalInputDelta=0.06486132740974426
    Fitness changed from -1.5913602262735367 to -1.656221553683281
    Iteration 9 complete. Error: -1.656221553683281 Total: 14.8336; Orientation: 0.4776; Line Search: 9.1726
    Adding measurement 7425c49d to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.452e+03, gradient 9.875e-05, dot -0.532; [41162c19-a033-4668-b0fe-262b56951d26 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.656221553683281, -1.254801832139492, -1.1398293524980545, -1.0506779998540878
    LBFGS Accumulation History: 3 points
    Removed measurement 7425c49d to history. Total: 3
    th(0)=-1.656221553683281;dx=-9.735914768013417E-9
    Armijo: th(4.343340335104278E7)=1.6691724956035614; dx=9.808278620097726E-8 evalInputDelta=-3.3253940492868423
    Armijo: th(2.171670167552139E7)=-0.9168661162257195; dx=5.0877724636787636E-8 evalInputDelta=-0.7393554374575615
    Armijo: th(7238900.55850713)=-1.656014159321785; dx=8.132520809020372E-9 evalInputDelta=-2.0739436149597168E-4
    New Minimum: -1.656221553683281 > -1.6754370331764221
    END: th(1809725.1396267824)=-1.6754370331764221; dx=-5.672281257234246E-9 evalInputDelta=0.019215479493141174
    Fitness changed from -1.656221553683281 to -1.6754370331764221
    Iteration 10 complete. Error: -1.6754370331764221 Total: 27.2998; Orientation: 0.4799; Line Search: 22.4413
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/1bdb3f33-70d4-4a44-8237-57a1c706c198.jpg)
    
    Final threshold in iteration 11: -1.6754370331764221 (> -Infinity) after 228.058s (< 3600.000s)
    

Returns:

    -1.6754370331764221