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 525.27 seconds (9.216 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: 609929844825900
    Reset training subject: 609941065834400
    Adding measurement 60c44e31 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=10.05176293104887;dx=-1.2858662263709449E-6
    New Minimum: 10.05176293104887 > 10.051759026944637
    WOLFE (weak): th(2.154434690031884)=10.051759026944637; dx=-1.2846255195708484E-6 evalInputDelta=3.904104232788086E-6
    New Minimum: 10.051759026944637 > 10.05175532400608
    WOLFE (weak): th(4.308869380063768)=10.05175532400608; dx=-1.2842606346471021E-6 evalInputDelta=7.6070427894592285E-6
    New Minimum: 10.05175532400608 > 10.05173883587122
    WOLFE (weak): th(12.926608140191302)=10.05173883587122; dx=-1.2845235916131092E-6 evalInputDelta=2.409517765045166E-5
    New Minimum: 10.05173883587122 > 10.051668174564838
    WOLFE (weak): th(51.70643256076521)=10.051668174564838; dx=-1.2844913824574029E-6 evalInputDelta=9.475648403167725E-5
    New Minimum: 10.051668174564838 > 10.051287241280079
    WOLFE (weak): th(258.53216280382605)=10.051287241280079; dx=-1.284536071791866E-6 evalInputDelta=4.7568976879119873E-4
    New Minimum: 10.051287241280079 > 10.04890751838684
    WOLFE (weak): th(1551.1929768229563)=10.04890751838684; dx=-1.2843971071585596E-6 evalInputDelta=0.0028554126620292664
    New Minimum: 10.04890751838684 > 10.0317939594388
    WOLFE (weak): th(10858.350837760694)=10.0317939594388; dx=-1.28198549170579E-6 evalInputDelta=0.019968971610069275
    New Minimum: 10.0317939594388 > 9.893335536122322
    WOLFE (weak): th(86866.80670208555)=9.893335536122322; dx=-1.261136438410173E-6 evalInputDelta=0.158427394926548
    New Minimum: 9.893335536122322 > 8.781804844737053
    END: th(781801.26031877)=8.781804844737053; dx=-9.338708863926766E-7 evalInputDelta=1.2699580863118172
    Fitness changed from 10.05176293104887 to 8.781804844737053
    Iteration 1 complete. Error: 8.781804844737053 Total: 147.3001; Orientation: 0.0265; Line Search: 113.5389
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/d52d01cc-3123-4870-b71e-50

...skipping 6025 bytes...

    729492 Total: 56.0011; Orientation: 0.3822; Line Search: 44.6948
    Adding measurement 4216fdf2 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 2.455e+03, gradient 2.499e-04, dot -0.362; [97e2fc88-0338-470d-8cb4-4c4b3791643e = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.3442411422729492, 7.186828598380089, 8.781804844737053, 10.05176293104887
    LBFGS Accumulation History: 3 points
    Removed measurement 4216fdf2 to history. Total: 3
    th(0)=0.3442411422729492;dx=-6.24252066230811E-8
    New Minimum: 0.3442411422729492 > 0.02444799244403839
    END: th(7560000.000000001)=0.02444799244403839; dx=-6.39433069536967E-9 evalInputDelta=0.3197931498289108
    Fitness changed from 0.3442411422729492 to 0.02444799244403839
    Iteration 9 complete. Error: 0.02444799244403839 Total: 33.9013; Orientation: 0.3806; Line Search: 22.5884
    Adding measurement c937e94 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 2.827e+03, gradient 1.950e-04, dot -0.429; [97e2fc88-0338-470d-8cb4-4c4b3791643e = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.02444799244403839, 7.186828598380089, 8.781804844737053, 10.05176293104887
    LBFGS Accumulation History: 3 points
    Removed measurement c937e94 to history. Total: 3
    th(0)=0.02444799244403839;dx=-3.799115259118206E-8
    New Minimum: 0.02444799244403839 > -0.09012013673782349
    WOLF (strong): th(1.6287526256641043E7)=-0.09012013673782349; dx=1.0332979254932873E-8 evalInputDelta=0.11456812918186188
    New Minimum: -0.09012013673782349 > -0.18558192253112793
    END: th(8143763.128320522)=-0.18558192253112793; dx=-5.593708849341036E-9 evalInputDelta=0.21002991497516632
    Fitness changed from 0.02444799244403839 to -0.18558192253112793
    Iteration 10 complete. Error: -0.18558192253112793 Total: 44.7848; Orientation: 0.3847; Line Search: 33.4710
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/a5b2c94a-8b1d-47ec-9a82-74280cd53060.jpg)
    
    Final threshold in iteration 11: -0.18558192253112793 (> -Infinity) after 525.264s (< 3600.000s)
    

Returns:

    -0.18558192253112793