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 133.33 seconds (2.416 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: 10982865005752
    Reset training subject: 10986067352082
    Adding measurement d39ec6b to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=25.420871811918914;dx=-1.9062291146487268E-5
    New Minimum: 25.420871811918914 > 25.42077860981226
    END: th(2.154434690031884)=25.42077860981226; dx=-1.712573604621248E-5 evalInputDelta=9.320210665464401E-5
    Fitness changed from 25.420871811918914 to 25.42077860981226
    Iteration 1 complete. Error: 25.42077860981226 Total: 16.6562; Orientation: 0.0025; Line Search: 7.1738
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/39e91a08-f2c4-4ec3-aae4-2c5ba700bb2f.jpg)
    
    Adding measurement 43859177 to history. Total: 1
    LBFGS Accumulation History: 2 points
    th(0)=25.42077860981226;dx=-1.950403815334451E-5
    New Minimum: 25.42077860981226 > 25.420578751480207
    WOLFE (weak): th(4.641588833612779)=25.420578751480207; dx=-1.979331969489182E-5 evalInputDelta=1.9985833205282688E-4
    New Minimum: 25.420578751480207 > 25.420377478469163
    WOLFE (weak): th(9.283177667225559)=25.420377478469163; dx=-1.9254221184531484E-5 evalInputDelta=4.011313430964947E-4
    New Minimum: 25.420377478469163 > 25.419575139298104
    WOLFE (weak): th(27.849533001676676)=25.419575139298104; dx=-1.8647640764191346E-5 evalInputDelta=0.0012034705141559243
    New Minimum: 25.419575139298104 > 25.415948596782982
    WOLFE (weak): th(111.3981320067067)=25.415948596782982; dx=-1.9167450514268328E-5 evalInputDelta=0.004830013029277325
    New Minimum: 25.415948596782982 > 25.398419621866196
    WOLFE (weak): th(556.9906600335335)=25.398419621866196; dx=-1.889482232744265E-5 evalInputDelta=0.02235898794606328
    New Minimum: 25.398419621866196 > 25.289861870463938
    END: th(3341.9439602012008)=25.289861870463938; dx=-1.6192267887637485E-5 evalInputDelta=0.13091673934832215
    Fitness changed from 25.42077860981226 to 25.289861870463938
    Iteration 2 complete. Error: 25.289861870463938 Total: 28.4057; Orientation: 0.0030; Line Search: 23.3487
    <a id="p-5"></a>Iteration 2
    <a id="p-4">

...skipping 4846 bytes...

    lInputDelta=2.33190356194973
    Fitness changed from 13.095138631761074 to 10.763235069811344
    Iteration 8 complete. Error: 10.763235069811344 Total: 9.7686; Orientation: 0.1288; Line Search: 6.4774
    Adding measurement 1c25dde0 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.269e+03, gradient 9.609e-04, dot -0.296; [e0ca9343-f203-424d-96e5-d27764720a62 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 10.763235069811344, 25.289861870463938, 25.42077860981226, 25.420871811918914
    LBFGS Accumulation History: 3 points
    Removed measurement 1c25dde0 to history. Total: 3
    th(0)=10.763235069811344;dx=-8.544112476687283E-7
    New Minimum: 10.763235069811344 > 8.803191356360912
    END: th(4320000.0)=8.803191356360912; dx=-1.1191231075666929E-7 evalInputDelta=1.9600437134504318
    Fitness changed from 10.763235069811344 to 8.803191356360912
    Iteration 9 complete. Error: 8.803191356360912 Total: 9.5346; Orientation: 0.0736; Line Search: 6.3253
    Adding measurement 3a93d12c to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.012e+03, gradient 7.955e-04, dot -0.174; [e0ca9343-f203-424d-96e5-d27764720a62 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 8.803191356360912, 25.289861870463938, 25.42077860981226, 25.420871811918914
    LBFGS Accumulation History: 3 points
    Removed measurement 3a93d12c to history. Total: 3
    th(0)=8.803191356360912;dx=-5.76202407599194E-7
    Armijo: th(9307157.860937739)=10.92666532844305; dx=1.1691310377833263E-7 evalInputDelta=-2.123473972082138
    New Minimum: 8.803191356360912 > 7.352316200733185
    END: th(4653578.930468869)=7.352316200733185; dx=-5.439422702805442E-9 evalInputDelta=1.4508751556277275
    Fitness changed from 8.803191356360912 to 7.352316200733185
    Iteration 10 complete. Error: 7.352316200733185 Total: 14.2835; Orientation: 0.1344; Line Search: 11.0697
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/20f4a132-7df8-48ee-933a-6b70cd5d7625.jpg)
    
    Final threshold in iteration 11: 7.352316200733185 (> -Infinity) after 133.333s (< 1800.000s)
    

Returns:

    7.352316200733185