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.51 seconds (7.231 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: 1884098936921
    Reset training subject: 1934967081175
    Adding measurement 41cf32a3 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=5.94308602809906;dx=-2.863660511795209E-7
    New Minimum: 5.94308602809906 > 5.943085670471191
    WOLFE (weak): th(2.154434690031884)=5.943085670471191; dx=-2.855991303339446E-7 evalInputDelta=3.5762786865234375E-7
    New Minimum: 5.943085670471191 > 5.943085469305515
    WOLFE (weak): th(4.308869380063768)=5.943085469305515; dx=-2.8631688346706186E-7 evalInputDelta=5.587935447692871E-7
    New Minimum: 5.943085469305515 > 5.943083673715591
    WOLFE (weak): th(12.926608140191302)=5.943083673715591; dx=-2.855479421623231E-7 evalInputDelta=2.3543834686279297E-6
    New Minimum: 5.943083673715591 > 5.943076767027378
    WOLFE (weak): th(51.70643256076521)=5.943076767027378; dx=-2.888154766033773E-7 evalInputDelta=9.261071681976318E-6
    New Minimum: 5.943076767027378 > 5.943040557205677
    WOLFE (weak): th(258.53216280382605)=5.943040557205677; dx=-2.8719913567928963E-7 evalInputDelta=4.547089338302612E-5
    New Minimum: 5.943040557205677 > 5.942814752459526
    WOLFE (weak): th(1551.1929768229563)=5.942814752459526; dx=-2.8678029102469596E-7 evalInputDelta=2.712756395339966E-4
    New Minimum: 5.942814752459526 > 5.941193759441376
    WOLFE (weak): th(10858.350837760694)=5.941193759441376; dx=-2.8513205288644993E-7 evalInputDelta=0.0018922686576843262
    New Minimum: 5.941193759441376 > 5.928084820508957
    WOLFE (weak): th(86866.80670208555)=5.928084820508957; dx=-2.793698861017459E-7 evalInputDelta=0.01500120759010315
    New Minimum: 5.928084820508957 > 5.815882220864296
    END: th(781801.26031877)=5.815882220864296; dx=-2.2966853768462495E-7 evalInputDelta=0.1272038072347641
    Fitness changed from 5.94308602809906 to 5.815882220864296
    Iteration 1 complete. Error: 5.815882220864296 Total: 658.5693; Orientation: 0.0386; Line Search: 505.7001
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/f8a62fc3-a72f-4f4b-b5fc-09ed061d38f7.jpg)
    
    Adding measurement 7

...skipping 4329 bytes...

    : 0.8298802375793457 Total: 155.2290; Orientation: 0.9786; Line Search: 103.6236
    Adding measurement 54b7d0a0 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 5.177e+03, gradient 1.376e-04, dot -0.271; [7e0e2c16-3592-41fc-a6ed-e5816b476349 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.8298802375793457, 5.577948153018951, 5.815882220864296, 5.94308602809906
    LBFGS Accumulation History: 3 points
    Removed measurement 54b7d0a0 to history. Total: 3
    th(0)=0.8298802375793457;dx=-1.8306472122252686E-8
    New Minimum: 0.8298802375793457 > 0.6051032692193985
    WOLF (strong): th(1.6843397559414053E8)=0.6051032692193985; dx=6.656661230131033E-10 evalInputDelta=0.2247769683599472
    New Minimum: 0.6051032692193985 > -0.03870213031768799
    END: th(8.421698779707026E7)=-0.03870213031768799; dx=-3.2605186251911852E-9 evalInputDelta=0.8685823678970337
    Fitness changed from 0.8298802375793457 to -0.03870213031768799
    Iteration 8 complete. Error: -0.03870213031768799 Total: 202.0396; Orientation: 0.9875; Line Search: 150.9589
    Adding measurement 48996f87 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 6.637e+03, gradient 1.145e-04, dot -0.281; [7e0e2c16-3592-41fc-a6ed-e5816b476349 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.03870213031768799, 5.577948153018951, 5.815882220864296, 5.94308602809906
    LBFGS Accumulation History: 3 points
    Removed measurement 48996f87 to history. Total: 3
    th(0)=-0.03870213031768799;dx=-1.30098213714071E-8
    Armijo: th(1.8144000000000003E8)=0.4756905883550644; dx=4.696953957695448E-10 evalInputDelta=-0.5143927186727524
    New Minimum: -0.03870213031768799 > -0.4523431658744812
    END: th(9.072000000000001E7)=-0.4523431658744812; dx=-2.0427620532752075E-9 evalInputDelta=0.4136410355567932
    Fitness changed from -0.03870213031768799 to -0.4523431658744812
    Iteration 9 complete. Error: -0.4523431658744812 Total: 201.8917; Orientation: 0.9759; Line Search: 149.9294
    Final threshold in iteration 9: -0.4523431658744812 (> -Infinity) after 1984.512s (< 1800.000s)
    

Returns:

    -0.4523431658744812