Code from BasicOptimizer.scala:88 executed in 377.97 seconds (4.279 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: 3292404183518
Reset training subject: 3295071375989
Adding measurement 3097eb69 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=1.9161777198314667;dx=-1.543954184204452E-7
New Minimum: 1.9161777198314667 > 1.9161772429943085
WOLFE (weak): th(2.154434690031884)=1.9161772429943085; dx=-1.5239116357220073E-7 evalInputDelta=4.76837158203125E-7
New Minimum: 1.9161772429943085 > 1.9161766916513443
WOLFE (weak): th(4.308869380063768)=1.9161766916513443; dx=-1.5236375462551745E-7 evalInputDelta=1.0281801223754883E-6
New Minimum: 1.9161766916513443 > 1.9161742180585861
WOLFE (weak): th(12.926608140191302)=1.9161742180585861; dx=-1.5236904572371142E-7 evalInputDelta=3.5017728805541992E-6
New Minimum: 1.9161742180585861 > 1.9161639511585236
WOLFE (weak): th(51.70643256076521)=1.9161639511585236; dx=-1.5237663382892246E-7 evalInputDelta=1.3768672943115234E-5
New Minimum: 1.9161639511585236 > 1.9161087572574615
WOLFE (weak): th(258.53216280382605)=1.9161087572574615; dx=-1.5238011500202318E-7 evalInputDelta=6.896257400512695E-5
New Minimum: 1.9161087572574615 > 1.9157645404338837
WOLFE (weak): th(1551.1929768229563)=1.9157645404338837; dx=-1.5233144238133342E-7 evalInputDelta=4.131793975830078E-4
New Minimum: 1.9157645404338837 > 1.9132871180772781
WOLFE (weak): th(10858.350837760694)=1.9132871180772781; dx=-1.523121982198417E-7 evalInputDelta=0.0028906017541885376
New Minimum: 1.9132871180772781 > 1.8931058645248413
WOLFE (weak): th(86866.80670208555)=1.8931058645248413; dx=-1.514129492970727E-7 evalInputDelta=0.023071855306625366
New Minimum: 1.8931058645248413 > 1.7159801125526428
WOLFE (weak): th(781801.26031877)=1.7159801125526428; dx=-1.3982197956650556E-7 evalInputDelta=0.20019760727882385
New Minimum: 1.7159801125526428 > 0.7011222243309021
END: th(7818012.6031877)=0.7011222243309021; dx=-5.820413806935621E-8 evalInputDelta=1.2150554955005646
Fitness changed from 1.9161777198314667 to 0.7011222243309021
Iteration 1 complete. Error: 0
...skipping 25502 bytes...
945-7d6e055b2b79 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.646206758916378, -0.16365423798561096, 0.7011222243309021, 1.9161777198314667
LBFGS Accumulation History: 3 points
Removed measurement 9d170d to history. Total: 3
th(0)=-1.646206758916378;dx=-1.0240638813323193E-9
New Minimum: -1.646206758916378 > -1.6477105692029
WOLF (strong): th(1.9586179732885737E7)=-1.6477105692029; dx=4.53004604991102E-11 evalInputDelta=0.0015038102865219116
New Minimum: -1.6477105692029 > -1.6504044830799103
END: th(9793089.866442868)=-1.6504044830799103; dx=-6.887125022306098E-11 evalInputDelta=0.004197724163532257
Fitness changed from -1.646206758916378 to -1.6504044830799103
Iteration 29 complete. Error: -1.6504044830799103 Total: 11.6157; Orientation: 0.3278; Line Search: 8.5392
Adding measurement 490cbe27 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.028e+03, gradient 3.620e-05, dot -0.508; [d6dad705-e596-4986-9945-7d6e055b2b79 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.6504044830799103, -0.16365423798561096, 0.7011222243309021, 1.9161777198314667
LBFGS Accumulation History: 3 points
Removed measurement 490cbe27 to history. Total: 3
th(0)=-1.6504044830799103;dx=-1.3083177413207135E-9
Armijo: th(2.1098572530864224E7)=-1.6447089686989784; dx=4.987563063691668E-10 evalInputDelta=-0.005695514380931854
New Minimum: -1.6504044830799103 > -1.6562777981162071
WOLF (strong): th(1.0549286265432112E7)=-1.6562777981162071; dx=3.180447397721833E-10 evalInputDelta=0.0058733150362968445
END: th(3516428.7551440373)=-1.655953288078308; dx=-8.916168509470327E-10 evalInputDelta=0.005548804998397827
Fitness changed from -1.6504044830799103 to -1.6562777981162071
Iteration 30 complete. Error: -1.6562777981162071 Total: 14.2598; Orientation: 0.3253; Line Search: 11.0749
<a id="p-21"></a>Iteration 30
<a id="p-20"></a>![Iteration 30](etc/9bf0f097-77e8-4c61-a1e3-496d296c52b1.jpg)
Final threshold in iteration 31: -1.6562777981162071 (> -Infinity) after 377.968s (< 3600.000s)
-1.6562777981162071