Code from BasicOptimizer.scala:88 executed in 264.23 seconds (7.719 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: 607406544030200
Reset training subject: 607411896007900
Adding measurement 4456892e to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=25.549412068910897;dx=-1.19336064333095E-5
New Minimum: 25.549412068910897 > 25.54937168210745
WOLFE (weak): th(2.154434690031884)=25.54937168210745; dx=-1.1910239295585916E-5 evalInputDelta=4.0386803448200226E-5
New Minimum: 25.54937168210745 > 25.549331535585225
WOLFE (weak): th(4.308869380063768)=25.549331535585225; dx=-1.1929583360151906E-5 evalInputDelta=8.053332567214966E-5
New Minimum: 25.549331535585225 > 25.549170210957527
WOLFE (weak): th(12.926608140191302)=25.549170210957527; dx=-1.1928662469329205E-5 evalInputDelta=2.4185795336961746E-4
New Minimum: 25.549170210957527 > 25.54844489507377
WOLFE (weak): th(51.70643256076521)=25.54844489507377; dx=-1.1937843372503988E-5 evalInputDelta=9.671738371253014E-4
New Minimum: 25.54844489507377 > 25.54457171726972
WOLFE (weak): th(258.53216280382605)=25.54457171726972; dx=-1.1959621304573468E-5 evalInputDelta=0.004840351641178131
New Minimum: 25.54457171726972 > 25.5200686249882
WOLFE (weak): th(1551.1929768229563)=25.5200686249882; dx=-1.2167819809483154E-5 evalInputDelta=0.029343443922698498
New Minimum: 25.5200686249882 > 25.333165537565947
WOLFE (weak): th(10858.350837760694)=25.333165537565947; dx=-1.3236243587194208E-5 evalInputDelta=0.2162465313449502
New Minimum: 25.333165537565947 > 23.811342660337687
WOLFE (weak): th(86866.80670208555)=23.811342660337687; dx=-1.0910225116386567E-5 evalInputDelta=1.7380694085732102
New Minimum: 23.811342660337687 > 17.375894606113434
END: th(781801.26031877)=17.375894606113434; dx=-4.461737561646099E-6 evalInputDelta=8.173517462797463
Fitness changed from 25.549412068910897 to 17.375894606113434
Iteration 1 complete. Error: 17.375894606113434 Total: 72.6154; Orientation: 0.0149; Line Search: 56.5720
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/abb30fd2-0b1d-4b24-
...skipping 6035 bytes...
Orientation: 0.1580; Line Search: 10.7703
Adding measurement 1e8e4a8e to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.908e+03, gradient 7.474e-04, dot -0.433; [9274035a-5e08-4ab2-8aa0-b1d4633e2371 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 3.278079628944397, 10.328728914260864, 17.375894606113434, 25.549412068910897
LBFGS Accumulation History: 3 points
Removed measurement 1e8e4a8e to history. Total: 3
th(0)=3.278079628944397;dx=-5.561126839265124E-7
Armijo: th(7560000.000000002)=5.243655182421207; dx=2.614100423590643E-7 evalInputDelta=-1.9655755534768105
Armijo: th(3780000.000000001)=3.5160472691059113; dx=2.417281090844323E-7 evalInputDelta=-0.23796764016151428
New Minimum: 3.278079628944397 > 2.8470976650714874
END: th(1260000.0000000002)=2.8470976650714874; dx=-5.799538015421382E-8 evalInputDelta=0.43098196387290955
Fitness changed from 3.278079628944397 to 2.8470976650714874
Iteration 9 complete. Error: 2.8470976650714874 Total: 28.4718; Orientation: 0.1575; Line Search: 22.8984
Adding measurement 2244584 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.625e+03, gradient 4.833e-04, dot -0.541; [9274035a-5e08-4ab2-8aa0-b1d4633e2371 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 2.8470976650714874, 10.328728914260864, 17.375894606113434, 25.549412068910897
LBFGS Accumulation History: 3 points
Removed measurement 2244584 to history. Total: 3
th(0)=2.8470976650714874;dx=-2.3295253800994033E-7
New Minimum: 2.8470976650714874 > 2.561213403940201
END: th(2714587.709440174)=2.561213403940201; dx=-1.4894560795502522E-9 evalInputDelta=0.2858842611312866
Fitness changed from 2.8470976650714874 to 2.561213403940201
Iteration 10 complete. Error: 2.561213403940201 Total: 16.1313; Orientation: 0.1591; Line Search: 10.6593
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/3ef98974-e2a3-4c9f-bdf7-b2924c1cad0e.jpg)
Final threshold in iteration 11: 2.561213403940201 (> -Infinity) after 264.223s (< 3600.000s)
2.561213403940201