Iteration 1 Iteration 1

Iteration 2 Iteration 2

Iteration 3 Iteration 3

Iteration 4 Iteration 4

Iteration 5 Iteration 5

Code from BasicOptimizer.scala:88 executed in 1984.66 seconds (4.852 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: 1980512606789
    Reset training subject: 2032776139065
    Adding measurement 4bf411c8 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=5.272973872721195;dx=-1.5875415321939495E-7
    New Minimum: 5.272973872721195 > 5.272973723709583
    WOLFE (weak): th(2.154434690031884)=5.272973723709583; dx=-1.5530836874463597E-7 evalInputDelta=1.4901161193847656E-7
    New Minimum: 5.272973723709583 > 5.272973611950874
    WOLFE (weak): th(4.308869380063768)=5.272973611950874; dx=-1.5723580983951102E-7 evalInputDelta=2.60770320892334E-7
    New Minimum: 5.272973611950874 > 5.2729718536138535
    WOLFE (weak): th(12.926608140191302)=5.2729718536138535; dx=-1.596365405071133E-7 evalInputDelta=2.0191073417663574E-6
    New Minimum: 5.2729718536138535 > 5.272966109216213
    WOLFE (weak): th(51.70643256076521)=5.272966109216213; dx=-1.57107424675271E-7 evalInputDelta=7.763504981994629E-6
    New Minimum: 5.272966109216213 > 5.2729316130280495
    WOLFE (weak): th(258.53216280382605)=5.2729316130280495; dx=-1.5697080428670621E-7 evalInputDelta=4.225969314575195E-5
    New Minimum: 5.2729316130280495 > 5.272718831896782
    WOLFE (weak): th(1551.1929768229563)=5.272718831896782; dx=-1.6077479004643185E-7 evalInputDelta=2.5504082441329956E-4
    New Minimum: 5.272718831896782 > 5.2711880430579185
    WOLFE (weak): th(10858.350837760694)=5.2711880430579185; dx=-1.5665117140832343E-7 evalInputDelta=0.0017858296632766724
    New Minimum: 5.2711880430579185 > 5.258725702762604
    WOLFE (weak): th(86866.80670208555)=5.258725702762604; dx=-1.5294803845920177E-7 evalInputDelta=0.014248169958591461
    New Minimum: 5.258725702762604 > 5.150884084403515
    END: th(781801.26031877)=5.150884084403515; dx=-1.2761821425602696E-7 evalInputDelta=0.12208978831768036
    Fitness changed from 5.272973872721195 to 5.150884084403515
    Iteration 1 complete. Error: 5.150884084403515 Total: 658.0014; Orientation: 0.0385; Line Search: 504.6812
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/14ebdbe8-7781-42bd-b982-8014d6fe9a8c.jpg)
    
    Addi

...skipping 4273 bytes...

    changed from 2.446548491716385 to 2.2820076942443848
    Iteration 7 complete. Error: 2.2820076942443848 Total: 150.8908; Orientation: 1.0396; Line Search: 98.9232
    Adding measurement 56126f7e to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 5.656e+03, gradient 1.803e-04, dot -0.175; [e6719c8d-cd72-442b-8256-2f8acbaf5c92 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 2.2820076942443848, 4.939379543066025, 5.150884084403515, 5.272973872721195
    LBFGS Accumulation History: 3 points
    Removed measurement 56126f7e to history. Total: 3
    th(0)=2.2820076942443848;dx=-3.223191222215713E-8
    Armijo: th(1.6843397559414053E8)=4.500357404351234; dx=4.538725847602005E-9 evalInputDelta=-2.2183497101068497
    New Minimum: 2.2820076942443848 > 1.9281914085149765
    END: th(8.421698779707026E7)=1.9281914085149765; dx=-1.8806041505093567E-9 evalInputDelta=0.35381628572940826
    Fitness changed from 2.2820076942443848 to 1.9281914085149765
    Iteration 8 complete. Error: 1.9281914085149765 Total: 204.6005; Orientation: 1.0057; Line Search: 152.5686
    Adding measurement 1444e72c to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 7.670e+03, gradient 1.611e-04, dot -0.166; [e6719c8d-cd72-442b-8256-2f8acbaf5c92 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 1.9281914085149765, 4.939379543066025, 5.150884084403515, 5.272973872721195
    LBFGS Accumulation History: 3 points
    Removed measurement 1444e72c to history. Total: 3
    th(0)=1.9281914085149765;dx=-2.5851245021356665E-8
    Armijo: th(1.8144000000000003E8)=4.546323679387569; dx=3.5671921778850416E-9 evalInputDelta=-2.618132270872593
    New Minimum: 1.9281914085149765 > 1.8279681950807571
    END: th(9.072000000000001E7)=1.8279681950807571; dx=-1.4372877005169732E-9 evalInputDelta=0.10022321343421936
    Fitness changed from 1.9281914085149765 to 1.8279681950807571
    Iteration 9 complete. Error: 1.8279681950807571 Total: 204.2976; Orientation: 1.1004; Line Search: 152.2004
    Final threshold in iteration 9: 1.8279681950807571 (> -Infinity) after 1984.657s (< 1800.000s)
    

Returns:

    1.8279681950807571