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 399.76 seconds (3.472 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: 5947217317917
    Reset training subject: 5955091496991
    Adding measurement 135d603f to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=7.412770330905914;dx=-2.167774923132577E-7
    New Minimum: 7.412770330905914 > 7.412770062685013
    WOLFE (weak): th(2.154434690031884)=7.412770062685013; dx=-2.1397728202190756E-7 evalInputDelta=2.682209014892578E-7
    New Minimum: 7.412770062685013 > 7.412769183516502
    WOLFE (weak): th(4.308869380063768)=7.412769183516502; dx=-2.1400306659404368E-7 evalInputDelta=1.1473894119262695E-6
    New Minimum: 7.412769183516502 > 7.412767395377159
    WOLFE (weak): th(12.926608140191302)=7.412767395377159; dx=-2.1404667050027246E-7 evalInputDelta=2.9355287551879883E-6
    New Minimum: 7.412767395377159 > 7.412758886814117
    WOLFE (weak): th(51.70643256076521)=7.412758886814117; dx=-2.1402001602263633E-7 evalInputDelta=1.1444091796875E-5
    New Minimum: 7.412758886814117 > 7.4127132296562195
    WOLFE (weak): th(258.53216280382605)=7.4127132296562195; dx=-2.1401523669425476E-7 evalInputDelta=5.710124969482422E-5
    New Minimum: 7.4127132296562195 > 7.4124287366867065
    WOLFE (weak): th(1551.1929768229563)=7.4124287366867065; dx=-2.1400643609788973E-7 evalInputDelta=3.4159421920776367E-4
    New Minimum: 7.4124287366867065 > 7.410380378365517
    WOLFE (weak): th(10858.350837760694)=7.410380378365517; dx=-2.137115164781832E-7 evalInputDelta=0.002389952540397644
    New Minimum: 7.410380378365517 > 7.393672093749046
    WOLFE (weak): th(86866.80670208555)=7.393672093749046; dx=-2.135234059202955E-7 evalInputDelta=0.01909823715686798
    New Minimum: 7.393672093749046 > 7.243523061275482
    WOLFE (weak): th(781801.26031877)=7.243523061275482; dx=-2.0706661034112785E-7 evalInputDelta=0.16924726963043213
    New Minimum: 7.243523061275482 > 6.070567473769188
    END: th(7818012.6031877)=6.070567473769188; dx=-1.335287321881954E-7 evalInputDelta=1.3422028571367264
    Fitness changed from 7.412770330905914 to 6.070567473769188
    Iteration 1 complete. Error: 6.070567473769188 Total: 117.30

...skipping 5892 bytes...

    tal: 3
    Rejected: LBFGS Orientation magnitude: 9.044e+03, gradient 1.174e-04, dot -0.247; [309dca31-5c63-47e5-b1ec-ef3a5f5ea7b5 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.13522183895111084, 4.668923228979111, 6.070567473769188, 7.412770330905914
    LBFGS Accumulation History: 3 points
    Removed measurement 4becc137 to history. Total: 3
    th(0)=-0.13522183895111084;dx=-1.3742154111838684E-8
    Armijo: th(2.268000000000001E8)=1.1772772073745728; dx=3.446689927854821E-9 evalInputDelta=-1.3124990463256836
    New Minimum: -0.13522183895111084 > -0.23371759057044983
    WOLF (strong): th(1.1340000000000004E8)=-0.23371759057044983; dx=7.933199430320349E-11 evalInputDelta=0.09849575161933899
    New Minimum: -0.23371759057044983 > -0.45857539772987366
    END: th(3.7800000000000015E7)=-0.45857539772987366; dx=-7.445264647243867E-9 evalInputDelta=0.3233535587787628
    Fitness changed from -0.13522183895111084 to -0.45857539772987366
    Iteration 9 complete. Error: -0.45857539772987366 Total: 43.9821; Orientation: 0.8041; Line Search: 34.1190
    Adding measurement 11c2ff24 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 9.610e+03, gradient 9.047e-05, dot -0.278; [309dca31-5c63-47e5-b1ec-ef3a5f5ea7b5 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.45857539772987366, 4.668923228979111, 6.070567473769188, 7.412770330905914
    LBFGS Accumulation History: 3 points
    Removed measurement 11c2ff24 to history. Total: 3
    th(0)=-0.45857539772987366;dx=-8.167242562856843E-9
    New Minimum: -0.45857539772987366 > -0.6635766327381134
    END: th(8.143763128320524E7)=-0.6635766327381134; dx=-3.147752803001725E-9 evalInputDelta=0.20500123500823975
    Fitness changed from -0.45857539772987366 to -0.6635766327381134
    Iteration 10 complete. Error: -0.6635766327381134 Total: 24.9771; Orientation: 1.1802; Line Search: 15.7896
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/970a0d6f-13e9-4fb6-a92a-cf08e1f819fa.jpg)
    
    Final threshold in iteration 11: -0.6635766327381134 (> -Infinity) after 399.759s (< 3600.000s)
    

Returns:

    -0.6635766327381134