Code from BasicOptimizer.scala:88 executed in 959.79 seconds (8.846 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: 11442308217252
Reset training subject: 11449212643779
Adding measurement 2a3a1231 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=1.5069151818752289;dx=-4.334300494809931E-8
New Minimum: 1.5069151818752289 > 1.5069150626659393
WOLFE (weak): th(2.154434690031884)=1.5069150626659393; dx=-4.327806837976566E-8 evalInputDelta=1.1920928955078125E-7
New Minimum: 1.5069150626659393 > 1.5069149732589722
WOLFE (weak): th(4.308869380063768)=1.5069149732589722; dx=-4.327269695358824E-8 evalInputDelta=2.086162567138672E-7
New Minimum: 1.5069149732589722 > 1.506914347410202
WOLFE (weak): th(12.926608140191302)=1.506914347410202; dx=-4.3271276526537616E-8 evalInputDelta=8.344650268554688E-7
New Minimum: 1.506914347410202 > 1.5069111585617065
WOLFE (weak): th(51.70643256076521)=1.5069111585617065; dx=-4.3275107836675216E-8 evalInputDelta=4.023313522338867E-6
New Minimum: 1.5069111585617065 > 1.5068949460983276
WOLFE (weak): th(258.53216280382605)=1.5068949460983276; dx=-4.327712125096743E-8 evalInputDelta=2.0235776901245117E-5
New Minimum: 1.5068949460983276 > 1.506793960928917
WOLFE (weak): th(1551.1929768229563)=1.506793960928917; dx=-4.3276320553217645E-8 evalInputDelta=1.2122094631195068E-4
New Minimum: 1.506793960928917 > 1.5060655176639557
WOLFE (weak): th(10858.350837760694)=1.5060655176639557; dx=-4.3264094386439155E-8 evalInputDelta=8.496642112731934E-4
New Minimum: 1.5060655176639557 > 1.5001222342252731
WOLFE (weak): th(86866.80670208555)=1.5001222342252731; dx=-4.320650594614685E-8 evalInputDelta=0.0067929476499557495
New Minimum: 1.5001222342252731 > 1.446213573217392
WOLFE (weak): th(781801.26031877)=1.446213573217392; dx=-4.2570915860064106E-8 evalInputDelta=0.060701608657836914
New Minimum: 1.446213573217392 > 0.9696102142333984
END: th(7818012.6031877)=0.9696102142333984; dx=-3.292865274864994E-8 evalInputDelta=0.5373049676418304
Fitness changed from 1.5069151818752289 to 0.9696102142333984
Iteration 1 complete. Error: 0.969610
...skipping 25165 bytes...
9da6d607d = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2.0708401650190353, 0.24860244989395142, 0.9696102142333984, 1.5069151818752289
LBFGS Accumulation History: 3 points
Removed measurement 6f597a3f to history. Total: 3
th(0)=-2.0708401650190353;dx=-3.1981371256377893E-10
Armijo: th(5.8758539198657215E7)=-2.0644208043813705; dx=-4.166289376767594E-11 evalInputDelta=-0.006419360637664795
New Minimum: -2.0708401650190353 > -2.071885332465172
END: th(2.9379269599328607E7)=-2.071885332465172; dx=-5.1801611713203245E-11 evalInputDelta=0.0010451674461364746
Fitness changed from -2.0708401650190353 to -2.071885332465172
Iteration 29 complete. Error: -2.071885332465172 Total: 28.9070; Orientation: 0.8842; Line Search: 21.2635
Adding measurement 1e5a3e40 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.616e+03, gradient 1.934e-05, dot -0.383; [e79dc0a5-fdc9-42aa-9089-a9e9da6d607d = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2.071885332465172, 0.24860244989395142, 0.9696102142333984, 1.5069151818752289
LBFGS Accumulation History: 3 points
Removed measurement 1e5a3e40 to history. Total: 3
th(0)=-2.071885332465172;dx=-3.734388589327516E-10
Armijo: th(6.329571759259268E7)=-2.0597557425498962; dx=1.8076744502582117E-11 evalInputDelta=-0.012129589915275574
New Minimum: -2.071885332465172 > -2.0724884420633316
WOLF (strong): th(3.164785879629634E7)=-2.0724884420633316; dx=1.540122609993612E-11 evalInputDelta=6.0310959815979E-4
New Minimum: -2.0724884420633316 > -2.0756591260433197
END: th(1.0549286265432114E7)=-2.0756591260433197; dx=-2.4553835011303635E-10 evalInputDelta=0.003773793578147888
Fitness changed from -2.071885332465172 to -2.0756591260433197
Iteration 30 complete. Error: -2.0756591260433197 Total: 36.9686; Orientation: 0.8610; Line Search: 28.7667
<a id="p-21"></a>Iteration 30
<a id="p-20"></a>![Iteration 30](etc/383552b8-3b55-4be5-9b83-f441df6a0fb5.jpg)
Final threshold in iteration 31: -2.0756591260433197 (> -Infinity) after 959.786s (< 3600.000s)
-2.0756591260433197