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 148.45 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: 2231733950189
    Reset training subject: 2235321842427
    Adding measurement 527339ed to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=18.242615673691034;dx=-7.439183173421845E-6
    New Minimum: 18.242615673691034 > 18.24260140582919
    WOLFE (weak): th(2.154434690031884)=18.24260140582919; dx=-7.439082863078561E-6 evalInputDelta=1.4267861843109131E-5
    New Minimum: 18.24260140582919 > 18.242587611079216
    WOLFE (weak): th(4.308869380063768)=18.242587611079216; dx=-7.439044163676603E-6 evalInputDelta=2.80626118183136E-5
    New Minimum: 18.242587611079216 > 18.24253300577402
    WOLFE (weak): th(12.926608140191302)=18.24253300577402; dx=-7.438867481058472E-6 evalInputDelta=8.266791701316833E-5
    New Minimum: 18.24253300577402 > 18.242284962907434
    WOLFE (weak): th(51.70643256076521)=18.242284962907434; dx=-7.438287605630554E-6 evalInputDelta=3.307107836008072E-4
    New Minimum: 18.242284962907434 > 18.24096269160509
    WOLFE (weak): th(258.53216280382605)=18.24096269160509; dx=-7.434878606665273E-6 evalInputDelta=0.001652982085943222
    New Minimum: 18.24096269160509 > 18.232709892094135
    WOLFE (weak): th(1551.1929768229563)=18.232709892094135; dx=-7.414079354069982E-6 evalInputDelta=0.009905781596899033
    New Minimum: 18.232709892094135 > 18.17380210570991
    WOLFE (weak): th(10858.350837760694)=18.17380210570991; dx=-7.270086346814088E-6 evalInputDelta=0.06881356798112392
    New Minimum: 18.17380210570991 > 17.72794572263956
    END: th(86866.80670208555)=17.72794572263956; dx=-6.199359983543526E-6 evalInputDelta=0.5146699510514736
    Fitness changed from 18.242615673691034 to 17.72794572263956
    Iteration 1 complete. Error: 17.72794572263956 Total: 41.1095; Orientation: 0.0120; Line Search: 30.9345
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/1a81ca34-2445-42d8-8151-5b305fa26685.jpg)
    
    Adding measurement 1e7a37f5 to history. Total: 1
    LBFGS Accumulation History: 2 points
    th(0)=17.72794572263956;dx=-5.893355006388657E-6
    New Minimum: 17.72794572263956 > 16.935932002

...skipping 5080 bytes...

    2420754432678 Total: 14.0932; Orientation: 0.3722; Line Search: 10.5444
    Adding measurement 2eac903b to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.933e+03, gradient 5.098e-04, dot -0.245; [eda3d3bd-28c7-4e6e-9c39-d61afc0ea7c7 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 6.032420754432678, 16.935932002961636, 17.72794572263956, 18.242615673691034
    LBFGS Accumulation History: 3 points
    Removed measurement 2eac903b to history. Total: 3
    th(0)=6.032420754432678;dx=-2.5994007691109484E-7
    Armijo: th(2.0160000000000007E7)=6.662888839840889; dx=2.73768475049563E-8 evalInputDelta=-0.6304680854082108
    New Minimum: 6.032420754432678 > 5.35275661945343
    END: th(1.0080000000000004E7)=5.35275661945343; dx=-4.927498607760594E-8 evalInputDelta=0.679664134979248
    Fitness changed from 6.032420754432678 to 5.35275661945343
    Iteration 9 complete. Error: 5.35275661945343 Total: 14.3025; Orientation: 0.3034; Line Search: 10.5395
    Adding measurement 62cda37e to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.993e+03, gradient 4.152e-04, dot -0.262; [eda3d3bd-28c7-4e6e-9c39-d61afc0ea7c7 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 5.35275661945343, 16.935932002961636, 17.72794572263956, 18.242615673691034
    LBFGS Accumulation History: 3 points
    Removed measurement 62cda37e to history. Total: 3
    th(0)=5.35275661945343;dx=-1.724272607189724E-7
    Armijo: th(2.1716701675521396E7)=6.385441035032272; dx=7.390892218583067E-9 evalInputDelta=-1.0326844155788422
    New Minimum: 5.35275661945343 > 5.1731080412864685
    END: th(1.0858350837760698E7)=5.1731080412864685; dx=-4.428111489893026E-8 evalInputDelta=0.17964857816696167
    Fitness changed from 5.35275661945343 to 5.1731080412864685
    Iteration 10 complete. Error: 5.1731080412864685 Total: 14.2415; Orientation: 0.3381; Line Search: 10.7745
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/04c64f4b-5349-4535-af30-cffd1eada4eb.jpg)
    
    Final threshold in iteration 11: 5.1731080412864685 (> -Infinity) after 148.450s (< 3600.000s)
    

Returns:

    5.1731080412864685