Code from BasicOptimizer.scala:88 executed in 56.73 seconds (2.950 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: 1005360368487
Reset training subject: 1006862567041
Adding measurement 75458b3e to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=25.10103363916278;dx=-1.95690103197968E-6
New Minimum: 25.10103363916278 > 25.10102352127433
WOLFE (weak): th(2.154434690031884)=25.10102352127433; dx=-1.962079047916581E-6 evalInputDelta=1.0117888450622559E-5
New Minimum: 25.10102352127433 > 25.101014596410096
WOLFE (weak): th(4.308869380063768)=25.101014596410096; dx=-1.9979478544787143E-6 evalInputDelta=1.904275268316269E-5
New Minimum: 25.101014596410096 > 25.10097703523934
WOLFE (weak): th(12.926608140191302)=25.10097703523934; dx=-2.002368339736634E-6 evalInputDelta=5.660392343997955E-5
New Minimum: 25.10097703523934 > 25.100808159448206
WOLFE (weak): th(51.70643256076521)=25.100808159448206; dx=-1.9918553798344956E-6 evalInputDelta=2.2547971457242966E-4
New Minimum: 25.100808159448206 > 25.09990667924285
WOLFE (weak): th(258.53216280382605)=25.09990667924285; dx=-1.95404259059218E-6 evalInputDelta=0.0011269599199295044
New Minimum: 25.09990667924285 > 25.09429701883346
WOLFE (weak): th(1551.1929768229563)=25.09429701883346; dx=-1.945361912678177E-6 evalInputDelta=0.006736620329320431
New Minimum: 25.09429701883346 > 25.05417774245143
WOLFE (weak): th(10858.350837760694)=25.05417774245143; dx=-1.8876270815964154E-6 evalInputDelta=0.04685589671134949
New Minimum: 25.05417774245143 > 24.709181608632207
END: th(86866.80670208555)=24.709181608632207; dx=-1.5938588339671619E-6 evalInputDelta=0.39185203053057194
Fitness changed from 25.10103363916278 to 24.709181608632207
Iteration 1 complete. Error: 24.709181608632207 Total: 16.6629; Orientation: 0.0312; Line Search: 12.6056
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/c54df343-529f-4ea5-8df6-6c2cdecb8455.jpg)
Adding measurement 7231ccf to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=24.709181608632207;dx=-1.701256979095282E-6
New Minimum: 24.709181608632207 > 23.8599
...skipping 5168 bytes...
-b537-662987ef251d = 1.000/1.000e+00]
Orientation rejected. Popping history element from 6.030641257762909, 23.859916491433978, 24.709181608632207, 25.10103363916278
LBFGS Accumulation History: 3 points
Removed measurement 4a4a3a07 to history. Total: 3
th(0)=6.030641257762909;dx=-1.5179745389231419E-7
Armijo: th(4.0320000000000015E7)=16.895887345075607; dx=4.76900877722317E-8 evalInputDelta=-10.865246087312698
Armijo: th(2.0160000000000007E7)=8.242384791374207; dx=3.149960904824147E-8 evalInputDelta=-2.2117435336112976
New Minimum: 6.030641257762909 > 5.421808138489723
END: th(6720000.000000003)=5.421808138489723; dx=-2.9094703354732923E-8 evalInputDelta=0.6088331192731857
Fitness changed from 6.030641257762909 to 5.421808138489723
Iteration 9 complete. Error: 5.421808138489723 Total: 6.7728; Orientation: 0.0426; Line Search: 5.4710
Adding measurement 69955105 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.356e+02, gradient 2.831e-04, dot -0.104; [0bea7be4-af40-4a41-b537-662987ef251d = 1.000/1.000e+00]
Orientation rejected. Popping history element from 5.421808138489723, 23.859916491433978, 24.709181608632207, 25.10103363916278
LBFGS Accumulation History: 3 points
Removed measurement 69955105 to history. Total: 3
th(0)=5.421808138489723;dx=-7.8028322805996E-8
Armijo: th(1.4477801117014265E7)=6.187700271606445; dx=2.5504228881231566E-8 evalInputDelta=-0.7658921331167221
New Minimum: 5.421808138489723 > 4.903902247548103
WOLF (strong): th(7238900.558507132)=4.903902247548103; dx=1.4414114330094175E-8 evalInputDelta=0.5179058909416199
END: th(2412966.8528357106)=4.924452409148216; dx=-5.1220027729455956E-8 evalInputDelta=0.49735572934150696
Fitness changed from 5.421808138489723 to 4.903902247548103
Iteration 10 complete. Error: 4.903902247548103 Total: 5.7853; Orientation: 0.0443; Line Search: 4.6243
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/6341281a-8ebd-4775-8140-68789fe2c813.jpg)
Final threshold in iteration 11: 4.903902247548103 (> -Infinity) after 56.712s (< 1800.000s)
4.903902247548103