Code from BasicOptimizer.scala:88 executed in 142.10 seconds (2.863 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: 1108057950229
Reset training subject: 1111239683729
Adding measurement 7944c3a to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=10.27746994793415;dx=-2.0093764609395785E-7
New Minimum: 10.27746994793415 > 10.277468532323837
WOLFE (weak): th(2.154434690031884)=10.277468532323837; dx=-2.0012782656172177E-7 evalInputDelta=1.4156103134155273E-6
New Minimum: 10.277468532323837 > 10.277467131614685
WOLFE (weak): th(4.308869380063768)=10.277467131614685; dx=-1.9888414083520633E-7 evalInputDelta=2.816319465637207E-6
New Minimum: 10.277467131614685 > 10.277462482452393
WOLFE (weak): th(12.926608140191302)=10.277462482452393; dx=-1.9976639967327958E-7 evalInputDelta=7.465481758117676E-6
New Minimum: 10.277462482452393 > 10.277440011501312
WOLFE (weak): th(51.70643256076521)=10.277440011501312; dx=-1.9965298056592722E-7 evalInputDelta=2.993643283843994E-5
New Minimum: 10.277440011501312 > 10.277318701148033
WOLFE (weak): th(258.53216280382605)=10.277318701148033; dx=-1.9967112019437794E-7 evalInputDelta=1.512467861175537E-4
New Minimum: 10.277318701148033 > 10.276569128036499
WOLFE (weak): th(1551.1929768229563)=10.276569128036499; dx=-1.9990084771918003E-7 evalInputDelta=9.008198976516724E-4
New Minimum: 10.276569128036499 > 10.271170169115067
WOLFE (weak): th(10858.350837760694)=10.271170169115067; dx=-1.9891970569529988E-7 evalInputDelta=0.0062997788190841675
New Minimum: 10.271170169115067 > 10.227779522538185
WOLFE (weak): th(86866.80670208555)=10.227779522538185; dx=-1.9235381728131293E-7 evalInputDelta=0.049690425395965576
New Minimum: 10.227779522538185 > 9.879040569067001
END: th(781801.26031877)=9.879040569067001; dx=-1.414573736633092E-7 evalInputDelta=0.39842937886714935
Fitness changed from 10.27746994793415 to 9.879040569067001
Iteration 1 complete. Error: 9.879040569067001 Total: 42.5756; Orientation: 0.0074; Line Search: 32.4085
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/3276f8ed-9277-463a-970d-5b51b1835b
...skipping 5326 bytes...
otal: 12.6971; Orientation: 0.1222; Line Search: 8.7461
Adding measurement 303275c8 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.817e+03, gradient 1.378e-04, dot -0.235; [a3f4a68e-fa3c-4f9a-bdbe-1401a30bce6f = 1.000/1.000e+00]
Orientation rejected. Popping history element from 2.8016593605279922, 9.316859126091003, 9.879040569067001, 10.27746994793415
LBFGS Accumulation History: 3 points
Removed measurement 303275c8 to history. Total: 3
th(0)=2.8016593605279922;dx=-1.7911563340090053E-8
Armijo: th(9.072000000000001E7)=3.107455424964428; dx=2.2536679453367067E-9 evalInputDelta=-0.3057960644364357
New Minimum: 2.8016593605279922 > 2.2554249241948128
END: th(4.536000000000001E7)=2.2554249241948128; dx=-1.783844861038634E-9 evalInputDelta=0.5462344363331795
Fitness changed from 2.8016593605279922 to 2.2554249241948128
Iteration 9 complete. Error: 2.2554249241948128 Total: 12.3852; Orientation: 0.1211; Line Search: 9.3998
Adding measurement 7e1dd17e to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.810e+03, gradient 1.263e-04, dot -0.216; [a3f4a68e-fa3c-4f9a-bdbe-1401a30bce6f = 1.000/1.000e+00]
Orientation rejected. Popping history element from 2.2554249241948128, 9.316859126091003, 9.879040569067001, 10.27746994793415
LBFGS Accumulation History: 3 points
Removed measurement 7e1dd17e to history. Total: 3
th(0)=2.2554249241948128;dx=-1.497011153781583E-8
Armijo: th(9.772515753984627E7)=2.987218849360943; dx=2.927093906383054E-9 evalInputDelta=-0.7317939251661301
New Minimum: 2.2554249241948128 > 1.8716218918561935
END: th(4.8862578769923136E7)=1.8716218918561935; dx=-1.5720260454272025E-11 evalInputDelta=0.38380303233861923
Fitness changed from 2.2554249241948128 to 1.8716218918561935
Iteration 10 complete. Error: 1.8716218918561935 Total: 12.3917; Orientation: 0.1245; Line Search: 9.4004
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/4b9791f0-dae6-45d3-85d5-15fbdd9aef8f.jpg)
Final threshold in iteration 11: 1.8716218918561935 (> -Infinity) after 142.097s (< 1800.000s)
1.8716218918561935