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 541.09 seconds (8.887 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: 610727339530100
    Reset training subject: 610738496277200
    Adding measurement 228abb6 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=1.6697288751602173;dx=-2.5899095660058256E-7
    New Minimum: 1.6697288751602173 > 1.6697282195091248
    WOLFE (weak): th(2.154434690031884)=1.6697282195091248; dx=-2.5896217228558084E-7 evalInputDelta=6.556510925292969E-7
    New Minimum: 1.6697282195091248 > 1.6697275787591934
    WOLFE (weak): th(4.308869380063768)=1.6697275787591934; dx=-2.589932831022839E-7 evalInputDelta=1.296401023864746E-6
    New Minimum: 1.6697275787591934 > 1.6697240769863129
    WOLFE (weak): th(12.926608140191302)=1.6697240769863129; dx=-2.590096636375522E-7 evalInputDelta=4.798173904418945E-6
    New Minimum: 1.6697240769863129 > 1.6697095334529877
    WOLFE (weak): th(51.70643256076521)=1.6697095334529877; dx=-2.5896977376992756E-7 evalInputDelta=1.9341707229614258E-5
    New Minimum: 1.6697095334529877 > 1.6696324944496155
    WOLFE (weak): th(258.53216280382605)=1.6696324944496155; dx=-2.590148344932381E-7 evalInputDelta=9.638071060180664E-5
    New Minimum: 1.6696324944496155 > 1.6691493093967438
    WOLFE (weak): th(1551.1929768229563)=1.6691493093967438; dx=-2.5883554387492996E-7 evalInputDelta=5.795657634735107E-4
    New Minimum: 1.6691493093967438 > 1.6656774878501892
    WOLFE (weak): th(10858.350837760694)=1.6656774878501892; dx=-2.5814084931239863E-7 evalInputDelta=0.004051387310028076
    New Minimum: 1.6656774878501892 > 1.637671336531639
    WOLFE (weak): th(86866.80670208555)=1.637671336531639; dx=-2.527161796577991E-7 evalInputDelta=0.032057538628578186
    New Minimum: 1.637671336531639 > 1.4110343754291534
    END: th(781801.26031877)=1.4110343754291534; dx=-2.0164880461819187E-7 evalInputDelta=0.25869449973106384
    Fitness changed from 1.6697288751602173 to 1.4110343754291534
    Iteration 1 complete. Error: 1.4110343754291534 Total: 144.5514; Orientation: 0.0267; Line Search: 110.6563
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/29

...skipping 5980 bytes...

    Adding measurement 188ed849 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.646e+03, gradient 1.770e-04, dot -0.561; [3b356bde-867f-4732-a8b1-a4c844d5ec81 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.6352986246347427, 1.0529417097568512, 1.4110343754291534, 1.6697288751602173
    LBFGS Accumulation History: 3 points
    Removed measurement 188ed849 to history. Total: 3
    th(0)=-0.6352986246347427;dx=-3.128930091739004E-8
    Armijo: th(1.5120000000000004E7)=-0.6043388396501541; dx=1.2360151064020485E-8 evalInputDelta=-0.030959784984588623
    New Minimum: -0.6352986246347427 > -0.7518105357885361
    WOLF (strong): th(7560000.000000002)=-0.7518105357885361; dx=2.536764391954909E-9 evalInputDelta=0.11651191115379333
    END: th(2520000.0000000005)=-0.7194693684577942; dx=-1.9643877126489833E-8 evalInputDelta=0.08417074382305145
    Fitness changed from -0.6352986246347427 to -0.7518105357885361
    Iteration 9 complete. Error: -0.7518105357885361 Total: 58.6576; Orientation: 0.3980; Line Search: 47.3114
    Adding measurement 10888355 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.942e+03, gradient 1.888e-04, dot -0.501; [3b356bde-867f-4732-a8b1-a4c844d5ec81 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.7518105357885361, 1.0529417097568512, 1.4110343754291534, 1.6697288751602173
    LBFGS Accumulation History: 3 points
    Removed measurement 10888355 to history. Total: 3
    th(0)=-0.7518105357885361;dx=-3.56157774510424E-8
    New Minimum: -0.7518105357885361 > -0.8660207092761993
    END: th(5429175.418880348)=-0.8660207092761993; dx=-1.0037209282020271E-9 evalInputDelta=0.11421017348766327
    Fitness changed from -0.7518105357885361 to -0.8660207092761993
    Iteration 10 complete. Error: -0.8660207092761993 Total: 34.4867; Orientation: 0.3876; Line Search: 22.3604
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/1a9f30c6-8938-426b-8516-f8fb6a9316d8.jpg)
    
    Final threshold in iteration 11: -0.8660207092761993 (> -Infinity) after 541.085s (< 3600.000s)
    

Returns:

    -0.8660207092761993