Iteration 1 Iteration 1

Iteration 2 Iteration 2

Iteration 3 Iteration 3

Iteration 4 Iteration 4

Iteration 5 Iteration 5

Iteration 10 Iteration 10

Iteration 15 Iteration 15

BasicOptimizer.scala:89 executed in 7.72 seconds (0.246 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: 154054935704400
Reset training subject: 154055070507200
Adding measurement 3e9abf93 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-61.22691888134765;dx=-0.13866848410832744
New Minimum: -61.22691888134765 > -61.713828917735285
WOLFE (weak): th(2.154434690031884)=-61.713828917735285; dx=-0.13943722151626986 evalInputDelta=0.4869100363876342
New Minimum: -61.713828917735285 > -62.20656899847877
WOLFE (weak): th(4.308869380063768)=-62.20656899847877; dx=-0.13769064131094855 evalInputDelta=0.979650117131122
New Minimum: -62.20656899847877 > -64.23436929883215
WOLFE (weak): th(12.926608140191302)=-64.23436929883215; dx=-0.14609547975432188 evalInputDelta=3.007450417484499
New Minimum: -64.23436929883215 > -74.40123618134648
WOLFE (weak): th(51.70643256076521)=-74.40123618134648; dx=-0.1515484583530765 evalInputDelta=13.174317299998826
New Minimum: -74.40123618134648 > -116.66201767150909
END: th(258.53216280382605)=-116.66201767150909; dx=-0.07173606508291921 evalInputDelta=55.43509879016144
Fitness changed from -61.22691888134765 to -116.66201767150909
Iteration 1 complete. Error: -116.66201767150909 Total: 1.0488; Orientation: 0.0016; Line Search: 0.6893
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/8ab20552-c677-42ee-8869-378046c197ad.jpg)
Adding measurement be57741 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-116.66201767150909;dx=-0.19408069389985938
New Minimum: -116.66201767150909 > -172.48123199532463
END: th(556.9906600335335)=-172.48123199532463; dx=-0.019180224957547932 evalInputDelta=55.819214323815544
Fitness changed from -116.66201767150909 to -172.48123199532463
Iteration 2 complete. Error: -172.48123199532463 Total: 0.3558; Orientation: 0.0015; Line Search: 0.2280
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/36555951-3cb6-462c-af5c-c111a54a300f.jpg)
Adding measurement 64d4632d to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-172.48123199532463;dx=-0.2358925637424829
New Minimum: -172.48123199532463 > -291.05951388848297
END: th(1200.0)=-291.05951388848297; dx=-0.005870633023724325 evalInputDelta=118.57828189315833
Fitness changed from -172.48123199532463 to -291.05951388848297
Iteration 3 complete. Error: -291.05951388848297 Total: 0.3479; Orientation: 0.0014; Line Search: 0.2267
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>![Iteration 3](etc/6da1f205-e354-45d4-9e75-e70d6317b3bd.jpg)
Adding measurement 9e62b46 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.130e+03, gradient 4.395e-01, dot -0.278; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -291.05951388848297, -172.48123199532463, -116.66201767150909, -61.22691888134765
LBFGS Accumulation History: 3 points
Removed measurement 9e62b46 to history. Total: 3
th(0)=-291.05951388848297;dx=-0.18676978508444586
New Minimum: -291.05951388848297 > -542.8047243254244
WOLF (strong): th(2585.3216280382608)=-542.8047243254244; dx=0.0076816491182308145 evalInputDelta=251.74521043694148
New Minimum: -542.8047243254244 > -583.102880073491
END: th(1292.6608140191304)=-583.102880073491; dx=-0.027251975252138037 evalInputDelta=292.043366185008
Fitness changed from -291.05951388848297 to -583.102880073491
Iteration 4 complete. Error: -583.102880073491 Total: 0.7696; Orientation: 0.0275; Line Search: 0.6233
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>![Iteration 4](etc/3fb0cdfc-7ac5-402b-b4a1-48919f09f64e.jpg)
Adding measurement 6144dc45 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.966e+03, gradient 5.014e-01, dot -0.270; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -583.102880073491, -172.48123199532463, -116.66201767150909, -61.22691888134765
LBFGS Accumulation History: 3 points
Removed measurement 6144dc45 to history. Total: 3
th(0)=-583.102880073491;dx=-0.24715660979988624
New Minimum: -583.102880073491 > -721.6607149485137
WOLF (strong): th(2784.9533001676677)=-721.6607149485137; dx=0.029017991161340254 evalInputDelta=138.55783487502276
New Minimum: -721.6607149485137 > -814.3138599459056
END: th(1392.4766500838339)=-814.3138599459056; dx=-0.012673792710732469 evalInputDelta=231.21097987241467
Fitness changed from -583.102880073491 to -814.3138599459056
Iteration 5 complete. Error: -814.3138599459056 Total: 0.4920; Orientation: 0.0288; Line Search: 0.3407
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>![Iteration 5](etc/bf80b1c2-9208-45d8-90bc-fa3760fe4d93.jpg)
Adding measurement 312689ac to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.131e+03, gradient 5.745e-01, dot -0.303; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -814.3138599459056, -172.48123199532463, -116.66201767150909, -61.22691888134765
LBFGS Accumulation History: 3 points
Removed measurement 312689ac to history. Total: 3
th(0)=-814.3138599459056;dx=-0.3245740537815188
Armijo: th(3000.0000000000005)=-741.9966307201132; dx=0.026659050369238067 evalInputDelta=-72.3172292257924
New Minimum: -814.3138599459056 > -956.1610416138068
WOLF (strong): th(1500.0000000000002)=-956.1610416138068; dx=0.030702929692604713 evalInputDelta=141.84718166790117
New Minimum: -956.1610416138068 > -977.4691171592073
END: th(500.00000000000006)=-977.4691171592073; dx=-0.13707939789185952 evalInputDelta=163.15525721330164
Fitness changed from -814.3138599459056 to -977.4691171592073
Iteration 6 complete. Error: -977.4691171592073 Total: 0.6039; Orientation: 0.0291; Line Search: 0.4508
Adding measurement 2a007f71 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.352e+04, gradient 4.438e-01, dot -0.475; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -977.4691171592073, -172.48123199532463, -116.66201767150909, -61.22691888134765
LBFGS Accumulation History: 3 points
Removed measurement 2a007f71 to history. Total: 3
th(0)=-977.4691171592073;dx=-0.19655689465048762
New Minimum: -977.4691171592073 > -1145.543048078072
END: th(1077.217345015942)=-1145.543048078072; dx=-0.08675871081508696 evalInputDelta=168.07393091886468
Fitness changed from -977.4691171592073 to -1145.543048078072
Iteration 7 complete. Error: -1145.543048078072 Total: 0.3720; Orientation: 0.0277; Line Search: 0.2314
Adding measurement 44612f55 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 4.016e+07, gradient 4.443e-01, dot -0.500; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1145.543048078072, -172.48123199532463, -116.66201767150909, -61.22691888134765
LBFGS Accumulation History: 3 points
Removed measurement 44612f55 to history. Total: 3
th(0)=-1145.543048078072;dx=-0.19234540435502484
New Minimum: -1145.543048078072 > -1315.6733542182876
END: th(2320.79441680639)=-1315.6733542182876; dx=-0.04176036349692271 evalInputDelta=170.13030614021568
Fitness changed from -1145.543048078072 to -1315.6733542182876
Iteration 8 complete. Error: -1315.6733542182876 Total: 0.3672; Orientation: 0.0279; Line Search: 0.2296
Adding measurement 2fef71be to history. Total: 3
Accepted: LBFGS Orientation magnitude: 6.277e+03, gradient 5.779e-01, dot 0.490; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Constructing line search parameters: LBFGS+Trust
th(0)=-1315.6733542182876;dx=-1790.4491874506086
New Minimum: -1315.6733542182876 > -1396.223119705443
WOLF (strong): th(5000.000000000002)=-1396.223119705443; dx=0.1754198952222944 evalInputDelta=80.54976548715536
WOLF (strong): th(2500.000000000001)=-1395.7452310504234; dx=0.35535147603820505 evalInputDelta=80.07187683213579
WOLF (strong): th(833.3333333333336)=-1394.6728110922647; dx=1.0660234585425514 evalInputDelta=78.99945687397712
WOLF (strong): th(208.3333333333334)=-1392.5294431357636; dx=4.342509126649977 evalInputDelta=76.85608891747597
New Minimum: -1396.223119705443 > -1413.915308637685
WOLF (strong): th(41.66666666666668)=-1413.915308637685; dx=22.366506294549836 evalInputDelta=98.24195441939742
New Minimum: -1413.915308637685 > -1739.5096291771426
WOLF (strong): th(6.944444444444446)=-1739.5096291771426; dx=113.66220233625359 evalInputDelta=423.83627495885503
New Minimum: -1739.5096291771426 > -2167.225876552788
END: th(0.9920634920634923)=-2167.225876552788; dx=-288.45015205518774 evalInputDelta=851.5525223345005
Fitness changed from -1315.6733542182876 to -2167.225876552788
Iteration 9 complete. Error: -2167.225876552788 Total: 1.0633; Orientation: 0.0263; Line Search: 0.9245
Adding measurement 251cd3da to history. Total: 4
Accepted: LBFGS Orientation magnitude: 3.077e+03, gradient 5.819e-01, dot 0.225; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
th(0)=-2167.225876552788;dx=-408.74619140263593
New Minimum: -2167.225876552788 > -2363.102727348094
END: th(2.137336002015758)=-2363.102727348094; dx=-2.3408710570824702 evalInputDelta=195.87685079530593
Fitness changed from -2167.225876552788 to -2363.102727348094
Iteration 10 complete. Error: -2363.102727348094 Total: 0.3776; Orientation: 0.0359; Line Search: 0.2301
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/da079c42-c112-4634-919b-dc3a84f71ab8.jpg)
Adding measurement 14f05b13 to history. Total: 5
Rejected: LBFGS Orientation magnitude: 4.966e+05, gradient 5.483e-01, dot -0.181; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2363.102727348094, -2167.225876552788, -1315.6733542182876, -172.48123199532463, -116.66201767150909, -61.22691888134765
Rejected: LBFGS Orientation magnitude: 4.669e+05, gradient 5.483e-01, dot -0.253; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2363.102727348094, -2167.225876552788, -1315.6733542182876, -172.48123199532463, -116.66201767150909
Rejected: LBFGS Orientation magnitude: 3.361e+05, gradient 5.483e-01, dot -0.273; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2363.102727348094, -2167.225876552788, -1315.6733542182876, -172.48123199532463
LBFGS Accumulation History: 3 points
Removed measurement 14f05b13 to history. Total: 5
Removed measurement 251cd3da to history. Total: 4
Removed measurement 2fef71be to history. Total: 3
th(0)=-2363.102727348094;dx=-0.29737262719885454
New Minimum: -2363.102727348094 > -2364.4739372638473
END: th(4.604750826996805)=-2364.4739372638473; dx=-0.19867979247346168 evalInputDelta=1.3712099157532975
Fitness changed from -2363.102727348094 to -2364.4739372638473
Iteration 11 complete. Error: -2364.4739372638473 Total: 0.4568; Orientation: 0.1022; Line Search: 0.2319
Adding measurement 141f4d5b to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.548e+03, gradient 5.522e-01, dot -0.112; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2364.4739372638473, -172.48123199532463, -116.66201767150909, -61.22691888134765
LBFGS Accumulation History: 3 points
Removed measurement 141f4d5b to history. Total: 3
th(0)=-2364.4739372638473;dx=-0.29386646140714623
New Minimum: -2364.4739372638473 > -2367.4263452111873
END: th(9.920634920634923)=-2367.4263452111873; dx=-0.19799468497097153 evalInputDelta=2.952407947339907
Fitness changed from -2364.4739372638473 to -2367.4263452111873
Iteration 12 complete. Error: -2367.4263452111873 Total: 0.3619; Orientation: 0.0270; Line Search: 0.2247
Adding measurement 6372bae6 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 7.746e+03, gradient 5.473e-01, dot -0.123; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2367.4263452111873, -172.48123199532463, -116.66201767150909, -61.22691888134765
LBFGS Accumulation History: 3 points
Removed measurement 6372bae6 to history. Total: 3
th(0)=-2367.4263452111873;dx=-0.296183836290249
New Minimum: -2367.4263452111873 > -2373.7789492705506
END: th(21.37336002015758)=-2373.7789492705506; dx=-0.1978974078407874 evalInputDelta=6.35260405936333
Fitness changed from -2367.4263452111873 to -2373.7789492705506
Iteration 13 complete. Error: -2373.7789492705506 Total: 0.3626; Orientation: 0.0289; Line Search: 0.2255
Adding measurement 5072c1fb to history. Total: 3
Rejected: LBFGS Orientation magnitude: 7.744e+03, gradient 5.444e-01, dot -0.124; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2373.7789492705506, -172.48123199532463, -116.66201767150909, -61.22691888134765
LBFGS Accumulation History: 3 points
Removed measurement 5072c1fb to history. Total: 3
th(0)=-2373.7789492705506;dx=-0.2947741475182241
New Minimum: -2373.7789492705506 > -2387.228099700571
END: th(46.047508269968056)=-2387.228099700571; dx=-0.19576189084412643 evalInputDelta=13.449150430020381
Fitness changed from -2373.7789492705506 to -2387.228099700571
Iteration 14 complete. Error: -2387.228099700571 Total: 0.3647; Orientation: 0.0265; Line Search: 0.2280
Adding measurement 7ed37820 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 7.997e+03, gradient 5.457e-01, dot -0.126; [8ee9e761-0908-486c-9bcf-907ce26a8c54 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2387.228099700571, -172.48123199532463, -116.66201767150909, -61.22691888134765
LBFGS Accumulation History: 3 points
Removed measurement 7ed37820 to history. Total: 3
th(0)=-2387.228099700571;dx=-0.2939477312398752
New Minimum: -2387.228099700571 > -2415.8014198191045
END: th(99.20634920634923)=-2415.8014198191045; dx=-0.19519770384409468 evalInputDelta=28.573320118533502
Fitness changed from -2387.228099700571 to -2415.8014198191045
Iteration 15 complete. Error: -2415.8014198191045 Total: 0.3680; Orientation: 0.0278; Line Search: 0.2310
<a id="p-15"></a>Iteration 15
<a id="p-14"></a>![Iteration 15](etc/63ad4dbe-ac05-4fc6-a25a-f38074be690a.jpg)
Final threshold in iteration 16: -2415.8014198191045 (> -Infinity) after 7.724s (< 5400.000s)

Returns

    -2415.8014198191045