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 435.93 seconds (4.494 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: 2283729737855
    Reset training subject: 2292693382547
    Adding measurement 357a385d to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=8.192497469484806;dx=-7.89631236002202E-8
    New Minimum: 8.192497469484806 > 8.192497320473194
    WOLFE (weak): th(2.154434690031884)=8.192497320473194; dx=-7.894964838343479E-8 evalInputDelta=1.4901161193847656E-7
    New Minimum: 8.192497320473194 > 8.19249726086855
    WOLFE (weak): th(4.308869380063768)=8.19249726086855; dx=-7.894245887388015E-8 evalInputDelta=2.086162567138672E-7
    New Minimum: 8.19249726086855 > 8.192496210336685
    WOLFE (weak): th(12.926608140191302)=8.192496210336685; dx=-7.895264142329159E-8 evalInputDelta=1.259148120880127E-6
    New Minimum: 8.192496210336685 > 8.192491322755814
    WOLFE (weak): th(51.70643256076521)=8.192491322755814; dx=-7.894173831972129E-8 evalInputDelta=6.146728992462158E-6
    New Minimum: 8.192491322755814 > 8.192467376589775
    WOLFE (weak): th(258.53216280382605)=8.192467376589775; dx=-7.894438968209404E-8 evalInputDelta=3.0092895030975342E-5
    New Minimum: 8.192467376589775 > 8.192315131425858
    WOLFE (weak): th(1551.1929768229563)=8.192315131425858; dx=-7.895325942410942E-8 evalInputDelta=1.8233805894851685E-4
    New Minimum: 8.192315131425858 > 8.191219337284565
    WOLFE (weak): th(10858.350837760694)=8.191219337284565; dx=-7.89478004564919E-8 evalInputDelta=0.0012781322002410889
    New Minimum: 8.191219337284565 > 8.18226470798254
    WOLFE (weak): th(86866.80670208555)=8.18226470798254; dx=-7.889276104477821E-8 evalInputDelta=0.01023276150226593
    New Minimum: 8.18226470798254 > 8.099823124706745
    WOLFE (weak): th(781801.26031877)=8.099823124706745; dx=-7.866789376725046E-8 evalInputDelta=0.09267434477806091
    New Minimum: 8.099823124706745 > 7.272027976810932
    END: th(7818012.6031877)=7.272027976810932; dx=-6.73384130382946E-8 evalInputDelta=0.9204694926738739
    Fitness changed from 8.192497469484806 to 7.272027976810932
    Iteration 1 complete. Error: 7.272027976810932 Total: 126.4158; Orientation: 0.

...skipping 5882 bytes...

    ine Search: 19.1402
    Adding measurement c2bae32 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 2.635e+03, gradient 4.527e-05, dot -0.278; [dfdf4b8e-022b-4c11-b3f1-4ac6c96e1d3d = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.18449179828166962, 5.487583644688129, 7.272027976810932, 8.192497469484806
    LBFGS Accumulation History: 3 points
    Removed measurement c2bae32 to history. Total: 3
    th(0)=-0.18449179828166962;dx=-2.045929752686556E-9
    New Minimum: -0.18449179828166962 > -0.27513954043388367
    END: th(1.5120000000000006E8)=-0.27513954043388367; dx=-4.4512598601026995E-10 evalInputDelta=0.09064774215221405
    Fitness changed from -0.18449179828166962 to -0.27513954043388367
    Iteration 9 complete. Error: -0.27513954043388367 Total: 28.6411; Orientation: 0.9529; Line Search: 18.8748
    Adding measurement c387fcf to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.110e+03, gradient 5.260e-05, dot -0.489; [dfdf4b8e-022b-4c11-b3f1-4ac6c96e1d3d = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.27513954043388367, 5.487583644688129, 7.272027976810932, 8.192497469484806
    LBFGS Accumulation History: 3 points
    Removed measurement c387fcf to history. Total: 3
    th(0)=-0.27513954043388367;dx=-2.7634705332902286E-9
    Armijo: th(3.2575052513282096E8)=1.040330708026886; dx=4.959240039214044E-9 evalInputDelta=-1.3154702484607697
    Armijo: th(1.6287526256641048E8)=-0.13556167483329773; dx=1.7986252812327922E-9 evalInputDelta=-0.13957786560058594
    New Minimum: -0.27513954043388367 > -0.3776446580886841
    END: th(5.4291754188803494E7)=-0.3776446580886841; dx=-8.102421131120384E-10 evalInputDelta=0.10250511765480042
    Fitness changed from -0.27513954043388367 to -0.3776446580886841
    Iteration 10 complete. Error: -0.3776446580886841 Total: 46.7336; Orientation: 0.9605; Line Search: 37.2118
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/68bc0b23-bdee-461c-b998-8f94d946ef6a.jpg)
    
    Final threshold in iteration 11: -0.3776446580886841 (> -Infinity) after 435.928s (< 3600.000s)
    

Returns:

    -0.3776446580886841