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 117.07 seconds (2.319 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: 2061156026792
    Reset training subject: 2063472546707
    Adding measurement f743822 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=10.63658519089222;dx=-9.174498749725718E-7
    New Minimum: 10.63658519089222 > 10.636582463979721
    WOLFE (weak): th(2.154434690031884)=10.636582463979721; dx=-9.016474626363756E-7 evalInputDelta=2.726912498474121E-6
    New Minimum: 10.636582463979721 > 10.636580064892769
    WOLFE (weak): th(4.308869380063768)=10.636580064892769; dx=-9.014881765608146E-7 evalInputDelta=5.125999450683594E-6
    New Minimum: 10.636580064892769 > 10.636569485068321
    WOLFE (weak): th(12.926608140191302)=10.636569485068321; dx=-9.015120719373471E-7 evalInputDelta=1.570582389831543E-5
    New Minimum: 10.636569485068321 > 10.636521801352501
    WOLFE (weak): th(51.70643256076521)=10.636521801352501; dx=-8.929407595579581E-7 evalInputDelta=6.338953971862793E-5
    New Minimum: 10.636521801352501 > 10.636266201734543
    WOLFE (weak): th(258.53216280382605)=10.636266201734543; dx=-9.014909305695909E-7 evalInputDelta=3.189891576766968E-4
    New Minimum: 10.636266201734543 > 10.634669557213783
    WOLFE (weak): th(1551.1929768229563)=10.634669557213783; dx=-8.992376990827502E-7 evalInputDelta=0.0019156336784362793
    New Minimum: 10.634669557213783 > 10.623180478811264
    WOLFE (weak): th(10858.350837760694)=10.623180478811264; dx=-9.005270200100825E-7 evalInputDelta=0.013404712080955505
    New Minimum: 10.623180478811264 > 10.52975682914257
    WOLFE (weak): th(86866.80670208555)=10.52975682914257; dx=-8.917796991648361E-7 evalInputDelta=0.10682836174964905
    New Minimum: 10.52975682914257 > 9.723645776510239
    END: th(781801.26031877)=9.723645776510239; dx=-7.813594283527335E-7 evalInputDelta=0.9129394143819809
    Fitness changed from 10.63658519089222 to 9.723645776510239
    Iteration 1 complete. Error: 9.723645776510239 Total: 32.7786; Orientation: 0.0088; Line Search: 25.3702
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/ef34681a-5516-4fd1-8cd5-f23391e3f859.jpg)
    
    Adding

...skipping 5632 bytes...

     125c7f2a to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.936e+03, gradient 2.564e-04, dot -0.360; [bfb53e28-8ef1-4e4b-a9af-d5afdad906c5 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.42197464406490326, 8.22508616745472, 9.723645776510239, 10.63658519089222
    LBFGS Accumulation History: 3 points
    Removed measurement 125c7f2a to history. Total: 3
    th(0)=0.42197464406490326;dx=-6.556767207560703E-8
    Armijo: th(3.0240000000000004E7)=0.9028270542621613; dx=2.980039027706548E-8 evalInputDelta=-0.480852410197258
    New Minimum: 0.42197464406490326 > 0.24364961683750153
    WOLF (strong): th(1.5120000000000002E7)=0.24364961683750153; dx=1.83201821189412E-8 evalInputDelta=0.17832502722740173
    New Minimum: 0.24364961683750153 > 0.1654403954744339
    END: th(5040000.000000001)=0.1654403954744339; dx=-2.3804662368533042E-8 evalInputDelta=0.25653424859046936
    Fitness changed from 0.42197464406490326 to 0.1654403954744339
    Iteration 9 complete. Error: 0.1654403954744339 Total: 13.8104; Orientation: 0.2596; Line Search: 10.9637
    Adding measurement 4e46d469 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.884e+03, gradient 1.745e-04, dot -0.519; [bfb53e28-8ef1-4e4b-a9af-d5afdad906c5 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.1654403954744339, 8.22508616745472, 9.723645776510239, 10.63658519089222
    LBFGS Accumulation History: 3 points
    Removed measurement 4e46d469 to history. Total: 3
    th(0)=0.1654403954744339;dx=-3.0000742300863544E-8
    New Minimum: 0.1654403954744339 > -0.10697278380393982
    END: th(1.0858350837760696E7)=-0.10697278380393982; dx=-1.5716683061684383E-8 evalInputDelta=0.2724131792783737
    Fitness changed from 0.1654403954744339 to -0.10697278380393982
    Iteration 10 complete. Error: -0.10697278380393982 Total: 7.9900; Orientation: 0.2385; Line Search: 5.1422
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/004893ee-272e-4511-97d4-133d1ad4231b.jpg)
    
    Final threshold in iteration 11: -0.10697278380393982 (> -Infinity) after 117.070s (< 3600.000s)
    

Returns:

    -0.10697278380393982