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 129.61 seconds (4.408 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: 2804985474864
    Reset training subject: 2807535079186
    Adding measurement 3179c9b to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=2.360206753015518;dx=-2.1484364060305366E-7
    New Minimum: 2.360206753015518 > 2.360206112265587
    WOLFE (weak): th(2.154434690031884)=2.360206112265587; dx=-2.155621265286847E-7 evalInputDelta=6.407499313354492E-7
    New Minimum: 2.360206112265587 > 2.3602053970098495
    WOLFE (weak): th(4.308869380063768)=2.3602053970098495; dx=-2.1552454999993129E-7 evalInputDelta=1.3560056686401367E-6
    New Minimum: 2.3602053970098495 > 2.360203042626381
    WOLFE (weak): th(12.926608140191302)=2.360203042626381; dx=-2.1557065389684474E-7 evalInputDelta=3.7103891372680664E-6
    New Minimum: 2.360203042626381 > 2.3601924777030945
    WOLFE (weak): th(51.70643256076521)=2.3601924777030945; dx=-2.155281791940679E-7 evalInputDelta=1.4275312423706055E-5
    New Minimum: 2.3601924777030945 > 2.360135331749916
    WOLFE (weak): th(258.53216280382605)=2.360135331749916; dx=-2.1535883609409314E-7 evalInputDelta=7.142126560211182E-5
    New Minimum: 2.360135331749916 > 2.3597793728113174
    WOLFE (weak): th(1551.1929768229563)=2.3597793728113174; dx=-2.154962099650003E-7 evalInputDelta=4.2738020420074463E-4
    New Minimum: 2.3597793728113174 > 2.3572166711091995
    WOLFE (weak): th(10858.350837760694)=2.3572166711091995; dx=-2.1526173646414717E-7 evalInputDelta=0.0029900819063186646
    New Minimum: 2.3572166711091995 > 2.3364306837320328
    WOLFE (weak): th(86866.80670208555)=2.3364306837320328; dx=-2.131251206664886E-7 evalInputDelta=0.023776069283485413
    New Minimum: 2.3364306837320328 > 2.155570760369301
    WOLFE (weak): th(781801.26031877)=2.155570760369301; dx=-1.948024372788588E-7 evalInputDelta=0.20463599264621735
    New Minimum: 2.155570760369301 > 1.1854348182678223
    END: th(7818012.6031877)=1.1854348182678223; dx=-5.2594927889215905E-8 evalInputDelta=1.174771934747696
    Fitness changed from 2.360206753015518 to 1.1854348182678223
    Iteration 1 complete. Error: 1.185434818267822

...skipping 6366 bytes...

    760515)=-0.8768442720174789; dx=-3.0323457127862075E-8 evalInputDelta=0.14147785305976868
    Fitness changed from -0.7353664189577103 to -0.9279019236564636
    Iteration 8 complete. Error: -0.9279019236564636 Total: 12.6878; Orientation: 0.2854; Line Search: 9.8946
    Adding measurement 7e399e17 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.104e+04, gradient 1.732e-04, dot -0.584; [8577441a-d757-48c5-8916-f93dc7301f23 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.9279019236564636, 0.6354872137308121, 1.1854348182678223, 2.360206753015518
    LBFGS Accumulation History: 3 points
    Removed measurement 7e399e17 to history. Total: 3
    th(0)=-0.9279019236564636;dx=-2.992774601907266E-8
    New Minimum: -0.9279019236564636 > -1.0698364228010178
    END: th(6300000.000000002)=-1.0698364228010178; dx=-8.647534163164902E-9 evalInputDelta=0.14193449914455414
    Fitness changed from -0.9279019236564636 to -1.0698364228010178
    Iteration 9 complete. Error: -1.0698364228010178 Total: 7.5775; Orientation: 0.2179; Line Search: 4.9077
    Adding measurement 3b83fc19 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.073e+04, gradient 1.202e-04, dot -0.747; [8577441a-d757-48c5-8916-f93dc7301f23 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -1.0698364228010178, 0.6354872137308121, 1.1854348182678223, 2.360206753015518
    LBFGS Accumulation History: 3 points
    Removed measurement 3b83fc19 to history. Total: 3
    th(0)=-1.0698364228010178;dx=-1.4367727605354819E-8
    New Minimum: -1.0698364228010178 > -1.2089169174432755
    END: th(1.3572938547200872E7)=-1.2089169174432755; dx=-6.3862142669122764E-9 evalInputDelta=0.1390804946422577
    Fitness changed from -1.0698364228010178 to -1.2089169174432755
    Iteration 10 complete. Error: -1.2089169174432755 Total: 10.1019; Orientation: 0.2792; Line Search: 5.0220
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/57801d31-9731-46a5-892c-96f93412c0cb.jpg)
    
    Final threshold in iteration 11: -1.2089169174432755 (> -Infinity) after 129.608s (< 3600.000s)
    

Returns:

    -1.2089169174432755