Iteration 1 Iteration 1

Iteration 2 Iteration 2

Iteration 3 Iteration 3

Iteration 4 Iteration 4

Iteration 5 Iteration 5

Code from BasicOptimizer.scala:88 executed in 2013.46 seconds (6.431 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: 25477511412138
    Reset training subject: 25527274751542
    Adding measurement 1b467db8 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=1.8993676453828812;dx=-4.2526083504671566E-7
    New Minimum: 1.8993676453828812 > 1.8993666917085648
    WOLFE (weak): th(2.154434690031884)=1.8993666917085648; dx=-4.3055004251341996E-7 evalInputDelta=9.5367431640625E-7
    New Minimum: 1.8993666917085648 > 1.8993649631738663
    WOLFE (weak): th(4.308869380063768)=1.8993649631738663; dx=-4.402889569594192E-7 evalInputDelta=2.682209014892578E-6
    New Minimum: 1.8993649631738663 > 1.899358943104744
    WOLFE (weak): th(12.926608140191302)=1.899358943104744; dx=-4.312717035619321E-7 evalInputDelta=8.702278137207031E-6
    New Minimum: 1.899358943104744 > 1.8993317186832428
    WOLFE (weak): th(51.70643256076521)=1.8993317186832428; dx=-4.304958094590071E-7 evalInputDelta=3.59266996383667E-5
    New Minimum: 1.8993317186832428 > 1.8991858661174774
    WOLFE (weak): th(258.53216280382605)=1.8991858661174774; dx=-4.3120473944968083E-7 evalInputDelta=1.8177926540374756E-4
    New Minimum: 1.8991858661174774 > 1.8982751220464706
    WOLFE (weak): th(1551.1929768229563)=1.8982751220464706; dx=-4.318080334123709E-7 evalInputDelta=0.0010925233364105225
    New Minimum: 1.8982751220464706 > 1.8917307257652283
    WOLFE (weak): th(10858.350837760694)=1.8917307257652283; dx=-4.27218138421045E-7 evalInputDelta=0.007636919617652893
    New Minimum: 1.8917307257652283 > 1.8394091576337814
    WOLFE (weak): th(86866.80670208555)=1.8394091576337814; dx=-4.1618084381660027E-7 evalInputDelta=0.05995848774909973
    New Minimum: 1.8394091576337814 > 1.4370141625404358
    END: th(781801.26031877)=1.4370141625404358; dx=-2.8961781168134867E-7 evalInputDelta=0.4623534828424454
    Fitness changed from 1.8993676453828812 to 1.4370141625404358
    Iteration 1 complete. Error: 1.4370141625404358 Total: 666.9339; Orientation: 0.0523; Line Search: 512.7618
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/fb67bc33-f31f-48b2-b58f-9d7e015bd00

...skipping 3986 bytes...

    y. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.089e+03, gradient 3.281e-04, dot -0.325; [a551b4d4-bec8-4ab0-9382-bf471560577c = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.7762037813663483, 0.7757775634527206, 1.4370141625404358, 1.8993676453828812
    LBFGS Accumulation History: 3 points
    Removed measurement 7edfdb4 to history. Total: 3
    th(0)=-0.7762037813663483;dx=-1.0425088647283519E-7
    Armijo: th(1.3030021005312834E7)=-0.43443121016025543; dx=-3.171875133994112E-9 evalInputDelta=-0.34177257120609283
    New Minimum: -0.7762037813663483 > -1.0945170223712921
    END: th(6515010.502656417)=-1.0945170223712921; dx=-1.7867664809531824E-8 evalInputDelta=0.31831324100494385
    Fitness changed from -0.7762037813663483 to -1.0945170223712921
    Iteration 7 complete. Error: -1.0945170223712921 Total: 205.0597; Orientation: 1.2698; Line Search: 152.9863
    Adding measurement 16c077d4 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.985e+03, gradient 3.178e-04, dot -0.323; [a551b4d4-bec8-4ab0-9382-bf471560577c = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.0945170223712921, 0.7757775634527206, 1.4370141625404358, 1.8993676453828812
    LBFGS Accumulation History: 3 points
    Removed measurement 16c077d4 to history. Total: 3
    th(0)=-1.0945170223712921;dx=-1.0560324686399027E-7
    Armijo: th(1.4036164632845046E7)=-0.18115811049938202; dx=1.6636325736222163E-8 evalInputDelta=-0.9133589118719101
    New Minimum: -1.0945170223712921 > -1.129660815000534
    WOLF (strong): th(7018082.316422523)=-1.129660815000534; dx=6.664958222459525E-10 evalInputDelta=0.03514379262924194
    New Minimum: -1.129660815000534 > -1.3265937864780426
    END: th(2339360.772140841)=-1.3265937864780426; dx=-4.9369596638410686E-8 evalInputDelta=0.2320767641067505
    Fitness changed from -1.0945170223712921 to -1.3265937864780426
    Iteration 8 complete. Error: -1.3265937864780426 Total: 258.8970; Orientation: 1.2829; Line Search: 206.7728
    Final threshold in iteration 8: -1.3265937864780426 (> -Infinity) after 2013.456s (< 1800.000s)
    

Returns:

    -1.3265937864780426