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 64.64 seconds (2.573 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: 1597256428906
    Reset training subject: 1598596363437
    Adding measurement f080cb1 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=6.53397810459137;dx=-2.0468215404265017E-6
    New Minimum: 6.53397810459137 > 6.533972427248955
    WOLFE (weak): th(2.154434690031884)=6.533972427248955; dx=-2.050557641818916E-6 evalInputDelta=5.677342414855957E-6
    New Minimum: 6.533972427248955 > 6.533966466784477
    WOLFE (weak): th(4.308869380063768)=6.533966466784477; dx=-2.0456739333607987E-6 evalInputDelta=1.163780689239502E-5
    New Minimum: 6.533966466784477 > 6.533943921327591
    WOLFE (weak): th(12.926608140191302)=6.533943921327591; dx=-2.049131882133637E-6 evalInputDelta=3.4183263778686523E-5
    New Minimum: 6.533943921327591 > 6.533842325210571
    WOLFE (weak): th(51.70643256076521)=6.533842325210571; dx=-2.0481538260239483E-6 evalInputDelta=1.3577938079833984E-4
    New Minimum: 6.533842325210571 > 6.533300951123238
    WOLFE (weak): th(258.53216280382605)=6.533300951123238; dx=-2.047737237150704E-6 evalInputDelta=6.77153468132019E-4
    New Minimum: 6.533300951123238 > 6.529915601015091
    WOLFE (weak): th(1551.1929768229563)=6.529915601015091; dx=-2.0501092704592588E-6 evalInputDelta=0.0040625035762786865
    New Minimum: 6.529915601015091 > 6.505580306053162
    WOLFE (weak): th(10858.350837760694)=6.505580306053162; dx=-2.0401735356197984E-6 evalInputDelta=0.028397798538208008
    New Minimum: 6.505580306053162 > 6.31039959192276
    WOLFE (weak): th(86866.80670208555)=6.31039959192276; dx=-1.9793043384293522E-6 evalInputDelta=0.22357851266860962
    New Minimum: 6.31039959192276 > 4.836970999836922
    END: th(781801.26031877)=4.836970999836922; dx=-1.4049109678031752E-6 evalInputDelta=1.697007104754448
    Fitness changed from 6.53397810459137 to 4.836970999836922
    Iteration 1 complete. Error: 4.836970999836922 Total: 18.4686; Orientation: 0.0028; Line Search: 14.4703
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/332dc0ff-fa1b-4c8a-91c8-8b780033fd51.jpg)
    
    Adding measurement 65ac39d

...skipping 5728 bytes...

    istory. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.501e+03, gradient 3.284e-04, dot -0.529; [d36f8e84-42ff-43d3-8ee1-948c15ef24f5 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.17698650062084198, 3.1984373033046722, 4.836970999836922, 6.53397810459137
    LBFGS Accumulation History: 3 points
    Removed measurement 6027e4bc to history. Total: 3
    th(0)=0.17698650062084198;dx=-1.0715165911793244E-7
    Armijo: th(1.0080000000000002E7)=0.5519759505987167; dx=7.699124976380752E-8 evalInputDelta=-0.37498944997787476
    New Minimum: 0.17698650062084198 > 0.09463399648666382
    WOLF (strong): th(5040000.000000001)=0.09463399648666382; dx=3.232812135978571E-8 evalInputDelta=0.08235250413417816
    New Minimum: 0.09463399648666382 > 0.053661882877349854
    END: th(1680000.0000000002)=0.053661882877349854; dx=-4.609583292066844E-8 evalInputDelta=0.12332461774349213
    Fitness changed from 0.17698650062084198 to 0.053661882877349854
    Iteration 9 complete. Error: 0.053661882877349854 Total: 8.2860; Orientation: 0.1091; Line Search: 6.8773
    Adding measurement 6a9822d5 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 4.718e+03, gradient 2.301e-04, dot -0.682; [d36f8e84-42ff-43d3-8ee1-948c15ef24f5 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.053661882877349854, 3.1984373033046722, 4.836970999836922, 6.53397810459137
    LBFGS Accumulation History: 3 points
    Removed measurement 6a9822d5 to history. Total: 3
    th(0)=0.053661882877349854;dx=-5.260923331213366E-8
    New Minimum: 0.053661882877349854 > -0.08699868619441986
    END: th(3619450.2792535652)=-0.08699868619441986; dx=-4.1569665824612525E-8 evalInputDelta=0.14066056907176971
    Fitness changed from 0.053661882877349854 to -0.08699868619441986
    Iteration 10 complete. Error: -0.08699868619441986 Total: 4.0844; Orientation: 0.1644; Line Search: 2.6595
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/2d4cf9a1-a958-497b-9d8a-6fd3dfb5f3bc.jpg)
    
    Final threshold in iteration 11: -0.08699868619441986 (> -Infinity) after 64.641s (< 3600.000s)
    

Returns:

    -0.08699868619441986