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 401.48 seconds (2.750 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: 3158080903570
    Reset training subject: 3165932248126
    Adding measurement 22faf33a to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=7.304086312651634;dx=-2.1072281994095305E-7
    New Minimum: 7.304086312651634 > 7.3040860295295715
    WOLFE (weak): th(2.154434690031884)=7.3040860295295715; dx=-2.0765525677893938E-7 evalInputDelta=2.8312206268310547E-7
    New Minimum: 7.3040860295295715 > 7.304085597395897
    WOLFE (weak): th(4.308869380063768)=7.304085597395897; dx=-2.06878696223517E-7 evalInputDelta=7.152557373046875E-7
    New Minimum: 7.304085597395897 > 7.304083466529846
    WOLFE (weak): th(12.926608140191302)=7.304083466529846; dx=-2.076880930891588E-7 evalInputDelta=2.8461217880249023E-6
    New Minimum: 7.304083466529846 > 7.304075211286545
    WOLFE (weak): th(51.70643256076521)=7.304075211286545; dx=-2.076533917105275E-7 evalInputDelta=1.1101365089416504E-5
    New Minimum: 7.304075211286545 > 7.304029569029808
    WOLFE (weak): th(258.53216280382605)=7.304029569029808; dx=-2.0763526840388359E-7 evalInputDelta=5.6743621826171875E-5
    New Minimum: 7.304029569029808 > 7.303747713565826
    WOLFE (weak): th(1551.1929768229563)=7.303747713565826; dx=-2.0765241592643605E-7 evalInputDelta=3.385990858078003E-4
    New Minimum: 7.303747713565826 > 7.301716238260269
    WOLFE (weak): th(10858.350837760694)=7.301716238260269; dx=-2.0765177571963916E-7 evalInputDelta=0.0023700743913650513
    New Minimum: 7.301716238260269 > 7.285151198506355
    WOLFE (weak): th(86866.80670208555)=7.285151198506355; dx=-2.0716534123282832E-7 evalInputDelta=0.01893511414527893
    New Minimum: 7.285151198506355 > 7.136500343680382
    WOLFE (weak): th(781801.26031877)=7.136500343680382; dx=-2.0034718517192262E-7 evalInputDelta=0.16758596897125244
    New Minimum: 7.136500343680382 > 6.002498283982277
    END: th(7818012.6031877)=6.002498283982277; dx=-1.2857247720566397E-7 evalInputDelta=1.3015880286693573
    Fitness changed from 7.304086312651634 to 6.002498283982277
    Iteration 1 complete. Error: 6.002498283982277 Total: 112.6

...skipping 6004 bytes...

    c3bcb70660 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.10653030872344971, 4.613518312573433, 6.002498283982277, 7.304086312651634
    LBFGS Accumulation History: 3 points
    Removed measurement 76ad304f to history. Total: 3
    th(0)=-0.10653030872344971;dx=-1.2913847763262861E-8
    Armijo: th(2.268000000000001E8)=1.0681574940681458; dx=2.8481375453458097E-9 evalInputDelta=-1.1746878027915955
    New Minimum: -0.10653030872344971 > -0.22809529304504395
    END: th(1.1340000000000004E8)=-0.22809529304504395; dx=-5.234209471671427E-10 evalInputDelta=0.12156498432159424
    Fitness changed from -0.10653030872344971 to -0.22809529304504395
    Iteration 9 complete. Error: -0.22809529304504395 Total: 33.6420; Orientation: 0.8073; Line Search: 25.1481
    Adding measurement 32cdc9c1 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 8.653e+03, gradient 1.099e-04, dot -0.228; [d6df4dab-962e-4c36-b257-03c3bcb70660 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.22809529304504395, 4.613518312573433, 6.002498283982277, 7.304086312651634
    LBFGS Accumulation History: 3 points
    Removed measurement 32cdc9c1 to history. Total: 3
    th(0)=-0.22809529304504395;dx=-1.2061080489920376E-8
    Armijo: th(2.4431289384961572E8)=1.1615926325321198; dx=3.6524357621763147E-9 evalInputDelta=-1.3896879255771637
    New Minimum: -0.22809529304504395 > -0.31232428550720215
    WOLF (strong): th(1.2215644692480786E8)=-0.31232428550720215; dx=3.397809246795062E-10 evalInputDelta=0.0842289924621582
    New Minimum: -0.31232428550720215 > -0.5416432321071625
    END: th(4.071881564160262E7)=-0.5416432321071625; dx=-6.571562126032593E-9 evalInputDelta=0.31354793906211853
    Fitness changed from -0.22809529304504395 to -0.5416432321071625
    Iteration 10 complete. Error: -0.5416432321071625 Total: 42.4051; Orientation: 0.8051; Line Search: 32.9922
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/8b84ee0f-2e5f-40c2-9977-6b42b8668f35.jpg)
    
    Final threshold in iteration 11: -0.5416432321071625 (> -Infinity) after 401.474s (< 3600.000s)
    

Returns:

    -0.5416432321071625