Code from BasicOptimizer.scala:88 executed in 409.10 seconds (4.512 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: 6886164880310
Reset training subject: 6894496260534
Adding measurement 9e426bb to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=7.386790454387665;dx=-2.143797206619306E-7
New Minimum: 7.386790454387665 > 7.386790156364441
WOLFE (weak): th(2.154434690031884)=7.386790156364441; dx=-2.1157522889286258E-7 evalInputDelta=2.980232238769531E-7
New Minimum: 7.386790156364441 > 7.386789530515671
WOLFE (weak): th(4.308869380063768)=7.386789530515671; dx=-2.1159047116662458E-7 evalInputDelta=9.238719940185547E-7
New Minimum: 7.386789530515671 > 7.386787578463554
WOLFE (weak): th(12.926608140191302)=7.386787578463554; dx=-2.105368477333495E-7 evalInputDelta=2.8759241104125977E-6
New Minimum: 7.386787578463554 > 7.386778861284256
WOLFE (weak): th(51.70643256076521)=7.386778861284256; dx=-2.1159414389397443E-7 evalInputDelta=1.1593103408813477E-5
New Minimum: 7.386778861284256 > 7.386732950806618
WOLFE (weak): th(258.53216280382605)=7.386732950806618; dx=-2.1156541027931828E-7 evalInputDelta=5.7503581047058105E-5
New Minimum: 7.386732950806618 > 7.386446133255959
WOLFE (weak): th(1551.1929768229563)=7.386446133255959; dx=-2.1153467918135928E-7 evalInputDelta=3.443211317062378E-4
New Minimum: 7.386446133255959 > 7.384382411837578
WOLFE (weak): th(10858.350837760694)=7.384382411837578; dx=-2.1142915053935648E-7 evalInputDelta=0.002408042550086975
New Minimum: 7.384382411837578 > 7.36755034327507
WOLFE (weak): th(86866.80670208555)=7.36755034327507; dx=-2.110262397482052E-7 evalInputDelta=0.019240111112594604
New Minimum: 7.36755034327507 > 7.216417163610458
WOLFE (weak): th(781801.26031877)=7.216417163610458; dx=-2.0427374164384042E-7 evalInputDelta=0.17037329077720642
New Minimum: 7.216417163610458 > 6.056355282664299
END: th(7818012.6031877)=6.056355282664299; dx=-1.3140707001480573E-7 evalInputDelta=1.3304351717233658
Fitness changed from 7.386790454387665 to 6.056355282664299
Iteration 1 complete. Error: 6.056355282664299 Total: 116.0221; Or
...skipping 6013 bytes...
73137 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -0.021317988634109497, 4.634820103645325, 6.056355282664299, 7.386790454387665
LBFGS Accumulation History: 3 points
Removed measurement 348d927a to history. Total: 3
th(0)=-0.021317988634109497;dx=-1.3774257287768539E-8
Armijo: th(2.268000000000001E8)=1.2291865348815918; dx=3.3601899009236875E-9 evalInputDelta=-1.2505045235157013
New Minimum: -0.021317988634109497 > -0.16035163402557373
END: th(1.1340000000000004E8)=-0.16035163402557373; dx=-1.8684303479217945E-10 evalInputDelta=0.13903364539146423
Fitness changed from -0.021317988634109497 to -0.16035163402557373
Iteration 9 complete. Error: -0.16035163402557373 Total: 35.6432; Orientation: 0.8049; Line Search: 26.1067
Adding measurement 74537d2f to history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.423e+03, gradient 1.122e-04, dot -0.225; [4b71aa4d-afd3-4a8c-a927-83cbc3c73137 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -0.16035163402557373, 4.634820103645325, 6.056355282664299, 7.386790454387665
LBFGS Accumulation History: 3 points
Removed measurement 74537d2f to history. Total: 3
th(0)=-0.16035163402557373;dx=-1.2566809956850888E-8
Armijo: th(2.4431289384961572E8)=1.3517274260520935; dx=4.265727139997669E-9 evalInputDelta=-1.5120790600776672
New Minimum: -0.16035163402557373 > -0.22997534275054932
WOLF (strong): th(1.2215644692480786E8)=-0.22997534275054932; dx=7.690911516075631E-10 evalInputDelta=0.06962370872497559
New Minimum: -0.22997534275054932 > -0.4876772463321686
END: th(4.071881564160262E7)=-0.4876772463321686; dx=-6.749649963395162E-9 evalInputDelta=0.32732561230659485
Fitness changed from -0.16035163402557373 to -0.4876772463321686
Iteration 10 complete. Error: -0.4876772463321686 Total: 43.1901; Orientation: 0.8065; Line Search: 34.2039
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/8682fe94-5f0a-4b7c-9124-d3c90a6cbbdd.jpg)
Final threshold in iteration 11: -0.4876772463321686 (> -Infinity) after 409.100s (< 3600.000s)
-0.4876772463321686