Iteration 1 Iteration 1

Iteration 2 Iteration 2

Iteration 3 Iteration 3

Iteration 4 Iteration 4

Iteration 5 Iteration 5

Iteration 10 Iteration 10

Iteration 15 Iteration 15

Iteration 20 Iteration 20

Iteration 25 Iteration 25

Iteration 30 Iteration 30

Code from BasicOptimizer.scala:88 executed in 370.54 seconds (3.539 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: 4541945236857
    Reset training subject: 4544841172758
    Adding measurement 5e90dc22 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=1.558721736073494;dx=-1.4183424426248993E-7
    New Minimum: 1.558721736073494 > 1.558721348643303
    WOLFE (weak): th(2.154434690031884)=1.558721348643303; dx=-1.4056121928961868E-7 evalInputDelta=3.8743019104003906E-7
    New Minimum: 1.558721348643303 > 1.5587205737829208
    WOLFE (weak): th(4.308869380063768)=1.5587205737829208; dx=-1.4062099699860283E-7 evalInputDelta=1.1622905731201172E-6
    New Minimum: 1.5587205737829208 > 1.5587183982133865
    WOLFE (weak): th(12.926608140191302)=1.5587183982133865; dx=-1.4060565360439403E-7 evalInputDelta=3.337860107421875E-6
    New Minimum: 1.5587183982133865 > 1.5587089508771896
    WOLFE (weak): th(51.70643256076521)=1.5587089508771896; dx=-1.4061351884665643E-7 evalInputDelta=1.2785196304321289E-5
    New Minimum: 1.5587089508771896 > 1.5586583018302917
    WOLFE (weak): th(258.53216280382605)=1.5586583018302917; dx=-1.405834462620629E-7 evalInputDelta=6.343424320220947E-5
    New Minimum: 1.5586583018302917 > 1.558341696858406
    WOLFE (weak): th(1551.1929768229563)=1.558341696858406; dx=-1.406064034650499E-7 evalInputDelta=3.800392150878906E-4
    New Minimum: 1.558341696858406 > 1.556062400341034
    WOLFE (weak): th(10858.350837760694)=1.556062400341034; dx=-1.405508468563715E-7 evalInputDelta=0.002659335732460022
    New Minimum: 1.556062400341034 > 1.537498578429222
    WOLFE (weak): th(86866.80670208555)=1.537498578429222; dx=-1.398223093714346E-7 evalInputDelta=0.02122315764427185
    New Minimum: 1.537498578429222 > 1.3736966252326965
    WOLFE (weak): th(781801.26031877)=1.3736966252326965; dx=-1.3156268592436078E-7 evalInputDelta=0.18502511084079742
    New Minimum: 1.3736966252326965 > 0.318660169839859
    END: th(7818012.6031877)=0.318660169839859; dx=-5.895356176771452E-8 evalInputDelta=1.240061566233635
    Fitness changed from 1.558721736073494 to 0.318660169839859
    Iteration 1 complete. Error: 0.318660169839859 Tota

...skipping 25492 bytes...

    98576)=-1.7507047057151794; dx=-4.018426871239212E-10 evalInputDelta=0.003801286220550537
    Fitness changed from -1.746903419494629 to -1.7507047057151794
    Iteration 28 complete. Error: -1.7507047057151794 Total: 11.6526; Orientation: 0.3252; Line Search: 8.6236
    Adding measurement 740b347b to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 2.591e+03, gradient 2.409e-05, dot -0.644; [2ba17d58-95f1-4cb1-a9f0-019473d76f0f = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.7507047057151794, -0.4792059361934662, 0.318660169839859, 1.558721736073494
    LBFGS Accumulation History: 3 points
    Removed measurement 740b347b to history. Total: 3
    th(0)=-1.7507047057151794;dx=-5.761984315224151E-10
    New Minimum: -1.7507047057151794 > -1.7544963732361794
    END: th(7344817.399832152)=-1.7544963732361794; dx=-3.518691221861187E-10 evalInputDelta=0.0037916675209999084
    Fitness changed from -1.7507047057151794 to -1.7544963732361794
    Iteration 29 complete. Error: -1.7544963732361794 Total: 8.7240; Orientation: 0.3276; Line Search: 5.6802
    Adding measurement 696c13a0 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 2.653e+03, gradient 2.806e-05, dot -0.575; [2ba17d58-95f1-4cb1-a9f0-019473d76f0f = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.7544963732361794, -0.4792059361934662, 0.318660169839859, 1.558721736073494
    LBFGS Accumulation History: 3 points
    Removed measurement 696c13a0 to history. Total: 3
    th(0)=-1.7544963732361794;dx=-7.857963196990079E-10
    New Minimum: -1.7544963732361794 > -1.754870556294918
    END: th(1.582392939814817E7)=-1.754870556294918; dx=-8.465350476081981E-12 evalInputDelta=3.741830587387085E-4
    Fitness changed from -1.7544963732361794 to -1.754870556294918
    Iteration 30 complete. Error: -1.754870556294918 Total: 8.5881; Orientation: 0.3279; Line Search: 5.4959
    <a id="p-21"></a>Iteration 30
    <a id="p-20"></a>![Iteration 30](etc/e6f5f8b3-05e8-4792-85cd-211d6bafa952.jpg)
    
    Final threshold in iteration 31: -1.754870556294918 (> -Infinity) after 370.544s (< 3600.000s)
    

Returns:

    -1.754870556294918