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 400.48 seconds (3.117 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: 9312005530348
    Reset training subject: 9319966522078
    Adding measurement 275d8841 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=0.25197482109069824;dx=-2.7279234434484866E-8
    New Minimum: 0.25197482109069824 > 0.25197458267211914
    WOLFE (weak): th(2.154434690031884)=0.25197458267211914; dx=-2.7278187187831288E-8 evalInputDelta=2.384185791015625E-7
    WOLFE (weak): th(4.308869380063768)=0.25197461247444153; dx=-2.727852139776644E-8 evalInputDelta=2.086162567138672E-7
    New Minimum: 0.25197458267211914 > 0.25197434425354004
    WOLFE (weak): th(12.926608140191302)=0.25197434425354004; dx=-2.728423338336283E-8 evalInputDelta=4.76837158203125E-7
    New Minimum: 0.25197434425354004 > 0.2519734799861908
    WOLFE (weak): th(51.70643256076521)=0.2519734799861908; dx=-2.7267881568959857E-8 evalInputDelta=1.341104507446289E-6
    New Minimum: 0.2519734799861908 > 0.25196826457977295
    WOLFE (weak): th(258.53216280382605)=0.25196826457977295; dx=-2.7276806387926403E-8 evalInputDelta=6.556510925292969E-6
    New Minimum: 0.25196826457977295 > 0.25193536281585693
    WOLFE (weak): th(1551.1929768229563)=0.25193536281585693; dx=-2.7276911974462273E-8 evalInputDelta=3.9458274841308594E-5
    New Minimum: 0.25193536281585693 > 0.25169944763183594
    WOLFE (weak): th(10858.350837760694)=0.25169944763183594; dx=-2.727677132031781E-8 evalInputDelta=2.753734588623047E-4
    New Minimum: 0.25169944763183594 > 0.24977564811706543
    WOLFE (weak): th(86866.80670208555)=0.24977564811706543; dx=-2.722203622432259E-8 evalInputDelta=0.0021991729736328125
    New Minimum: 0.24977564811706543 > 0.23235434293746948
    WOLFE (weak): th(781801.26031877)=0.23235434293746948; dx=-2.6856255187433463E-8 evalInputDelta=0.01962047815322876
    New Minimum: 0.23235434293746948 > 0.07538577914237976
    END: th(7818012.6031877)=0.07538577914237976; dx=-2.294728627330017E-8 evalInputDelta=0.17658904194831848
    Fitness changed from 0.25197482109069824 to 0.07538577914237976
    Iteration 1 complete. Error: 0.07538577914237976 Total: 1

...skipping 6153 bytes...

    -9c20a475286a = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.0616036653518677, -0.179512619972229, 0.07538577914237976, 0.25197482109069824
    LBFGS Accumulation History: 3 points
    Removed measurement 3f1719fb to history. Total: 3
    th(0)=-1.0616036653518677;dx=-7.015902452440156E-9
    Armijo: th(1.5120000000000006E8)=-0.6331610083580017; dx=1.084914297237002E-9 evalInputDelta=-0.42844265699386597
    New Minimum: -1.0616036653518677 > -1.1076694130897522
    END: th(7.560000000000003E7)=-1.1076694130897522; dx=-5.287576593623377E-10 evalInputDelta=0.04606574773788452
    Fitness changed from -1.0616036653518677 to -1.1076694130897522
    Iteration 9 complete. Error: -1.1076694130897522 Total: 34.8716; Orientation: 0.8138; Line Search: 25.3377
    Adding measurement 288b2d9c to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.952e+04, gradient 8.605e-05, dot -0.397; [e296b433-e140-425e-9a0e-9c20a475286a = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.1076694130897522, -0.179512619972229, 0.07538577914237976, 0.25197482109069824
    LBFGS Accumulation History: 3 points
    Removed measurement 288b2d9c to history. Total: 3
    th(0)=-1.1076694130897522;dx=-7.393146513796859E-9
    Armijo: th(1.6287526256641048E8)=-0.49761322140693665; dx=1.8050875463811225E-9 evalInputDelta=-0.6100561916828156
    New Minimum: -1.1076694130897522 > -1.111985296010971
    WOLF (strong): th(8.143763128320524E7)=-1.111985296010971; dx=1.3071335275870808E-10 evalInputDelta=0.004315882921218872
    New Minimum: -1.111985296010971 > -1.2307092249393463
    END: th(2.7145877094401747E7)=-1.2307092249393463; dx=-4.1616056335900026E-9 evalInputDelta=0.12303981184959412
    Fitness changed from -1.1076694130897522 to -1.2307092249393463
    Iteration 10 complete. Error: -1.2307092249393463 Total: 41.2251; Orientation: 0.8160; Line Search: 32.3334
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/9556c771-cea0-4316-8011-76d6fb035c6d.jpg)
    
    Final threshold in iteration 11: -1.2307092249393463 (> -Infinity) after 400.478s (< 3600.000s)
    

Returns:

    -1.2307092249393463