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 1414.55 seconds (8.242 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: 4926284977738
    Reset training subject: 4938586693910
    Adding measurement 620d60d1 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=3.72481831908226;dx=-1.26947158105201E-7
    New Minimum: 3.72481831908226 > 3.7248182892799377
    WOLFE (weak): th(2.154434690031884)=3.7248182892799377; dx=-1.2662126419003717E-7 evalInputDelta=2.9802322387695312E-8
    New Minimum: 3.7248182892799377 > 3.724817767739296
    WOLFE (weak): th(4.308869380063768)=3.724817767739296; dx=-1.266110263784338E-7 evalInputDelta=5.513429641723633E-7
    New Minimum: 3.724817767739296 > 3.724815919995308
    WOLFE (weak): th(12.926608140191302)=3.724815919995308; dx=-1.266047027158881E-7 evalInputDelta=2.3990869522094727E-6
    New Minimum: 3.724815919995308 > 3.7248084396123886
    WOLFE (weak): th(51.70643256076521)=3.7248084396123886; dx=-1.2659565954729524E-7 evalInputDelta=9.879469871520996E-6
    New Minimum: 3.7248084396123886 > 3.7247703224420547
    WOLFE (weak): th(258.53216280382605)=3.7247703224420547; dx=-1.2660231673151588E-7 evalInputDelta=4.79966402053833E-5
    New Minimum: 3.7247703224420547 > 3.724530950188637
    WOLFE (weak): th(1551.1929768229563)=3.724530950188637; dx=-1.2660251112435093E-7 evalInputDelta=2.8736889362335205E-4
    New Minimum: 3.724530950188637 > 3.7228072434663773
    WOLFE (weak): th(10858.350837760694)=3.7228072434663773; dx=-1.2659321769023595E-7 evalInputDelta=0.0020110756158828735
    New Minimum: 3.7228072434663773 > 3.70873586833477
    WOLFE (weak): th(86866.80670208555)=3.70873586833477; dx=-1.264919054906802E-7 evalInputDelta=0.01608245074748993
    New Minimum: 3.70873586833477 > 3.580621123313904
    WOLFE (weak): th(781801.26031877)=3.580621123313904; dx=-1.2531875472785612E-7 evalInputDelta=0.14419719576835632
    New Minimum: 3.580621123313904 > 2.4358664005994797
    END: th(7818012.6031877)=2.4358664005994797; dx=-9.409623320096068E-8 evalInputDelta=1.2889519184827805
    Fitness changed from 3.72481831908226 to 2.4358664005994797
    Iteration 1 complete. Error: 2.4358664005994797 Total: 15

...skipping 24605 bytes...

    6760787516832 Total: 66.7758; Orientation: 1.5312; Line Search: 53.5340
    Adding measurement 2d5e99ae to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.343e+03, gradient 1.917e-05, dot -0.319; [d5118c04-4f4d-4d1a-8768-b6a874c02ef1 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -2.5576760787516832, 0.8089641630649567, 2.4358664005994797, 3.72481831908226
    LBFGS Accumulation History: 3 points
    Removed measurement 2d5e99ae to history. Total: 3
    th(0)=-2.5576760787516832;dx=-3.670950186774244E-10
    New Minimum: -2.5576760787516832 > -2.5655822157859802
    END: th(3.917235946577148E7)=-2.5655822157859802; dx=-2.90956256310941E-11 evalInputDelta=0.00790613703429699
    Fitness changed from -2.5576760787516832 to -2.5655822157859802
    Iteration 29 complete. Error: -2.5655822157859802 Total: 35.3591; Orientation: 1.5435; Line Search: 23.0003
    Adding measurement 42cc6d8d to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 9.925e+02, gradient 1.126e-05, dot -0.383; [d5118c04-4f4d-4d1a-8768-b6a874c02ef1 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -2.5655822157859802, 0.8089641630649567, 2.4358664005994797, 3.72481831908226
    LBFGS Accumulation History: 3 points
    Removed measurement 42cc6d8d to history. Total: 3
    th(0)=-2.5655822157859802;dx=-1.2649680059677627E-10
    New Minimum: -2.5655822157859802 > -2.5676213148981333
    WOLF (strong): th(8.439429012345691E7)=-2.5676213148981333; dx=2.6474596247927954E-11 evalInputDelta=0.0020390991121530533
    New Minimum: -2.5676213148981333 > -2.5690351370722055
    END: th(4.2197145061728455E7)=-2.5690351370722055; dx=-4.9859631258669585E-11 evalInputDelta=0.003452921286225319
    Fitness changed from -2.5655822157859802 to -2.5690351370722055
    Iteration 30 complete. Error: -2.5690351370722055 Total: 44.0584; Orientation: 1.5161; Line Search: 32.5783
    <a id="p-21"></a>Iteration 30
    <a id="p-20"></a>![Iteration 30](etc/c5572e39-d2ee-46a8-aa67-8425218c34df.jpg)
    
    Final threshold in iteration 31: -2.5690351370722055 (> -Infinity) after 1414.546s (< 3600.000s)
    

Returns:

    -2.5690351370722055