Code from BasicOptimizer.scala:88 executed in 726.92 seconds (8.242 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: 19469930141225
Reset training subject: 19484690235469
Adding measurement 7c52f457 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=0.8803514763712883;dx=-5.967491256592832E-8
New Minimum: 0.8803514763712883 > 0.8803512379527092
WOLFE (weak): th(2.154434690031884)=0.8803512379527092; dx=-5.967490298943675E-8 evalInputDelta=2.384185791015625E-7
New Minimum: 0.8803512379527092 > 0.8803511932492256
WOLFE (weak): th(4.308869380063768)=0.8803511932492256; dx=-5.967492599597017E-8 evalInputDelta=2.8312206268310547E-7
New Minimum: 0.8803511932492256 > 0.8803505674004555
WOLFE (weak): th(12.926608140191302)=0.8803505674004555; dx=-5.967492303963022E-8 evalInputDelta=9.08970832824707E-7
New Minimum: 0.8803505674004555 > 0.8803477585315704
WOLFE (weak): th(51.70643256076521)=0.8803477585315704; dx=-5.967428674610692E-8 evalInputDelta=3.7178397178649902E-6
New Minimum: 0.8803477585315704 > 0.880332849919796
WOLFE (weak): th(258.53216280382605)=0.880332849919796; dx=-5.96733736631942E-8 evalInputDelta=1.862645149230957E-5
New Minimum: 0.880332849919796 > 0.8802399858832359
WOLFE (weak): th(1551.1929768229563)=0.8802399858832359; dx=-5.966630206566869E-8 evalInputDelta=1.1149048805236816E-4
New Minimum: 0.8802399858832359 > 0.879571795463562
WOLFE (weak): th(10858.350837760694)=0.879571795463562; dx=-5.959726851450219E-8 evalInputDelta=7.796809077262878E-4
New Minimum: 0.879571795463562 > 0.8741413429379463
WOLFE (weak): th(86866.80670208555)=0.8741413429379463; dx=-5.907991063741752E-8 evalInputDelta=0.00621013343334198
New Minimum: 0.8741413429379463 > 0.8269023448228836
WOLFE (weak): th(781801.26031877)=0.8269023448228836; dx=-5.407697240489286E-8 evalInputDelta=0.053449131548404694
New Minimum: 0.8269023448228836 > 0.6086680293083191
END: th(7818012.6031877)=0.6086680293083191; dx=-4.365906102149252E-9 evalInputDelta=0.2716834470629692
Fitness changed from 0.8803514763712883 to 0.6086680293083191
Iteration 1 complete. Error: 0.608668029308
...skipping 6401 bytes...
Popping history element from -0.3468029499053955, 0.38659535348415375, 0.6086680293083191, 0.8803514763712883
LBFGS Accumulation History: 3 points
Removed measurement 2f4dea9f to history. Total: 3
th(0)=-0.3468029499053955;dx=-2.008377066871478E-8
Armijo: th(5.0400000000000015E7)=-0.21617287397384644; dx=1.004874662555668E-8 evalInputDelta=-0.13063007593154907
New Minimum: -0.3468029499053955 > -0.3724304735660553
END: th(2.5200000000000007E7)=-0.3724304735660553; dx=-7.662726081550584E-10 evalInputDelta=0.02562752366065979
Fitness changed from -0.3468029499053955 to -0.3724304735660553
Iteration 9 complete. Error: -0.3724304735660553 Total: 58.2799; Orientation: 1.5612; Line Search: 42.6340
Adding measurement e29a346 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.676e+04, gradient 1.740e-04, dot -0.375; [9db58910-72c8-4cb9-a3d5-52748479d7fe = 1.000/1.000e+00]
Orientation rejected. Popping history element from -0.3724304735660553, 0.38659535348415375, 0.6086680293083191, 0.8803514763712883
LBFGS Accumulation History: 3 points
Removed measurement e29a346 to history. Total: 3
th(0)=-0.3724304735660553;dx=-3.027165852228673E-8
Armijo: th(5.429175418880349E7)=1.4679145514965057; dx=4.050150371436961E-8 evalInputDelta=-1.840345025062561
Armijo: th(2.7145877094401743E7)=0.09260967373847961; dx=3.592325219553994E-8 evalInputDelta=-0.4650401473045349
New Minimum: -0.3724304735660553 > -0.49780571460723877
WOLF (strong): th(9048625.698133914)=-0.49780571460723877; dx=5.5748789331091975E-9 evalInputDelta=0.12537524104118347
END: th(2262156.4245334785)=-0.44386938214302063; dx=-2.1075563154720004E-8 evalInputDelta=0.07143890857696533
Fitness changed from -0.3724304735660553 to -0.49780571460723877
Iteration 10 complete. Error: -0.49780571460723877 Total: 83.8823; Orientation: 1.7645; Line Search: 68.3496
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/4cc3bf0e-871b-47d0-b0fe-98c4a933fb0b.jpg)
Final threshold in iteration 11: -0.49780571460723877 (> -Infinity) after 726.921s (< 3600.000s)
-0.49780571460723877