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 509.95 seconds (7.486 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: 2526930605214
    Reset training subject: 2538395392394
    Adding measurement 2f08e2fd to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=4.448049992322922;dx=-2.0412869606388653E-7
    New Minimum: 4.448049992322922 > 4.448049813508987
    WOLFE (weak): th(2.154434690031884)=4.448049813508987; dx=-2.014848785471314E-7 evalInputDelta=1.7881393432617188E-7
    New Minimum: 4.448049813508987 > 4.44804909825325
    WOLFE (weak): th(4.308869380063768)=4.44804909825325; dx=-2.0152070222520507E-7 evalInputDelta=8.940696716308594E-7
    New Minimum: 4.44804909825325 > 4.448046296834946
    WOLFE (weak): th(12.926608140191302)=4.448046296834946; dx=-2.0155186167551749E-7 evalInputDelta=3.6954879760742188E-6
    New Minimum: 4.448046296834946 > 4.448033899068832
    WOLFE (weak): th(51.70643256076521)=4.448033899068832; dx=-2.0158404516865373E-7 evalInputDelta=1.609325408935547E-5
    New Minimum: 4.448033899068832 > 4.447968751192093
    WOLFE (weak): th(258.53216280382605)=4.447968751192093; dx=-2.012132395471395E-7 evalInputDelta=8.124113082885742E-5
    New Minimum: 4.447968751192093 > 4.447563648223877
    WOLFE (weak): th(1551.1929768229563)=4.447563648223877; dx=-2.01409499814728E-7 evalInputDelta=4.863440990447998E-4
    New Minimum: 4.447563648223877 > 4.444647639989853
    WOLFE (weak): th(10858.350837760694)=4.444647639989853; dx=-2.0117970089927993E-7 evalInputDelta=0.0034023523330688477
    New Minimum: 4.444647639989853 > 4.421059727668762
    WOLFE (weak): th(86866.80670208555)=4.421059727668762; dx=-1.977642061217064E-7 evalInputDelta=0.026990264654159546
    New Minimum: 4.421059727668762 > 4.219590485095978
    END: th(781801.26031877)=4.219590485095978; dx=-1.732984503294311E-7 evalInputDelta=0.22845950722694397
    Fitness changed from 4.448049992322922 to 4.219590485095978
    Iteration 1 complete. Error: 4.219590485095978 Total: 148.7774; Orientation: 0.0383; Line Search: 112.7602
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/fc3bbec7-5bb4-4c99-a514-a61d6bf2465e.jpg)
    
    Adding measurement 

...skipping 5538 bytes...

    otal: 3
    Rejected: LBFGS Orientation magnitude: 5.397e+03, gradient 2.281e-04, dot -0.188; [4b77f768-cdad-4c4c-b9e1-2084a5df26c3 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from 0.020902365446090698, 3.8302405774593353, 4.219590485095978, 4.448049992322922
    LBFGS Accumulation History: 3 points
    Removed measurement 20359772 to history. Total: 3
    th(0)=0.020902365446090698;dx=-5.195130698039049E-8
    Armijo: th(9.072000000000001E7)=0.4202645868062973; dx=2.5430517774095916E-9 evalInputDelta=-0.3993622213602066
    New Minimum: 0.020902365446090698 > -0.26020383834838867
    WOLF (strong): th(4.536000000000001E7)=-0.26020383834838867; dx=3.204766273984449E-10 evalInputDelta=0.28110620379447937
    New Minimum: -0.26020383834838867 > -0.37306614220142365
    END: th(1.5120000000000002E7)=-0.37306614220142365; dx=-7.657279280443414E-9 evalInputDelta=0.39396850764751434
    Fitness changed from 0.020902365446090698 to -0.37306614220142365
    Iteration 9 complete. Error: -0.37306614220142365 Total: 59.5381; Orientation: 0.6420; Line Search: 47.0363
    Adding measurement 12b00b75 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 5.306e+03, gradient 1.172e-04, dot -0.297; [4b77f768-cdad-4c4c-b9e1-2084a5df26c3 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.37306614220142365, 3.8302405774593353, 4.219590485095978, 4.448049992322922
    LBFGS Accumulation History: 3 points
    Removed measurement 12b00b75 to history. Total: 3
    th(0)=-0.37306614220142365;dx=-1.3650496032245313E-8
    New Minimum: -0.37306614220142365 > -0.746174618601799
    END: th(3.2575052513282087E7)=-0.746174618601799; dx=-4.822327986396363E-9 evalInputDelta=0.37310847640037537
    Fitness changed from -0.37306614220142365 to -0.746174618601799
    Iteration 10 complete. Error: -0.746174618601799 Total: 35.2620; Orientation: 0.6338; Line Search: 23.0184
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/78bd7064-5167-4808-af50-f8ba903f7efe.jpg)
    
    Final threshold in iteration 11: -0.746174618601799 (> -Infinity) after 509.949s (< 1800.000s)
    

Returns:

    -0.746174618601799