Iteration 1 Iteration 1

Iteration 2 Iteration 2

Iteration 3 Iteration 3

Iteration 4 Iteration 4

Iteration 5 Iteration 5

Iteration 10 Iteration 10

Iteration 15 Iteration 15

Iteration 20 Iteration 20

Code from BasicOptimizer.scala:88 executed in 1628.29 seconds (7.333 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: 1149445035006
    Reset training subject: 1168885590097
    Adding measurement 48d7f85e to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=10.078982278704643;dx=-2.7505656413680414E-7
    New Minimum: 10.078982278704643 > 10.078982263803482
    WOLFE (weak): th(2.154434690031884)=10.078982263803482; dx=-2.722413843836959E-7 evalInputDelta=1.4901161193847656E-8
    New Minimum: 10.078982263803482 > 10.078981786966324
    WOLFE (weak): th(4.308869380063768)=10.078981786966324; dx=-2.722525893995153E-7 evalInputDelta=4.917383193969727E-7
    New Minimum: 10.078981786966324 > 10.078976809978485
    WOLFE (weak): th(12.926608140191302)=10.078976809978485; dx=-2.72246233977803E-7 evalInputDelta=5.46872615814209E-6
    New Minimum: 10.078976809978485 > 10.07896077632904
    WOLFE (weak): th(51.70643256076521)=10.07896077632904; dx=-2.7226478576074107E-7 evalInputDelta=2.1502375602722168E-5
    New Minimum: 10.07896077632904 > 10.078875556588173
    WOLFE (weak): th(258.53216280382605)=10.078875556588173; dx=-2.7225055338389086E-7 evalInputDelta=1.0672211647033691E-4
    New Minimum: 10.078875556588173 > 10.078343585133553
    WOLFE (weak): th(1551.1929768229563)=10.078343585133553; dx=-2.72243576789263E-7 evalInputDelta=6.386935710906982E-4
    New Minimum: 10.078343585133553 > 10.07451245188713
    WOLFE (weak): th(10858.350837760694)=10.07451245188713; dx=-2.720945856367916E-7 evalInputDelta=0.004469826817512512
    New Minimum: 10.07451245188713 > 10.04331150650978
    WOLFE (weak): th(86866.80670208555)=10.04331150650978; dx=-2.7112153325487794E-7 evalInputDelta=0.035670772194862366
    New Minimum: 10.04331150650978 > 9.765333250164986
    WOLFE (weak): th(781801.26031877)=9.765333250164986; dx=-2.613941202848847E-7 evalInputDelta=0.3136490285396576
    New Minimum: 9.765333250164986 > 7.760305121541023
    END: th(7818012.6031877)=7.760305121541023; dx=-1.6039839232031035E-7 evalInputDelta=2.31867715716362
    Fitness changed from 10.078982278704643 to 7.760305121541023
    Iteration 1 complete. Error: 7.760305121541023 Total:

...skipping 15568 bytes...

    agnitude: 7.203e+03, gradient 9.255e-05, dot -0.320; [9c2abd0b-80a0-49a6-ae6a-f82089fa0131 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.303123563528061, 5.5898276418447495, 7.760305121541023, 10.078982278704643
    LBFGS Accumulation History: 3 points
    Removed measurement 6605d2 to history. Total: 3
    th(0)=-1.303123563528061;dx=-8.563854258383372E-9
    Armijo: th(7.069238826667126E7)=-0.986680269241333; dx=1.8373116587466734E-9 evalInputDelta=-0.3164432942867279
    New Minimum: -1.303123563528061 > -1.3335451036691666
    END: th(3.534619413333563E7)=-1.3335451036691666; dx=-3.7838835067250923E-10 evalInputDelta=0.030421540141105652
    Fitness changed from -1.303123563528061 to -1.3335451036691666
    Iteration 19 complete. Error: -1.3335451036691666 Total: 72.2146; Orientation: 0.9795; Line Search: 54.9950
    Adding measurement b2be394 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 7.498e+03, gradient 1.025e-04, dot -0.302; [9c2abd0b-80a0-49a6-ae6a-f82089fa0131 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.3335451036691666, 5.5898276418447495, 7.760305121541023, 10.078982278704643
    LBFGS Accumulation History: 3 points
    Removed measurement b2be394 to history. Total: 3
    th(0)=-1.3335451036691666;dx=-1.0507966317993847E-8
    Armijo: th(7.615106680145973E7)=-0.7990982979536057; dx=3.943955669398654E-9 evalInputDelta=-0.5344468057155609
    Armijo: th(3.8075533400729865E7)=-1.3161649256944656; dx=1.4607335901066331E-9 evalInputDelta=-0.017380177974700928
    New Minimum: -1.3335451036691666 > -1.430409699678421
    END: th(1.2691844466909954E7)=-1.430409699678421; dx=-4.4709008978362905E-9 evalInputDelta=0.09686459600925446
    Fitness changed from -1.3335451036691666 to -1.430409699678421
    Iteration 20 complete. Error: -1.430409699678421 Total: 89.5734; Orientation: 0.9715; Line Search: 70.7706
    <a id="p-17"></a>Iteration 20
    <a id="p-16"></a>![Iteration 20](etc/d75e9f6b-2a0d-4569-aa50-b84e4e857774.jpg)
    
    Final threshold in iteration 21: -1.430409699678421 (> -Infinity) after 1628.283s (< 3600.000s)
    

Returns:

    -1.430409699678421