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 136.83 seconds (4.585 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: 1816927761903
    Reset training subject: 1820684569080
    Adding measurement 1d818172 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=3.196916162967682;dx=-1.229795487038948E-6
    New Minimum: 3.196916162967682 > 3.1969120651483536
    WOLFE (weak): th(2.154434690031884)=3.1969120651483536; dx=-1.2293384977656327E-6 evalInputDelta=4.0978193283081055E-6
    New Minimum: 3.1969120651483536 > 3.196908101439476
    WOLFE (weak): th(4.308869380063768)=3.196908101439476; dx=-1.229462070446327E-6 evalInputDelta=8.061528205871582E-6
    New Minimum: 3.196908101439476 > 3.196892097592354
    WOLFE (weak): th(12.926608140191302)=3.196892097592354; dx=-1.229125721907679E-6 evalInputDelta=2.4065375328063965E-5
    New Minimum: 3.196892097592354 > 3.1968209743499756
    WOLFE (weak): th(51.70643256076521)=3.1968209743499756; dx=-1.2289544309396781E-6 evalInputDelta=9.518861770629883E-5
    New Minimum: 3.1968209743499756 > 3.196440249681473
    WOLFE (weak): th(258.53216280382605)=3.196440249681473; dx=-1.228574196140555E-6 evalInputDelta=4.7591328620910645E-4
    New Minimum: 3.196440249681473 > 3.194062188267708
    WOLFE (weak): th(1551.1929768229563)=3.194062188267708; dx=-1.227567801806925E-6 evalInputDelta=0.00285397469997406
    New Minimum: 3.194062188267708 > 3.176998719573021
    WOLFE (weak): th(10858.350837760694)=3.176998719573021; dx=-1.2212277862745251E-6 evalInputDelta=0.01991744339466095
    New Minimum: 3.176998719573021 > 3.04089118540287
    WOLFE (weak): th(86866.80670208555)=3.04089118540287; dx=-1.1713036142827012E-6 evalInputDelta=0.1560249775648117
    New Minimum: 3.04089118540287 > 2.0982947647571564
    END: th(781801.26031877)=2.0982947647571564; dx=-6.512269688342362E-7 evalInputDelta=1.0986213982105255
    Fitness changed from 3.196916162967682 to 2.0982947647571564
    Iteration 1 complete. Error: 2.0982947647571564 Total: 36.6734; Orientation: 0.0179; Line Search: 27.1576
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/fe8a9c3d-2e18-443d-ab81-216f59619548.jpg)
    
    Adding measureme

...skipping 5865 bytes...

    Orientation: 0.2123; Line Search: 5.3040
    Adding measurement 447c2291 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.877e+03, gradient 1.908e-04, dot -0.772; [f0afa2fc-6e63-48d1-846f-dc77bfb24b90 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.3365761935710907, 1.3735527694225311, 2.0982947647571564, 3.196916162967682
    LBFGS Accumulation History: 3 points
    Removed measurement 447c2291 to history. Total: 3
    th(0)=0.3365761935710907;dx=-3.58557598435093E-8
    New Minimum: 0.3365761935710907 > 0.22643554210662842
    END: th(5040000.000000001)=0.22643554210662842; dx=-2.1361860011576645E-8 evalInputDelta=0.11014065146446228
    Fitness changed from 0.3365761935710907 to 0.22643554210662842
    Iteration 9 complete. Error: 0.22643554210662842 Total: 10.0070; Orientation: 0.3932; Line Search: 7.0742
    Adding measurement 3ecfda69 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.884e+03, gradient 2.155e-04, dot -0.599; [f0afa2fc-6e63-48d1-846f-dc77bfb24b90 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.22643554210662842, 1.3735527694225311, 2.0982947647571564, 3.196916162967682
    LBFGS Accumulation History: 3 points
    Removed measurement 3ecfda69 to history. Total: 3
    th(0)=0.22643554210662842;dx=-4.491891977498481E-8
    Armijo: th(1.0858350837760696E7)=0.6460923850536346; dx=6.237842322093635E-8 evalInputDelta=-0.4196568429470062
    Armijo: th(5429175.418880348)=0.244646355509758; dx=2.2711544544798667E-8 evalInputDelta=-0.018210813403129578
    New Minimum: 0.22643554210662842 > 0.17512375116348267
    END: th(1809725.1396267826)=0.17512375116348267; dx=-1.8769579445339977E-8 evalInputDelta=0.05131179094314575
    Fitness changed from 0.22643554210662842 to 0.17512375116348267
    Iteration 10 complete. Error: 0.17512375116348267 Total: 14.9515; Orientation: 0.2703; Line Search: 11.7576
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/b3a4aed6-262f-4e75-a682-9364324c99d7.jpg)
    
    Final threshold in iteration 11: 0.17512375116348267 (> -Infinity) after 136.828s (< 3600.000s)
    

Returns:

    0.17512375116348267