Code from BasicOptimizer.scala:88 executed in 2610.14 seconds (6.113 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: 2254305243068
Reset training subject: 2295503617851
Adding measurement 4794c68d to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=21.024859987199306;dx=-1.678587818258253E-5
New Minimum: 21.024859987199306 > 21.024768605828285
WOLFE (weak): th(2.154434690031884)=21.024768605828285; dx=-1.6748125410256198E-5 evalInputDelta=9.138137102127075E-5
New Minimum: 21.024768605828285 > 21.024677455425262
WOLFE (weak): th(4.308869380063768)=21.024677455425262; dx=-1.6752322111438466E-5 evalInputDelta=1.8253177404403687E-4
New Minimum: 21.024677455425262 > 21.02431247383356
WOLFE (weak): th(12.926608140191302)=21.02431247383356; dx=-1.6776418061614064E-5 evalInputDelta=5.475133657455444E-4
New Minimum: 21.02431247383356 > 21.022673092782497
WOLFE (weak): th(51.70643256076521)=21.022673092782497; dx=-1.6620203881657176E-5 evalInputDelta=0.002186894416809082
New Minimum: 21.022673092782497 > 21.013935569673777
WOLFE (weak): th(258.53216280382605)=21.013935569673777; dx=-1.5609391225510757E-5 evalInputDelta=0.010924417525529861
New Minimum: 21.013935569673777 > 20.95959160476923
WOLFE (weak): th(1551.1929768229563)=20.95959160476923; dx=-1.6450056848809094E-5 evalInputDelta=0.0652683824300766
New Minimum: 20.95959160476923 > 20.57799745723605
WOLFE (weak): th(10858.350837760694)=20.57799745723605; dx=-1.579886141742708E-5 evalInputDelta=0.44686252996325493
New Minimum: 20.57799745723605 > 18.19861624017358
END: th(86866.80670208555)=18.19861624017358; dx=-9.192935351549841E-6 evalInputDelta=2.8262437470257282
Fitness changed from 21.024859987199306 to 18.19861624017358
Iteration 1 complete. Error: 18.19861624017358 Total: 496.1891; Orientation: 0.0225; Line Search: 372.4146
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>
Adding measurement fd11866 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=18.19861624017358;dx=-7.838251289901787E-6
New Minimum: 18.19861624017358 > 15.
...skipping 9761 bytes...
6429618299007
END: th(62837.67845926332)=6.086429618299007; dx=-4.1964824244558036E-7 evalInputDelta=0.15828917920589447
Fitness changed from 6.244718797504902 to 6.086429618299007
Iteration 13 complete. Error: 6.086429618299007 Total: 123.3425; Orientation: 0.6317; Line Search: 82.1333
Adding measurement 6530dee3 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.653e+03, gradient 7.843e-04, dot -0.664; [e276f2df-b988-44de-806c-18149db7ae07 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 6.086429618299007, 15.498788617551327, 18.19861624017358, 21.024859987199306
LBFGS Accumulation History: 3 points
Removed measurement 6530dee3 to history. Total: 3
th(0)=6.086429618299007;dx=-6.192647068082295E-7
New Minimum: 6.086429618299007 > 5.897018916904926
END: th(135379.67431370614)=5.897018916904926; dx=-4.7508451837439224E-7 evalInputDelta=0.18941070139408112
Fitness changed from 6.086429618299007 to 5.897018916904926
Iteration 14 complete. Error: 5.897018916904926 Total: 124.6537; Orientation: 0.5445; Line Search: 82.7297
Adding measurement 1ed4f43d to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.696e+03, gradient 7.684e-04, dot -0.672; [e276f2df-b988-44de-806c-18149db7ae07 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 5.897018916904926, 15.498788617551327, 18.19861624017358, 21.024859987199306
LBFGS Accumulation History: 3 points
Removed measurement 1ed4f43d to history. Total: 3
th(0)=5.897018916904926;dx=-5.889062474139184E-7
New Minimum: 5.897018916904926 > 5.595487829297781
END: th(291666.66666666686)=5.595487829297781; dx=-2.8680992229231943E-7 evalInputDelta=0.3015310876071453
Fitness changed from 5.897018916904926 to 5.595487829297781
Iteration 15 complete. Error: 5.595487829297781 Total: 124.8378; Orientation: 0.5862; Line Search: 83.5066
<a id="p-15"></a>Iteration 15
<a id="p-14"></a>
Final threshold in iteration 16: 5.595487829297781 (> -Infinity) after 2610.134s (< 3600.000s)
5.595487829297781