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 67.38 seconds (2.443 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: 1428674374762
    Reset training subject: 1430042086441
    Adding measurement 23620288 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=26.887326278723776;dx=-1.0381259713858668E-5
    New Minimum: 26.887326278723776 > 26.887300646863878
    WOLFE (weak): th(2.154434690031884)=26.887300646863878; dx=-1.0368109708902732E-5 evalInputDelta=2.56318598985672E-5
    New Minimum: 26.887300646863878 > 26.887274069711566
    WOLFE (weak): th(4.308869380063768)=26.887274069711566; dx=-1.0394235535630773E-5 evalInputDelta=5.220901221036911E-5
    New Minimum: 26.887274069711566 > 26.887168718501925
    WOLFE (weak): th(12.926608140191302)=26.887168718501925; dx=-1.0388859123390546E-5 evalInputDelta=1.5756022185087204E-4
    New Minimum: 26.887168718501925 > 26.8866969589144
    WOLFE (weak): th(51.70643256076521)=26.8866969589144; dx=-1.0399270437733608E-5 evalInputDelta=6.293198093771935E-4
    New Minimum: 26.8866969589144 > 26.884175687097013
    WOLFE (weak): th(258.53216280382605)=26.884175687097013; dx=-1.0421350882257852E-5 evalInputDelta=0.003150591626763344
    New Minimum: 26.884175687097013 > 26.868335343897343
    WOLFE (weak): th(1551.1929768229563)=26.868335343897343; dx=-1.0465507136682684E-5 evalInputDelta=0.01899093482643366
    New Minimum: 26.868335343897343 > 26.75080714188516
    WOLFE (weak): th(10858.350837760694)=26.75080714188516; dx=-1.0837808037481174E-5 evalInputDelta=0.13651913683861494
    New Minimum: 26.75080714188516 > 25.783778694458306
    WOLFE (weak): th(86866.80670208555)=25.783778694458306; dx=-9.719744231443045E-6 evalInputDelta=1.1035475842654705
    New Minimum: 25.783778694458306 > 21.194365065544844
    END: th(781801.26031877)=21.194365065544844; dx=-4.334699442597873E-6 evalInputDelta=5.692961213178933
    Fitness changed from 26.887326278723776 to 21.194365065544844
    Iteration 1 complete. Error: 21.194365065544844 Total: 19.0971; Orientation: 0.0030; Line Search: 15.0284
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/64d69696-5093-437f-9e08-76762ce0e266.jpg)
    
    A

...skipping 5859 bytes...

    earch: 3.9229
    Adding measurement 782c10b0 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.770e+03, gradient 3.965e-04, dot -0.323; [82272312-3e85-4f8f-bedc-986540bbf73d = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.6141289174556732, 12.685820877552032, 21.194365065544844, 26.887326278723776
    LBFGS Accumulation History: 3 points
    Removed measurement 782c10b0 to history. Total: 3
    th(0)=1.6141289174556732;dx=-1.5654555756555102E-7
    New Minimum: 1.6141289174556732 > 1.257938951253891
    END: th(5040000.000000001)=1.257938951253891; dx=-1.888390176563624E-8 evalInputDelta=0.3561899662017822
    Fitness changed from 1.6141289174556732 to 1.257938951253891
    Iteration 9 complete. Error: 1.257938951253891 Total: 3.9934; Orientation: 0.1311; Line Search: 2.6687
    Adding measurement 46eb9c54 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.301e+03, gradient 4.544e-04, dot -0.309; [82272312-3e85-4f8f-bedc-986540bbf73d = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.257938951253891, 12.685820877552032, 21.194365065544844, 26.887326278723776
    LBFGS Accumulation History: 3 points
    Removed measurement 46eb9c54 to history. Total: 3
    th(0)=1.257938951253891;dx=-2.0538800732775007E-7
    Armijo: th(1.0858350837760696E7)=1.8429693132638931; dx=9.751551170791973E-8 evalInputDelta=-0.5850303620100021
    New Minimum: 1.257938951253891 > 1.1170824021100998
    WOLF (strong): th(5429175.418880348)=1.1170824021100998; dx=5.855252772485905E-8 evalInputDelta=0.1408565491437912
    New Minimum: 1.1170824021100998 > 1.010568544268608
    END: th(1809725.1396267826)=1.010568544268608; dx=-7.66209592090844E-8 evalInputDelta=0.2473704069852829
    Fitness changed from 1.257938951253891 to 1.010568544268608
    Iteration 10 complete. Error: 1.010568544268608 Total: 7.0429; Orientation: 0.1094; Line Search: 5.5584
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/20db57bc-b84e-4ac3-80e6-e8e677c2c354.jpg)
    
    Final threshold in iteration 11: 1.010568544268608 (> -Infinity) after 67.374s (< 3600.000s)
    

Returns:

    1.010568544268608