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 146.01 seconds (6.629 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: 1252997995528
    Reset training subject: 1257563849399
    Adding measurement 3dc52658 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=13.91825594753027;dx=-4.2340648208427755E-6
    New Minimum: 13.91825594753027 > 13.918241828680038
    WOLFE (weak): th(2.154434690031884)=13.918241828680038; dx=-4.234064144087282E-6 evalInputDelta=1.4118850231170654E-5
    New Minimum: 13.918241828680038 > 13.918229000642896
    WOLFE (weak): th(4.308869380063768)=13.918229000642896; dx=-4.237372086786345E-6 evalInputDelta=2.6946887373924255E-5
    New Minimum: 13.918229000642896 > 13.918174611404538
    WOLFE (weak): th(12.926608140191302)=13.918174611404538; dx=-4.219103997559936E-6 evalInputDelta=8.13361257314682E-5
    New Minimum: 13.918174611404538 > 13.917931355535984
    WOLFE (weak): th(51.70643256076521)=13.917931355535984; dx=-4.229711542390629E-6 evalInputDelta=3.245919942855835E-4
    New Minimum: 13.917931355535984 > 13.916632257401943
    WOLFE (weak): th(258.53216280382605)=13.916632257401943; dx=-4.230442041801458E-6 evalInputDelta=0.001623690128326416
    New Minimum: 13.916632257401943 > 13.908498756587505
    WOLFE (weak): th(1551.1929768229563)=13.908498756587505; dx=-4.2469002535134255E-6 evalInputDelta=0.009757190942764282
    New Minimum: 13.908498756587505 > 13.849193714559078
    WOLFE (weak): th(10858.350837760694)=13.849193714559078; dx=-4.332125991700068E-6 evalInputDelta=0.0690622329711914
    New Minimum: 13.849193714559078 > 13.342183984816074
    WOLFE (weak): th(86866.80670208555)=13.342183984816074; dx=-4.457894508985457E-6 evalInputDelta=0.5760719627141953
    New Minimum: 13.342183984816074 > 9.627220898866653
    END: th(781801.26031877)=9.627220898866653; dx=-2.836658418521468E-6 evalInputDelta=4.291035048663616
    Fitness changed from 13.91825594753027 to 9.627220898866653
    Iteration 1 complete. Error: 9.627220898866653 Total: 40.7214; Orientation: 0.0640; Line Search: 30.6861
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/d8ec9c9d-76e5-4ee0-a75d-cee15915ccde.jpg)
    
    Addi

...skipping 5976 bytes...

    23828
    Fitness changed from 1.033744901418686 to 0.8825782537460327
    Iteration 8 complete. Error: 0.8825782537460327 Total: 11.0711; Orientation: 0.3958; Line Search: 7.9285
    Adding measurement 1dfcee82 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.310e+03, gradient 3.270e-04, dot -0.560; [239b9a07-ea2d-4f60-9235-160da7d75086 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.8825782537460327, 4.542985372245312, 9.627220898866653, 13.91825594753027
    LBFGS Accumulation History: 3 points
    Removed measurement 1dfcee82 to history. Total: 3
    th(0)=0.8825782537460327;dx=-1.0625318959103253E-7
    New Minimum: 0.8825782537460327 > 0.7760829329490662
    END: th(1890000.0000000002)=0.7760829329490662; dx=-1.0017353936957318E-8 evalInputDelta=0.10649532079696655
    Fitness changed from 0.8825782537460327 to 0.7760829329490662
    Iteration 9 complete. Error: 0.7760829329490662 Total: 8.5264; Orientation: 0.2136; Line Search: 5.7414
    Adding measurement 2086cedb to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 1.351e+03, gradient 2.998e-04, dot -0.488; [239b9a07-ea2d-4f60-9235-160da7d75086 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.7760829329490662, 4.542985372245312, 9.627220898866653, 13.91825594753027
    LBFGS Accumulation History: 3 points
    Removed measurement 2086cedb to history. Total: 3
    th(0)=0.7760829329490662;dx=-8.935813816933536E-8
    Armijo: th(4071881.564160261)=0.817450076341629; dx=7.54950373726928E-8 evalInputDelta=-0.041367143392562866
    New Minimum: 0.7760829329490662 > 0.6804131418466568
    END: th(2035940.7820801304)=0.6804131418466568; dx=-7.014384895822137E-9 evalInputDelta=0.09566979110240936
    Fitness changed from 0.7760829329490662 to 0.6804131418466568
    Iteration 10 complete. Error: 0.6804131418466568 Total: 11.5153; Orientation: 0.3758; Line Search: 8.4418
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/60464217-9294-4019-ac27-bfa0600dd4ed.jpg)
    
    Final threshold in iteration 11: 0.6804131418466568 (> -Infinity) after 145.990s (< 3600.000s)
    

Returns:

    0.6804131418466568