Code from BasicOptimizer.scala:88 executed in 134.67 seconds (8.478 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: 618825724549
Reset training subject: 620689199100
Adding measurement 650e3c5f to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=17.511767953634262;dx=-6.697777352959606E-6
New Minimum: 17.511767953634262 > 17.511739160865545
WOLFE (weak): th(2.154434690031884)=17.511739160865545; dx=-6.678076414492961E-6 evalInputDelta=2.8792768716812134E-5
New Minimum: 17.511739160865545 > 17.51170913502574
WOLFE (weak): th(4.308869380063768)=17.51170913502574; dx=-6.676541854980689E-6 evalInputDelta=5.881860852241516E-5
New Minimum: 17.51170913502574 > 17.511592160910368
WOLFE (weak): th(12.926608140191302)=17.511592160910368; dx=-6.693424159886344E-6 evalInputDelta=1.7579272389411926E-4
New Minimum: 17.511592160910368 > 17.511066801846027
WOLFE (weak): th(51.70643256076521)=17.511066801846027; dx=-6.694445854646989E-6 evalInputDelta=7.011517882347107E-4
New Minimum: 17.511066801846027 > 17.508259296417236
WOLFE (weak): th(258.53216280382605)=17.508259296417236; dx=-6.694019377126902E-6 evalInputDelta=0.003508657217025757
New Minimum: 17.508259296417236 > 17.490697029978037
WOLFE (weak): th(1551.1929768229563)=17.490697029978037; dx=-6.618143181279289E-6 evalInputDelta=0.021070923656225204
New Minimum: 17.490697029978037 > 17.362196933478117
WOLFE (weak): th(10858.350837760694)=17.362196933478117; dx=-6.686297154258351E-6 evalInputDelta=0.1495710201561451
New Minimum: 17.362196933478117 > 16.278949696570635
END: th(86866.80670208555)=16.278949696570635; dx=-5.7523175074445035E-6 evalInputDelta=1.2328182570636272
Fitness changed from 17.511767953634262 to 16.278949696570635
Iteration 1 complete. Error: 16.278949696570635 Total: 21.2096; Orientation: 0.0279; Line Search: 15.0753
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/eec12b27-501f-40b7-b8b5-01e51de1ff78.jpg)
Adding measurement 4f9deb6b to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=16.278949696570635;dx=-6.224552675471764E-6
New Minimum: 16.278949696570635
...skipping 14464 bytes...
-0.10968048870563507 to -0.23968762159347534
Iteration 18 complete. Error: -0.23968762159347534 Total: 7.3518; Orientation: 0.0380; Line Search: 5.7966
Adding measurement 7239749e to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.534e+03, gradient 3.945e-04, dot -0.270; [1247baf6-4d3c-40d0-b533-4990dc8b5d77 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -0.23968762159347534, 14.15256641805172, 16.278949696570635, 17.511767953634262
LBFGS Accumulation History: 3 points
Removed measurement 7239749e to history. Total: 3
th(0)=-0.23968762159347534;dx=-1.4349001673191053E-7
New Minimum: -0.23968762159347534 > -0.291911780834198
END: th(1396392.8546502963)=-0.291911780834198; dx=-5.4317756171785626E-8 evalInputDelta=0.052224159240722656
Fitness changed from -0.23968762159347534 to -0.291911780834198
Iteration 19 complete. Error: -0.291911780834198 Total: 4.4990; Orientation: 0.0376; Line Search: 3.0480
Adding measurement 140abbcb to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.924e+02, gradient 3.787e-04, dot -0.201; [1247baf6-4d3c-40d0-b533-4990dc8b5d77 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -0.291911780834198, 14.15256641805172, 16.278949696570635, 17.511767953634262
LBFGS Accumulation History: 3 points
Removed measurement 140abbcb to history. Total: 3
th(0)=-0.291911780834198;dx=-1.3383928842596268E-7
Armijo: th(3008437.2069712486)=-0.046902135014534; dx=2.367153990133548E-8 evalInputDelta=-0.245009645819664
New Minimum: -0.291911780834198 > -0.3193060904741287
END: th(1504218.6034856243)=-0.3193060904741287; dx=-7.669425808947623E-9 evalInputDelta=0.027394309639930725
Fitness changed from -0.291911780834198 to -0.3193060904741287
Iteration 20 complete. Error: -0.3193060904741287 Total: 7.2219; Orientation: 0.0453; Line Search: 5.6001
<a id="p-17"></a>Iteration 20
<a id="p-16"></a>![Iteration 20](etc/93d508d8-a2a8-4e96-8481-643b8505e7ce.jpg)
Final threshold in iteration 21: -0.3193060904741287 (> -Infinity) after 134.656s (< 3600.000s)
-0.3193060904741287