Code from BasicOptimizer.scala:88 executed in 482.14 seconds (4.411 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: 2297894313903
Reset training subject: 2307959724425
Adding measurement 7baaea34 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=7.414477236568928;dx=-1.325438506351497E-7
New Minimum: 7.414477236568928 > 7.4144762977957726
WOLFE (weak): th(2.154434690031884)=7.4144762977957726; dx=-1.3450480519021084E-7 evalInputDelta=9.387731552124023E-7
New Minimum: 7.4144762977957726 > 7.41447501629591
WOLFE (weak): th(4.308869380063768)=7.41447501629591; dx=-1.339210826783576E-7 evalInputDelta=2.2202730178833008E-6
New Minimum: 7.41447501629591 > 7.414470043033361
WOLFE (weak): th(12.926608140191302)=7.414470043033361; dx=-1.325945482560959E-7 evalInputDelta=7.193535566329956E-6
New Minimum: 7.414470043033361 > 7.414449617266655
WOLFE (weak): th(51.70643256076521)=7.414449617266655; dx=-1.3498892515664248E-7 evalInputDelta=2.761930227279663E-5
New Minimum: 7.414449617266655 > 7.414338760077953
WOLFE (weak): th(258.53216280382605)=7.414338760077953; dx=-1.291351665119287E-7 evalInputDelta=1.3847649097442627E-4
New Minimum: 7.414338760077953 > 7.4136481285095215
WOLFE (weak): th(1551.1929768229563)=7.4136481285095215; dx=-1.276889045843825E-7 evalInputDelta=8.291080594062805E-4
New Minimum: 7.4136481285095215 > 7.408672086894512
WOLFE (weak): th(10858.350837760694)=7.408672086894512; dx=-1.3402757295912944E-7 evalInputDelta=0.005805149674415588
New Minimum: 7.408672086894512 > 7.367860928177834
WOLFE (weak): th(86866.80670208555)=7.367860928177834; dx=-1.3587743260966258E-7 evalInputDelta=0.04661630839109421
New Minimum: 7.367860928177834 > 6.996551595628262
WOLFE (weak): th(781801.26031877)=6.996551595628262; dx=-1.2888080619717456E-7 evalInputDelta=0.4179256409406662
New Minimum: 6.996551595628262 > 5.267083764076233
END: th(7818012.6031877)=5.267083764076233; dx=-3.672455757504532E-8 evalInputDelta=2.147393472492695
Fitness changed from 7.414477236568928 to 5.267083764076233
Iteration 1 complete. Error: 5.267083764076233 Total: 134.0042; Or
...skipping 6240 bytes...
nt 1.768e-04, dot -0.395; [c08e7919-742b-4d2a-ba60-93e9bf4f76d4 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 1.562859870493412, 4.806866779923439, 5.267083764076233, 7.414477236568928
LBFGS Accumulation History: 3 points
Removed measurement 442b69c3 to history. Total: 3
th(0)=1.562859870493412;dx=-2.868588228252584E-8
Armijo: th(2.5200000000000007E7)=2.6616208776831627; dx=6.527181602013018E-9 evalInputDelta=-1.0987610071897507
New Minimum: 1.562859870493412 > 1.438479796051979
END: th(1.2600000000000004E7)=1.438479796051979; dx=-5.275885359290001E-10 evalInputDelta=0.12438007444143295
Fitness changed from 1.562859870493412 to 1.438479796051979
Iteration 9 complete. Error: 1.438479796051979 Total: 37.8492; Orientation: 0.1644; Line Search: 28.1788
Adding measurement 3956dab1 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.427e+03, gradient 1.722e-04, dot -0.380; [c08e7919-742b-4d2a-ba60-93e9bf4f76d4 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 1.438479796051979, 4.806866779923439, 5.267083764076233, 7.414477236568928
LBFGS Accumulation History: 3 points
Removed measurement 3956dab1 to history. Total: 3
th(0)=1.438479796051979;dx=-2.7312857890051016E-8
Armijo: th(2.7145877094401743E7)=2.452566884458065; dx=5.865307350069089E-9 evalInputDelta=-1.014087088406086
New Minimum: 1.438479796051979 > 1.1653128191828728
WOLF (strong): th(1.3572938547200872E7)=1.1653128191828728; dx=7.965102421564125E-10 evalInputDelta=0.2731669768691063
New Minimum: 1.1653128191828728 > 1.0374882519245148
END: th(4524312.849066957)=1.0374882519245148; dx=-1.3611306919943077E-8 evalInputDelta=0.4009915441274643
Fitness changed from 1.438479796051979 to 1.0374882519245148
Iteration 10 complete. Error: 1.0374882519245148 Total: 48.4338; Orientation: 0.2842; Line Search: 38.1285
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/a18685e3-0a37-4ba7-b748-3d036656713f.jpg)
Final threshold in iteration 11: 1.0374882519245148 (> -Infinity) after 482.134s (< 1800.000s)
1.0374882519245148