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 429.10 seconds (5.164 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: 3055666330259
    Reset training subject: 3065478027847
    Adding measurement 8fa6f8e to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=8.193629808723927;dx=-7.656822863159997E-8
    New Minimum: 8.193629808723927 > 8.193629570305347
    WOLFE (weak): th(2.154434690031884)=8.193629570305347; dx=-7.654649166873821E-8 evalInputDelta=2.384185791015625E-7
    New Minimum: 8.193629570305347 > 8.193629272282124
    WOLFE (weak): th(4.308869380063768)=8.193629272282124; dx=-7.655888380673045E-8 evalInputDelta=5.364418029785156E-7
    New Minimum: 8.193629272282124 > 8.193628564476967
    WOLFE (weak): th(12.926608140191302)=8.193628564476967; dx=-7.653704808383556E-8 evalInputDelta=1.2442469596862793E-6
    New Minimum: 8.193628564476967 > 8.193624012172222
    WOLFE (weak): th(51.70643256076521)=8.193624012172222; dx=-7.656563319891479E-8 evalInputDelta=5.796551704406738E-6
    New Minimum: 8.193624012172222 > 8.193600825965405
    WOLFE (weak): th(258.53216280382605)=8.193600825965405; dx=-7.652019031986173E-8 evalInputDelta=2.898275852203369E-5
    New Minimum: 8.193600825965405 > 8.19345609843731
    WOLFE (weak): th(1551.1929768229563)=8.19345609843731; dx=-7.656261991986207E-8 evalInputDelta=1.7371028661727905E-4
    New Minimum: 8.19345609843731 > 8.192413464188576
    WOLFE (weak): th(10858.350837760694)=8.192413464188576; dx=-7.656053039139294E-8 evalInputDelta=0.0012163445353507996
    New Minimum: 8.192413464188576 > 8.183895513415337
    WOLFE (weak): th(86866.80670208555)=8.183895513415337; dx=-7.654039846155086E-8 evalInputDelta=0.009734295308589935
    New Minimum: 8.183895513415337 > 8.105473443865776
    WOLFE (weak): th(781801.26031877)=8.105473443865776; dx=-7.6406175936044E-8 evalInputDelta=0.08815636485815048
    New Minimum: 8.105473443865776 > 7.312760852277279
    END: th(7818012.6031877)=7.312760852277279; dx=-6.612997362332533E-8 evalInputDelta=0.8808689564466476
    Fitness changed from 8.193629808723927 to 7.312760852277279
    Iteration 1 complete. Error: 7.312760852277279 Total: 124.8668; Orientation:

...skipping 5970 bytes...

    .9579; Line Search: 17.8768
    Adding measurement 72a8402b to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 2.572e+03, gradient 4.508e-05, dot -0.281; [f499080a-9a26-4aa7-8b99-8dedf2801536 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.18219894170761108, 5.5948420241475105, 7.312760852277279, 8.193629808723927
    LBFGS Accumulation History: 3 points
    Removed measurement 72a8402b to history. Total: 3
    th(0)=-0.18219894170761108;dx=-2.028315756848512E-9
    New Minimum: -0.18219894170761108 > -0.2764556407928467
    END: th(1.5120000000000006E8)=-0.2764556407928467; dx=-3.718473247587473E-10 evalInputDelta=0.0942566990852356
    Fitness changed from -0.18219894170761108 to -0.2764556407928467
    Iteration 9 complete. Error: -0.2764556407928467 Total: 27.9039; Orientation: 1.0138; Line Search: 17.8729
    Adding measurement 8aa6645 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.362e+03, gradient 5.783e-05, dot -0.440; [f499080a-9a26-4aa7-8b99-8dedf2801536 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.2764556407928467, 5.5948420241475105, 7.312760852277279, 8.193629808723927
    LBFGS Accumulation History: 3 points
    Removed measurement 8aa6645 to history. Total: 3
    th(0)=-0.2764556407928467;dx=-3.3404780324413038E-9
    Armijo: th(3.2575052513282096E8)=2.0528776347637177; dx=8.977085082353532E-9 evalInputDelta=-2.3293332755565643
    Armijo: th(1.6287526256641048E8)=0.06711967289447784; dx=3.673975690245562E-9 evalInputDelta=-0.3435753136873245
    New Minimum: -0.2764556407928467 > -0.3859255909919739
    END: th(5.4291754188803494E7)=-0.3859255909919739; dx=-2.2626876404026782E-10 evalInputDelta=0.1094699501991272
    Fitness changed from -0.2764556407928467 to -0.3859255909919739
    Iteration 10 complete. Error: -0.3859255909919739 Total: 45.7845; Orientation: 0.9902; Line Search: 35.0019
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/0c22b679-e1c9-4b74-8320-3479210a7934.jpg)
    
    Final threshold in iteration 11: -0.3859255909919739 (> -Infinity) after 429.097s (< 3600.000s)
    

Returns:

    -0.3859255909919739