Code from BasicOptimizer.scala:88 executed in 391.08 seconds (3.452 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: 3625834336845
Reset training subject: 3633519313420
Adding measurement 8401969 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=6.902224153280258;dx=-2.1384158938061273E-7
New Minimum: 6.902224153280258 > 6.902224093675613
WOLFE (weak): th(2.154434690031884)=6.902224093675613; dx=-2.1139463853847656E-7 evalInputDelta=5.9604644775390625E-8
New Minimum: 6.902224093675613 > 6.902223169803619
WOLFE (weak): th(4.308869380063768)=6.902223169803619; dx=-2.1134268197335735E-7 evalInputDelta=9.834766387939453E-7
New Minimum: 6.902223169803619 > 6.902221232652664
WOLFE (weak): th(12.926608140191302)=6.902221232652664; dx=-2.113196286609607E-7 evalInputDelta=2.9206275939941406E-6
New Minimum: 6.902221232652664 > 6.902212545275688
WOLFE (weak): th(51.70643256076521)=6.902212545275688; dx=-2.1132860357970415E-7 evalInputDelta=1.1608004570007324E-5
New Minimum: 6.902212545275688 > 6.9021662175655365
WOLFE (weak): th(258.53216280382605)=6.9021662175655365; dx=-2.1135631692981389E-7 evalInputDelta=5.793571472167969E-5
New Minimum: 6.9021662175655365 > 6.9018755704164505
WOLFE (weak): th(1551.1929768229563)=6.9018755704164505; dx=-2.1133017905759124E-7 evalInputDelta=3.485828638076782E-4
New Minimum: 6.9018755704164505 > 6.899784758687019
WOLFE (weak): th(10858.350837760694)=6.899784758687019; dx=-2.113127604430028E-7 evalInputDelta=0.0024393945932388306
New Minimum: 6.899784758687019 > 6.8827333599328995
WOLFE (weak): th(86866.80670208555)=6.8827333599328995; dx=-2.1065058988002908E-7 evalInputDelta=0.019490793347358704
New Minimum: 6.8827333599328995 > 6.729238465428352
WOLFE (weak): th(781801.26031877)=6.729238465428352; dx=-2.043371370532601E-7 evalInputDelta=0.17298568785190582
New Minimum: 6.729238465428352 > 5.5350150763988495
END: th(7818012.6031877)=5.5350150763988495; dx=-1.3403816163770236E-7 evalInputDelta=1.3672090768814087
Fitness changed from 6.902224153280258 to 5.5350150763988495
Iteration 1 complete. Error: 5.5350150763988495 To
...skipping 5900 bytes...
history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.728e+03, gradient 1.146e-04, dot -0.252; [a3462a94-a9ee-4f16-a160-10464f3e6e4a = 1.000/1.000e+00]
Orientation rejected. Popping history element from -0.4716090261936188, 4.071854799985886, 5.5350150763988495, 6.902224153280258
LBFGS Accumulation History: 3 points
Removed measurement 12d2323c to history. Total: 3
th(0)=-0.4716090261936188;dx=-1.311902360665768E-8
Armijo: th(2.268000000000001E8)=0.8208191394805908; dx=3.457372964304389E-9 evalInputDelta=-1.2924281656742096
New Minimum: -0.4716090261936188 > -0.5836888551712036
WOLF (strong): th(1.1340000000000004E8)=-0.5836888551712036; dx=2.0977321631457713E-10 evalInputDelta=0.11207982897758484
New Minimum: -0.5836888551712036 > -0.7938335984945297
END: th(3.7800000000000015E7)=-0.7938335984945297; dx=-7.063645504616468E-9 evalInputDelta=0.32222457230091095
Fitness changed from -0.4716090261936188 to -0.7938335984945297
Iteration 9 complete. Error: -0.7938335984945297 Total: 44.5115; Orientation: 0.8664; Line Search: 35.0881
Adding measurement 6340b779 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.138e+03, gradient 8.744e-05, dot -0.285; [a3462a94-a9ee-4f16-a160-10464f3e6e4a = 1.000/1.000e+00]
Orientation rejected. Popping history element from -0.7938335984945297, 4.071854799985886, 5.5350150763988495, 6.902224153280258
LBFGS Accumulation History: 3 points
Removed measurement 6340b779 to history. Total: 3
th(0)=-0.7938335984945297;dx=-7.630289441622024E-9
New Minimum: -0.7938335984945297 > -0.9981581717729568
END: th(8.143763128320524E7)=-0.9981581717729568; dx=-2.950485770389732E-9 evalInputDelta=0.20432457327842712
Fitness changed from -0.7938335984945297 to -0.9981581717729568
Iteration 10 complete. Error: -0.9981581717729568 Total: 24.6131; Orientation: 1.0504; Line Search: 15.4344
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/f5e969e2-9a38-405b-86d4-367a8967823a.jpg)
Final threshold in iteration 11: -0.9981581717729568 (> -Infinity) after 391.083s (< 3600.000s)
-0.9981581717729568