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 63.93 seconds (2.444 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: 1678092643111
    Reset training subject: 1679412376537
    Adding measurement e0515a8 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=5.704251766204834;dx=-1.729320265707092E-6
    New Minimum: 5.704251766204834 > 5.704247251152992
    WOLFE (weak): th(2.154434690031884)=5.704247251152992; dx=-1.7343676703426078E-6 evalInputDelta=4.51505184173584E-6
    New Minimum: 5.704247251152992 > 5.704242214560509
    WOLFE (weak): th(4.308869380063768)=5.704242214560509; dx=-1.7346215516342799E-6 evalInputDelta=9.551644325256348E-6
    New Minimum: 5.704242214560509 > 5.7042232900857925
    WOLFE (weak): th(12.926608140191302)=5.7042232900857925; dx=-1.7333082858794718E-6 evalInputDelta=2.847611904144287E-5
    New Minimum: 5.7042232900857925 > 5.704138368368149
    WOLFE (weak): th(51.70643256076521)=5.704138368368149; dx=-1.7342527310783948E-6 evalInputDelta=1.1339783668518066E-4
    New Minimum: 5.704138368368149 > 5.703684061765671
    WOLFE (weak): th(258.53216280382605)=5.703684061765671; dx=-1.7257150104559454E-6 evalInputDelta=5.67704439163208E-4
    New Minimum: 5.703684061765671 > 5.7008462101221085
    WOLFE (weak): th(1551.1929768229563)=5.7008462101221085; dx=-1.7328627525091406E-6 evalInputDelta=0.003405556082725525
    New Minimum: 5.7008462101221085 > 5.680471450090408
    WOLFE (weak): th(10858.350837760694)=5.680471450090408; dx=-1.7282831554459974E-6 evalInputDelta=0.02378031611442566
    New Minimum: 5.680471450090408 > 5.517194166779518
    WOLFE (weak): th(86866.80670208555)=5.517194166779518; dx=-1.681471879399186E-6 evalInputDelta=0.18705759942531586
    New Minimum: 5.517194166779518 > 4.290366992354393
    END: th(781801.26031877)=4.290366992354393; dx=-1.1741866464165896E-6 evalInputDelta=1.413884773850441
    Fitness changed from 5.704251766204834 to 4.290366992354393
    Iteration 1 complete. Error: 4.290366992354393 Total: 18.0435; Orientation: 0.0532; Line Search: 14.0460
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/944854cc-d2ea-418e-83f8-ed6cf9210521.jpg)
    
    Adding measuremen

...skipping 5790 bytes...

    Error: -0.16967825591564178 Total: 6.8864; Orientation: 0.1201; Line Search: 5.4410
    Adding measurement 70ccbb36 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.855e+03, gradient 2.302e-04, dot -0.626; [537de387-e0bf-4421-a150-999beeee6863 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.16967825591564178, 2.906501889228821, 4.290366992354393, 5.704251766204834
    LBFGS Accumulation History: 3 points
    Removed measurement 70ccbb36 to history. Total: 3
    th(0)=-0.16967825591564178;dx=-5.250867221559802E-8
    New Minimum: -0.16967825591564178 > -0.34489306807518005
    END: th(5040000.000000001)=-0.34489306807518005; dx=-3.09500803644139E-8 evalInputDelta=0.17521481215953827
    Fitness changed from -0.16967825591564178 to -0.34489306807518005
    Iteration 9 complete. Error: -0.34489306807518005 Total: 3.8723; Orientation: 0.0674; Line Search: 2.4972
    Adding measurement 5a96c910 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.960e+03, gradient 2.418e-04, dot -0.563; [537de387-e0bf-4421-a150-999beeee6863 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.34489306807518005, 2.906501889228821, 4.290366992354393, 5.704251766204834
    LBFGS Accumulation History: 3 points
    Removed measurement 5a96c910 to history. Total: 3
    th(0)=-0.34489306807518005;dx=-5.811994266093774E-8
    New Minimum: -0.34489306807518005 > -0.36602596938610077
    WOLF (strong): th(1.0858350837760696E7)=-0.36602596938610077; dx=1.7941659000338145E-8 evalInputDelta=0.021132901310920715
    New Minimum: -0.36602596938610077 > -0.476232185959816
    END: th(5429175.418880348)=-0.476232185959816; dx=-7.610884487665302E-9 evalInputDelta=0.13133911788463593
    Fitness changed from -0.34489306807518005 to -0.476232185959816
    Iteration 10 complete. Error: -0.476232185959816 Total: 5.2064; Orientation: 0.1662; Line Search: 3.8955
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/4e1a7712-9d43-48f4-bb38-f8c5750ed36b.jpg)
    
    Final threshold in iteration 11: -0.476232185959816 (> -Infinity) after 63.929s (< 3600.000s)
    

Returns:

    -0.476232185959816