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 400.69 seconds (3.709 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: 4550182329872
    Reset training subject: 4558687536472
    Adding measurement 613138d6 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=7.146497264504433;dx=-2.2194846833182563E-7
    New Minimum: 7.146497264504433 > 7.146497085690498
    WOLFE (weak): th(2.154434690031884)=7.146497085690498; dx=-2.197096045150031E-7 evalInputDelta=1.7881393432617188E-7
    New Minimum: 7.146497085690498 > 7.146496459841728
    WOLFE (weak): th(4.308869380063768)=7.146496459841728; dx=-2.1964855796425764E-7 evalInputDelta=8.046627044677734E-7
    New Minimum: 7.146496459841728 > 7.146494284272194
    WOLFE (weak): th(12.926608140191302)=7.146494284272194; dx=-2.1963346188923858E-7 evalInputDelta=2.9802322387695312E-6
    New Minimum: 7.146494284272194 > 7.146485149860382
    WOLFE (weak): th(51.70643256076521)=7.146485149860382; dx=-2.1963717819055082E-7 evalInputDelta=1.2114644050598145E-5
    New Minimum: 7.146485149860382 > 7.146436557173729
    WOLFE (weak): th(258.53216280382605)=7.146436557173729; dx=-2.196805433452002E-7 evalInputDelta=6.070733070373535E-5
    New Minimum: 7.146436557173729 > 7.146132707595825
    WOLFE (weak): th(1551.1929768229563)=7.146132707595825; dx=-2.1964184373913184E-7 evalInputDelta=3.645569086074829E-4
    New Minimum: 7.146132707595825 > 7.143943831324577
    WOLFE (weak): th(10858.350837760694)=7.143943831324577; dx=-2.1955476545155187E-7 evalInputDelta=0.0025534331798553467
    New Minimum: 7.143943831324577 > 7.126096233725548
    WOLFE (weak): th(86866.80670208555)=7.126096233725548; dx=-2.1901144333203355E-7 evalInputDelta=0.020401030778884888
    New Minimum: 7.126096233725548 > 6.965652033686638
    WOLFE (weak): th(781801.26031877)=6.965652033686638; dx=-2.1276123084498881E-7 evalInputDelta=0.1808452308177948
    New Minimum: 6.965652033686638 > 5.732388153672218
    END: th(7818012.6031877)=5.732388153672218; dx=-1.3827581535103547E-7 evalInputDelta=1.4141091108322144
    Fitness changed from 7.146497264504433 to 5.732388153672218
    Iteration 1 complete. Error: 5.732388153672218 Total: 118.537

...skipping 5893 bytes...

    to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 7.954e+03, gradient 1.132e-04, dot -0.247; [2c7ba9c4-bc1d-4ede-9de1-4593c24b255a = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.36444059014320374, 4.234872683882713, 5.732388153672218, 7.146497264504433
    LBFGS Accumulation History: 3 points
    Removed measurement 41fe7cd4 to history. Total: 3
    th(0)=-0.36444059014320374;dx=-1.2799670774643882E-8
    Armijo: th(2.268000000000001E8)=0.8639898002147675; dx=3.322280901043673E-9 evalInputDelta=-1.2284303903579712
    New Minimum: -0.36444059014320374 > -0.4980224370956421
    WOLF (strong): th(1.1340000000000004E8)=-0.4980224370956421; dx=3.3638633756939465E-12 evalInputDelta=0.13358184695243835
    New Minimum: -0.4980224370956421 > -0.6866546869277954
    END: th(3.7800000000000015E7)=-0.6866546869277954; dx=-7.24585221621091E-9 evalInputDelta=0.3222140967845917
    Fitness changed from -0.36444059014320374 to -0.6866546869277954
    Iteration 9 complete. Error: -0.6866546869277954 Total: 42.1448; Orientation: 0.8060; Line Search: 33.5962
    Adding measurement 83f5ed to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 8.666e+03, gradient 8.855e-05, dot -0.277; [2c7ba9c4-bc1d-4ede-9de1-4593c24b255a = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.6866546869277954, 4.234872683882713, 5.732388153672218, 7.146497264504433
    LBFGS Accumulation History: 3 points
    Removed measurement 83f5ed to history. Total: 3
    th(0)=-0.6866546869277954;dx=-7.828122934732325E-9
    New Minimum: -0.6866546869277954 > -0.8803129941225052
    END: th(8.143763128320524E7)=-0.8803129941225052; dx=-2.7964641501712758E-9 evalInputDelta=0.19365830719470978
    Fitness changed from -0.6866546869277954 to -0.8803129941225052
    Iteration 10 complete. Error: -0.8803129941225052 Total: 25.6387; Orientation: 1.0552; Line Search: 16.1567
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/05272c8c-57c9-4c5c-b00b-f653ad08fd5e.jpg)
    
    Final threshold in iteration 11: -0.8803129941225052 (> -Infinity) after 400.693s (< 3600.000s)
    

Returns:

    -0.8803129941225052