Iteration 1 Iteration 1

Iteration 2 Iteration 2

Iteration 3 Iteration 3

Iteration 4 Iteration 4

Iteration 5 Iteration 5

Code from BasicOptimizer.scala:75 executed in 12.48 seconds (0.418 gc):

    val lineSearchInstance: LineSearchStrategy = lineSearchFactory
    IterativeTrainer.wrap(trainable)
      .setOrientation(orientation())
      .setMonitor(new TrainingMonitor() {
        override def clear(): Unit = trainingMonitor.clear()
  
        override def log(msg: String): Unit = trainingMonitor.log(msg)
  
        override def onStepFail(currentPoint: Step): Boolean = {
          BasicOptimizer.this.onStepFail(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, currentPoint)
          trainingMonitor.onStepComplete(currentPoint)
          super.onStepComplete(currentPoint)
        }
      })
      .setTimeout(trainingMinutes, TimeUnit.MINUTES)
      .setMaxIterations(trainingIterations)
      .setLineSearchFactory((_: CharSequence) => lineSearchInstance)
      .setTerminateThreshold(java.lang.Double.NEGATIVE_INFINITY)
      .runAndFree
      .asInstanceOf[lang.Double]

Logging:

    Reset training subject: 907823353647200
    Reset training subject: 907823781363700
    Adding measurement 5c2b5f27 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=2.105559602379799;dx=-9.858929846065894E-7
    New Minimum: 2.105559602379799 > 2.105558395385742
    WOLFE (weak): th(2.154434690031884)=2.105558395385742; dx=-9.858938002173124E-7 evalInputDelta=1.2069940567016602E-6
    New Minimum: 2.105558395385742 > 2.105556696653366
    WOLFE (weak): th(4.308869380063768)=2.105556696653366; dx=-9.858899895336625E-7 evalInputDelta=2.905726432800293E-6
    New Minimum: 2.105556696653366 > 2.1055508852005005
    WOLFE (weak): th(12.926608140191302)=2.1055508852005005; dx=-9.85895668726996E-7 evalInputDelta=8.717179298400879E-6
    New Minimum: 2.1055508852005005 > 2.1055244505405426
    WOLFE (weak): th(51.70643256076521)=2.1055244505405426; dx=-9.858810130091018E-7 evalInputDelta=3.515183925628662E-5
    New Minimum: 2.1055244505405426 > 2.105384260416031
    WOLFE (weak): th(258.53216280382605)=2.105384260416031; dx=-9.857129598081588E-7 evalInputDelta=1.7534196376800537E-4
    New Minimum: 2.105384260416031 > 2.104505270719528
    WOLFE (weak): th(1551.1929768229563)=2.104505270719528; dx=-9.85866226405196E-7 evalInputDelta=0.001054331660270691
    New Minimum: 2.104505270719528 > 2.098087638616562
    WOLFE (weak): th(10858.350837760694)=2.098087638616562; dx=-9.861201710967525E-7 evalInputDelta=0.0074719637632369995
    New Minimum: 2.098087638616562 > 2.0407287925481796
    WOLFE (weak): th(86866.80670208555)=2.0407287925481796; dx=-9.587073331463898E-7 evalInputDelta=0.06483080983161926
    New Minimum: 2.0407287925481796 > 1.4843675345182419
    END: th(781801.26031877)=1.4843675345182419; dx=-5.241368625102465E-7 evalInputDelta=0.621192067861557
    Fitness changed from 2.105559602379799 to 1.4843675345182419
    Iteration 1 complete. Error: 1.4843675345182419 Total: 5.5761; Orientation: 0.0034; Line Search: 4.3272
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/2322a2d7-7d80-40e4-a191-cf555

...skipping 1803 bytes...

    339302063 to 0.08330762386322021
    Iteration 4 complete. Error: 0.08330762386322021 Total: 1.3246; Orientation: 0.1034; Line Search: 0.8253
    <a id="p-9"></a>Iteration 4
    <a id="p-8"></a>![Iteration 4](etc/f3665093-a47e-4475-b381-b7678ce59148.jpg)
    
    Adding measurement 1bb6a158 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.404e+03, gradient 1.859e-04, dot -0.962; [8b1f2da0-fc03-401a-ade6-452287decec9 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.4843675345182419, 0.885127067565918, 0.4748266339302063, 0.08330762386322021
    LBFGS Accumulation History: 3 points
    Removed measurement 40364273 to history. Total: 4
    th(0)=0.08330762386322021;dx=-3.456145677301607E-8
    New Minimum: 0.08330762386322021 > -0.18918263912200928
    END: th(1.684339755941405E7)=-0.18918263912200928; dx=-1.1842439050295121E-8 evalInputDelta=0.2724902629852295
    Fitness changed from 0.08330762386322021 to -0.18918263912200928
    Iteration 5 complete. Error: -0.18918263912200928 Total: 1.3550; Orientation: 0.1051; Line Search: 0.8290
    <a id="p-11"></a>Iteration 5
    <a id="p-10"></a>![Iteration 5](etc/1791e322-c567-4160-80d5-2670491aa3a8.jpg)
    
    Adding measurement 466644c3 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.362e+03, gradient 9.528e-05, dot -0.941; [8b1f2da0-fc03-401a-ade6-452287decec9 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.885127067565918, 0.4748266339302063, 0.08330762386322021, -0.18918263912200928
    LBFGS Accumulation History: 3 points
    Removed measurement 75e1a63e to history. Total: 4
    th(0)=-0.18918263912200928;dx=-9.079115174466407E-9
    New Minimum: -0.18918263912200928 > -0.3240533620119095
    END: th(3.6288E7)=-0.3240533620119095; dx=-2.2686072817846517E-9 evalInputDelta=0.1348707228899002
    Fitness changed from -0.18918263912200928 to -0.3240533620119095
    Iteration 6 complete. Error: -0.3240533620119095 Total: 1.6979; Orientation: 0.1053; Line Search: 1.1597
    Final threshold in iteration 7: -0.3240533620119095 (> -Infinity) after 12.484s (< 720.000s)
    

Returns:

    -0.3240533620119095