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 530.38 seconds (8.957 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: 611541844427700
    Reset training subject: 611553388292400
    Adding measurement dd921af to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=1.5508390069007874;dx=-2.233119924993673E-7
    New Minimum: 1.5508390069007874 > 1.55083829164505
    WOLFE (weak): th(2.154434690031884)=1.55083829164505; dx=-2.23296531023148E-7 evalInputDelta=7.152557373046875E-7
    New Minimum: 1.55083829164505 > 1.5508375614881516
    WOLFE (weak): th(4.308869380063768)=1.5508375614881516; dx=-2.233081742752241E-7 evalInputDelta=1.4454126358032227E-6
    New Minimum: 1.5508375614881516 > 1.5508346557617188
    WOLFE (weak): th(12.926608140191302)=1.5508346557617188; dx=-2.2328150910937638E-7 evalInputDelta=4.351139068603516E-6
    New Minimum: 1.5508346557617188 > 1.550821989774704
    WOLFE (weak): th(51.70643256076521)=1.550821989774704; dx=-2.2330129209792095E-7 evalInputDelta=1.7017126083374023E-5
    New Minimum: 1.550821989774704 > 1.5507542043924332
    WOLFE (weak): th(258.53216280382605)=1.5507542043924332; dx=-2.2329686721192903E-7 evalInputDelta=8.480250835418701E-5
    New Minimum: 1.5507542043924332 > 1.550331324338913
    WOLFE (weak): th(1551.1929768229563)=1.550331324338913; dx=-2.2316823544674986E-7 evalInputDelta=5.076825618743896E-4
    New Minimum: 1.550331324338913 > 1.5472902208566666
    WOLFE (weak): th(10858.350837760694)=1.5472902208566666; dx=-2.2265712245205767E-7 evalInputDelta=0.0035487860441207886
    New Minimum: 1.5472902208566666 > 1.522677019238472
    WOLFE (weak): th(86866.80670208555)=1.522677019238472; dx=-2.1911023053233604E-7 evalInputDelta=0.02816198766231537
    New Minimum: 1.522677019238472 > 1.3193600177764893
    END: th(781801.26031877)=1.3193600177764893; dx=-1.789199000984686E-7 evalInputDelta=0.2314789891242981
    Fitness changed from 1.5508390069007874 to 1.3193600177764893
    Iteration 1 complete. Error: 1.3193600177764893 Total: 147.3975; Orientation: 0.0269; Line Search: 113.6473
    <a id="p-3"></a>Iteration 1
    <a id="p-2"></a>![Iteration 1](etc/f5c87066-b660-4

...skipping 5904 bytes...

    
    Adding measurement 23a670b to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.868e+03, gradient 1.699e-04, dot -0.559; [e08a0104-623f-4aee-9496-45592b040764 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.7025070339441299, 0.9985288083553314, 1.3193600177764893, 1.5508390069007874
    LBFGS Accumulation History: 3 points
    Removed measurement 23a670b to history. Total: 3
    th(0)=-0.7025070339441299;dx=-2.8838026042092632E-8
    Armijo: th(1.5120000000000004E7)=-0.6708163619041443; dx=1.3441291126021685E-8 evalInputDelta=-0.03169067203998566
    New Minimum: -0.7025070339441299 > -0.8038264214992523
    WOLF (strong): th(7560000.000000002)=-0.8038264214992523; dx=1.7397377366860358E-9 evalInputDelta=0.10131938755512238
    END: th(2520000.0000000005)=-0.7780409455299377; dx=-1.7243871425111656E-8 evalInputDelta=0.0755339115858078
    Fitness changed from -0.7025070339441299 to -0.8038264214992523
    Iteration 9 complete. Error: -0.8038264214992523 Total: 57.1281; Orientation: 0.3877; Line Search: 45.7928
    Adding measurement 177110d4 to history. Total: 3
    Rejected: LBFGS Orientation magnitude: 3.924e+03, gradient 1.777e-04, dot -0.502; [e08a0104-623f-4aee-9496-45592b040764 = 1.000/1.000e+00]
    Orientation rejected. Popping history element from -0.8038264214992523, 0.9985288083553314, 1.3193600177764893, 1.5508390069007874
    LBFGS Accumulation History: 3 points
    Removed measurement 177110d4 to history. Total: 3
    th(0)=-0.8038264214992523;dx=-3.155208739347984E-8
    New Minimum: -0.8038264214992523 > -0.9160263538360596
    END: th(5429175.418880348)=-0.9160263538360596; dx=-2.7963052501898268E-9 evalInputDelta=0.11219993233680725
    Fitness changed from -0.8038264214992523 to -0.9160263538360596
    Iteration 10 complete. Error: -0.9160263538360596 Total: 34.5852; Orientation: 0.3842; Line Search: 22.4035
    <a id="p-13"></a>Iteration 10
    <a id="p-12"></a>![Iteration 10](etc/3aa5bd76-680f-493f-8fb4-29f3ac15577d.jpg)
    
    Final threshold in iteration 11: -0.9160263538360596 (> -Infinity) after 530.373s (< 3600.000s)
    

Returns:

    -0.9160263538360596