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 186.44 seconds (2.426 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: 1094435056088
    Reset training subject: 1098501434184
    Adding measurement 48322434 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=11.914519742131233;dx=-2.9964703618914855E-7
    New Minimum: 11.914519742131233 > 11.914517655968666
    WOLFE (weak): th(2.154434690031884)=11.914517655968666; dx=-2.98772527727436E-7 evalInputDelta=2.086162567138672E-6
    New Minimum: 11.914517655968666 > 11.914516299962997
    WOLFE (weak): th(4.308869380063768)=11.914516299962997; dx=-2.9853387673763826E-7 evalInputDelta=3.4421682357788086E-6
    New Minimum: 11.914516299962997 > 11.91451109945774
    WOLFE (weak): th(12.926608140191302)=11.91451109945774; dx=-2.9880266307895213E-7 evalInputDelta=8.64267349243164E-6
    New Minimum: 11.91451109945774 > 11.91448512673378
    WOLFE (weak): th(51.70643256076521)=11.91448512673378; dx=-2.9862519131212105E-7 evalInputDelta=3.4615397453308105E-5
    New Minimum: 11.91448512673378 > 11.914349913597107
    WOLFE (weak): th(258.53216280382605)=11.914349913597107; dx=-2.987938945113953E-7 evalInputDelta=1.6982853412628174E-4
    New Minimum: 11.914349913597107 > 11.913502141833305
    WOLFE (weak): th(1551.1929768229563)=11.913502141833305; dx=-2.9863127319289733E-7 evalInputDelta=0.0010176002979278564
    New Minimum: 11.913502141833305 > 11.9074005484581
    WOLFE (weak): th(10858.350837760694)=11.9074005484581; dx=-2.987465842920465E-7 evalInputDelta=0.00711919367313385
    New Minimum: 11.9074005484581 > 11.857645317912102
    WOLFE (weak): th(86866.80670208555)=11.857645317912102; dx=-2.9773128719475814E-7 evalInputDelta=0.05687442421913147
    New Minimum: 11.857645317912102 > 11.414442002773285
    WOLFE (weak): th(781801.26031877)=11.414442002773285; dx=-2.791185492331173E-7 evalInputDelta=0.5000777393579483
    New Minimum: 11.414442002773285 > 9.045816868543625
    END: th(7818012.6031877)=9.045816868543625; dx=-7.65837719429425E-8 evalInputDelta=2.8687028735876083
    Fitness changed from 11.914519742131233 to 9.045816868543625
    Iteration 1 complete. Error: 9.045816868543625 Tota

...skipping 6065 bytes...

    g measurement 3b23ac59 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 9.394e+03, gradient 1.642e-04, dot -0.467; [d3544386-4e20-4926-a54e-ba9d87a2a736 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.3178596645593643, 7.036794900894165, 9.045816868543625, 11.914519742131233
    LBFGS Accumulation History: 3 points
    Removed measurement 3b23ac59 to history. Total: 3
    th(0)=1.3178596645593643;dx=-2.689466077449005E-8
    Armijo: th(5.0400000000000015E7)=1.7385974675416946; dx=9.424295482883609E-9 evalInputDelta=-0.4207378029823303
    New Minimum: 1.3178596645593643 > 1.1330154240131378
    WOLF (strong): th(2.5200000000000007E7)=1.1330154240131378; dx=6.177461629823869E-9 evalInputDelta=0.1848442405462265
    New Minimum: 1.1330154240131378 > 1.0628144592046738
    END: th(8400000.000000002)=1.0628144592046738; dx=-1.1971769957034256E-8 evalInputDelta=0.25504520535469055
    Fitness changed from 1.3178596645593643 to 1.0628144592046738
    Iteration 9 complete. Error: 1.0628144592046738 Total: 19.3324; Orientation: 0.3816; Line Search: 15.1105
    Adding measurement eb5b7e2 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 9.340e+03, gradient 1.234e-04, dot -0.562; [d3544386-4e20-4926-a54e-ba9d87a2a736 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.0628144592046738, 7.036794900894165, 9.045816868543625, 11.914519742131233
    LBFGS Accumulation History: 3 points
    Removed measurement eb5b7e2 to history. Total: 3
    th(0)=1.0628144592046738;dx=-1.5173998636081354E-8
    New Minimum: 1.0628144592046738 > 0.8491173535585403
    END: th(1.8097251396267828E7)=0.8491173535585403; dx=-3.740637137158158E-9 evalInputDelta=0.21369710564613342
    Fitness changed from 1.0628144592046738 to 0.8491173535585403
    Iteration 10 complete. Error: 0.8491173535585403 Total: 11.4550; Orientation: 0.3195; Line Search: 7.3062
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/3d7376e9-f35d-4a0e-af2a-7d58b21391f7.jpg)
    
    Final threshold in iteration 11: 0.8491173535585403 (> -Infinity) after 186.442s (< 3600.000s)
    

Returns:

    0.8491173535585403