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 611.72 seconds (3.841 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: 1014758525727
    Reset training subject: 1028432477304
    Adding measurement 310e814c to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=13.037818383425474;dx=-3.016699274208331E-7
    New Minimum: 13.037818383425474 > 13.037816792726517
    WOLFE (weak): th(2.154434690031884)=13.037816792726517; dx=-2.999952464550998E-7 evalInputDelta=1.5906989574432373E-6
    New Minimum: 13.037816792726517 > 13.037816055119038
    WOLFE (weak): th(4.308869380063768)=13.037816055119038; dx=-3.015032455860458E-7 evalInputDelta=2.3283064365386963E-6
    New Minimum: 13.037816055119038 > 13.037811443209648
    WOLFE (weak): th(12.926608140191302)=13.037811443209648; dx=-3.0275672919020573E-7 evalInputDelta=6.940215826034546E-6
    New Minimum: 13.037811443209648 > 13.037788856774569
    WOLFE (weak): th(51.70643256076521)=13.037788856774569; dx=-3.006881645216465E-7 evalInputDelta=2.952665090560913E-5
    New Minimum: 13.037788856774569 > 13.0376689247787
    WOLFE (weak): th(258.53216280382605)=13.0376689247787; dx=-2.9927982879045816E-7 evalInputDelta=1.49458646774292E-4
    New Minimum: 13.0376689247787 > 13.036923468112946
    WOLFE (weak): th(1551.1929768229563)=13.036923468112946; dx=-3.005707280671381E-7 evalInputDelta=8.949153125286102E-4
    New Minimum: 13.036923468112946 > 13.03154418244958
    WOLFE (weak): th(10858.350837760694)=13.03154418244958; dx=-2.9889567186516557E-7 evalInputDelta=0.006274200975894928
    New Minimum: 13.03154418244958 > 12.987740997225046
    WOLFE (weak): th(86866.80670208555)=12.987740997225046; dx=-2.9164663534579254E-7 evalInputDelta=0.05007738620042801
    New Minimum: 12.987740997225046 > 12.601298786699772
    END: th(781801.26031877)=12.601298786699772; dx=-2.4311884611128125E-7 evalInputDelta=0.4365195967257023
    Fitness changed from 13.037818383425474 to 12.601298786699772
    Iteration 1 complete. Error: 12.601298786699772 Total: 181.4065; Orientation: 0.0123; Line Search: 139.8637
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/82a5a009-ddbe-4ddc-9dbf-413ab637425b.jpg

...skipping 5438 bytes...

    2487335 Total: 41.0263; Orientation: 0.2974; Line Search: 26.9776
    Adding measurement 7c63f7b9 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 6.495e+03, gradient 1.934e-04, dot -0.280; [70304a0f-f2ee-401a-8f54-0c6062cfbd6c = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 4.311207592487335, 11.860587000846863, 12.601298786699772, 13.037818383425474
    LBFGS Accumulation History: 3 points
    Removed measurement 7c63f7b9 to history. Total: 3
    th(0)=4.311207592487335;dx=-3.60427618869456E-8
    Armijo: th(6.048000000000001E7)=5.01041916012764; dx=6.30245370422883E-9 evalInputDelta=-0.6992115676403046
    New Minimum: 4.311207592487335 > 3.856770768761635
    END: th(3.0240000000000004E7)=3.856770768761635; dx=-5.538650296799407E-9 evalInputDelta=0.4544368237257004
    Fitness changed from 4.311207592487335 to 3.856770768761635
    Iteration 9 complete. Error: 3.856770768761635 Total: 56.3507; Orientation: 0.2512; Line Search: 41.1487
    Adding measurement 2d828e00 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 6.152e+03, gradient 1.877e-04, dot -0.247; [70304a0f-f2ee-401a-8f54-0c6062cfbd6c = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 3.856770768761635, 11.860587000846863, 12.601298786699772, 13.037818383425474
    LBFGS Accumulation History: 3 points
    Removed measurement 2d828e00 to history. Total: 3
    th(0)=3.856770768761635;dx=-3.431273904985105E-8
    Armijo: th(6.515010502656417E7)=5.085099041461945; dx=9.981215191881925E-9 evalInputDelta=-1.2283282727003098
    New Minimum: 3.856770768761635 > 3.5069519728422165
    END: th(3.2575052513282087E7)=3.5069519728422165; dx=-3.418506711954265E-9 evalInputDelta=0.34981879591941833
    Fitness changed from 3.856770768761635 to 3.5069519728422165
    Iteration 10 complete. Error: 3.5069519728422165 Total: 54.5610; Orientation: 0.2408; Line Search: 40.9127
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/77786373-253a-4eac-b8d2-f572a950e38a.jpg)
    
    Final threshold in iteration 11: 3.5069519728422165 (> -Infinity) after 611.716s (< 1800.000s)
    

Returns:

    3.5069519728422165