Code from BasicOptimizer.scala:88 executed in 555.85 seconds (3.897 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
Reset training subject: 1428686870005
Reset training subject: 1441449208786
Adding measurement 9c4f8fc to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=6.676379308104515;dx=-7.595543143952047E-8
New Minimum: 6.676379308104515 > 6.676379233598709
WOLFE (weak): th(2.154434690031884)=6.676379233598709; dx=-7.570721774410914E-8 evalInputDelta=7.450580596923828E-8
New Minimum: 6.676379233598709 > 6.676378518342972
WOLFE (weak): th(4.308869380063768)=6.676378518342972; dx=-7.573787512174547E-8 evalInputDelta=7.897615432739258E-7
New Minimum: 6.676378518342972 > 6.676377445459366
WOLFE (weak): th(12.926608140191302)=6.676377445459366; dx=-7.573067318711655E-8 evalInputDelta=1.862645149230957E-6
New Minimum: 6.676377445459366 > 6.676371365785599
WOLFE (weak): th(51.70643256076521)=6.676371365785599; dx=-7.572983062564132E-8 evalInputDelta=7.9423189163208E-6
New Minimum: 6.676371365785599 > 6.676341146230698
WOLFE (weak): th(258.53216280382605)=6.676341146230698; dx=-7.575046373211837E-8 evalInputDelta=3.816187381744385E-5
New Minimum: 6.676341146230698 > 6.676150217652321
WOLFE (weak): th(1551.1929768229563)=6.676150217652321; dx=-7.571498724800065E-8 evalInputDelta=2.2909045219421387E-4
New Minimum: 6.676150217652321 > 6.674776241183281
WOLFE (weak): th(10858.350837760694)=6.674776241183281; dx=-7.565834262865311E-8 evalInputDelta=0.0016030669212341309
New Minimum: 6.674776241183281 > 6.663567140698433
WOLFE (weak): th(86866.80670208555)=6.663567140698433; dx=-7.535190770475077E-8 evalInputDelta=0.012812167406082153
New Minimum: 6.663567140698433 > 6.563030153512955
WOLFE (weak): th(781801.26031877)=6.563030153512955; dx=-7.171714136299052E-8 evalInputDelta=0.11334915459156036
New Minimum: 6.563030153512955 > 5.784668922424316
END: th(7818012.6031877)=5.784668922424316; dx=-4.556684100468837E-8 evalInputDelta=0.8917103856801987
Fitness changed from 6.676379308104515 to 5.784668922424316
Iteration 1 complete. Error: 5.784668922424316 Total: 163.1478; Orientatio
...skipping 5988 bytes...
.5305; Line Search: 35.8795
Adding measurement 6fe0e87a to history. Total: 3
Rejected: LBFGS Orientation magnitude: 7.925e+03, gradient 6.092e-05, dot -0.316; [e294f346-a003-4bcf-98e5-a37ad1a176ac = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.2100535295903683, 4.662241026759148, 5.784668922424316, 6.676379308104515
LBFGS Accumulation History: 3 points
Removed measurement 6fe0e87a to history. Total: 3
th(0)=-1.2100535295903683;dx=-3.692976362131909E-9
Armijo: th(2.268000000000001E8)=-1.050615333020687; dx=-1.258761767116818E-10 evalInputDelta=-0.15943819656968117
New Minimum: -1.2100535295903683 > -1.4637909084558487
END: th(1.1340000000000004E8)=-1.4637909084558487; dx=-1.1539654859630805E-9 evalInputDelta=0.2537373788654804
Fitness changed from -1.2100535295903683 to -1.4637909084558487
Iteration 9 complete. Error: -1.4637909084558487 Total: 46.5750; Orientation: 0.5536; Line Search: 33.7068
Adding measurement 137641af to history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.026e+03, gradient 5.677e-05, dot -0.304; [e294f346-a003-4bcf-98e5-a37ad1a176ac = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.4637909084558487, 4.662241026759148, 5.784668922424316, 6.676379308104515
LBFGS Accumulation History: 3 points
Removed measurement 137641af to history. Total: 3
th(0)=-1.4637909084558487;dx=-3.2032045152720004E-9
Armijo: th(2.4431289384961572E8)=-1.1686586029827595; dx=1.3675419677262344E-11 evalInputDelta=-0.2951323054730892
New Minimum: -1.4637909084558487 > -1.6710468530654907
END: th(1.2215644692480786E8)=-1.6710468530654907; dx=-7.909901449346222E-10 evalInputDelta=0.20725594460964203
Fitness changed from -1.4637909084558487 to -1.6710468530654907
Iteration 10 complete. Error: -1.6710468530654907 Total: 48.2811; Orientation: 0.5588; Line Search: 35.2915
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/f48fe781-c920-4d02-b7b8-514feace6773.jpg)
Final threshold in iteration 11: -1.6710468530654907 (> -Infinity) after 555.852s (< 1800.000s)
-1.6710468530654907