BasicOptimizer.scala:89 executed in 131.67 seconds (1.737 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: 110677829106500
Reset training subject: 110680550900900
Adding measurement 38eb3f40 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-19.984759377000834;dx=-1.46779597765713E-6
New Minimum: -19.984759377000834 > -19.984762550592073
END: th(2.154434690031884)=-19.984762550592073; dx=-1.2092446721756823E-6 evalInputDelta=3.1735912386920972E-6
Fitness changed from -19.984759377000834 to -19.984762550592073
Iteration 1 complete. Error: -19.984762550592073 Total: 13.6818; Orientation: 0.0659; Line Search: 5.5789
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>
Adding measurement 5cb6d69d to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-19.984762550592073;dx=-1.2105798784040863E-6
New Minimum: -19.984762550592073 > -19.984767839909686
WOLFE (weak): th(4.641588833612779)=-19.984767839909686; dx=-1.2086871993641822E-6 evalInputDelta=5.2893176132329245E-6
New Minimum: -19.984767839909686 > -19.98477524495199
WOLFE (weak): th(9.283177667225559)=-19.98477524495199; dx=-1.2082901335107552E-6 evalInputDelta=1.2694359917020392E-5
New Minimum: -19.98477524495199 > -19.98480063364763
WOLFE (weak): th(27.849533001676676)=-19.98480063364763; dx=-1.2081712791011114E-6 evalInputDelta=3.8083055557081025E-5
New Minimum: -19.98480063364763 > -19.984910650956028
WOLFE (weak): th(111.3981320067067)=-19.984910650956028; dx=-1.2075887957193027E-6 evalInputDelta=1.4810036395473958E-4
New Minimum: -19.984910650956028 > -19.98550092578799
WOLFE (weak): th(556.9906600335335)=-19.98550092578799; dx=-1.2068258169209324E-6 evalInputDelta=7.383751959153528E-4
New Minimum: -19.98550092578799 > -19.989196623164496
WOLFE (weak): th(3341.9439602012008)=-19.989196623164496; dx=-1.2066909516959347E-6 evalInputDelta=0.004434072572422565
New Minimum: -19.989196623164496 > -20.01579204930001
WOLFE (weak): th(23393.607721408407)=-20.01579204930001; dx=-1.2062143753245686E-6 evalInputDelta=0.031029498707937364
New Minimum: -20.01579204930001 > -20.231993125349938
WOLFE (weak): th(187148.86177126726)=-20.231993125349938; dx=-1.1950336009855539E-6 evalInputDelta=0.24723057475786447
New Minimum: -20.231993125349938 > -22.068579774617795
END: th(1684339.7559414054)=-22.068579774617795; dx=-1.0256441275151613E-6 evalInputDelta=2.0838172240257222
Fitness changed from -19.984762550592073 to -22.068579774617795
Iteration 2 complete. Error: -22.068579774617795 Total: 30.1223; Orientation: 0.0647; Line Search: 26.9395
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>
Adding measurement 5611722 to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-22.068579774617795;dx=-1.0683044851896065E-6
New Minimum: -22.068579774617795 > -25.52836267535234
END: th(3628800.0000000005)=-25.52836267535234; dx=-7.060919397603014E-7 evalInputDelta=3.4597829007345453
Fitness changed from -22.068579774617795 to -25.52836267535234
Iteration 3 complete. Error: -25.52836267535234 Total: 8.5599; Orientation: 0.0662; Line Search: 5.1637
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>
Adding measurement 7c57f843 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.416e+04, gradient 8.724e-04, dot -0.762; [d05daed3-6b8c-46ce-8a69-d826e1e79120 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -25.52836267535234, -22.068579774617795, -19.984762550592073, -19.984759377000834
LBFGS Accumulation History: 3 points
Removed measurement 7c57f843 to history. Total: 3
th(0)=-25.52836267535234;dx=-7.606685346219401E-7
New Minimum: -25.52836267535234 > -30.275028613614396
END: th(7818012.603187701)=-30.275028613614396; dx=-3.799724427280021E-7 evalInputDelta=4.746665938262055
Fitness changed from -25.52836267535234 to -30.275028613614396
Iteration 4 complete. Error: -30.275028613614396 Total: 9.7365; Orientation: 1.1347; Line Search: 5.4761
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>
Adding measurement 70f2a96f to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.469e+04, gradient 7.783e-04, dot -0.546; [d05daed3-6b8c-46ce-8a69-d826e1e79120 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -30.275028613614396, -22.068579774617795, -19.984762550592073, -19.984759377000834
LBFGS Accumulation History: 3 points
Removed measurement 70f2a96f to history. Total: 3
th(0)=-30.275028613614396;dx=-6.054900027598874E-7
New Minimum: -30.275028613614396 > -35.32548209976624
END: th(1.6843397559414055E7)=-35.32548209976624; dx=-1.216323128903633E-7 evalInputDelta=5.050453486151845
Fitness changed from -30.275028613614396 to -35.32548209976624
Iteration 5 complete. Error: -35.32548209976624 Total: 9.4057; Orientation: 1.1352; Line Search: 5.2649
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>
Adding measurement 48b0ea84 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.372e+04, gradient 8.059e-04, dot -0.316; [d05daed3-6b8c-46ce-8a69-d826e1e79120 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -35.32548209976624, -22.068579774617795, -19.984762550592073, -19.984759377000834
LBFGS Accumulation History: 3 points
Removed measurement 48b0ea84 to history. Total: 3
th(0)=-35.32548209976624;dx=-6.480022906981125E-7
New Minimum: -35.32548209976624 > -38.395786711417394
WOLF (strong): th(3.628800000000001E7)=-38.395786711417394; dx=4.729098690244162E-8 evalInputDelta=3.070304611651153
New Minimum: -38.395786711417394 > -39.43791482762912
WOLF (strong): th(1.8144000000000004E7)=-39.43791482762912; dx=1.6531378689211097E-8 evalInputDelta=4.112432727862881
END: th(6048000.000000001)=-38.42093920695149; dx=-2.8621827831638764E-7 evalInputDelta=3.095457107185247
Fitness changed from -35.32548209976624 to -39.43791482762912
Iteration 6 complete. Error: -39.43791482762912 Total: 15.0890; Orientation: 1.1337; Line Search: 10.8265
Adding measurement 34aa933c to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.658e+04, gradient 8.006e-04, dot -0.268; [d05daed3-6b8c-46ce-8a69-d826e1e79120 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -39.43791482762912, -22.068579774617795, -19.984762550592073, -19.984759377000834
LBFGS Accumulation History: 3 points
Removed measurement 34aa933c to history. Total: 3
th(0)=-39.43791482762912;dx=-6.404394400081518E-7
New Minimum: -39.43791482762912 > -43.914485530103214
END: th(1.3030021005312836E7)=-43.914485530103214; dx=-2.237260897994982E-8 evalInputDelta=4.476570702474092
Fitness changed from -39.43791482762912 to -43.914485530103214
Iteration 7 complete. Error: -43.914485530103214 Total: 9.0817; Orientation: 1.0743; Line Search: 5.3166
Adding measurement 540e835f to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.457e+04, gradient 6.664e-04, dot -0.372; [d05daed3-6b8c-46ce-8a69-d826e1e79120 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -43.914485530103214, -22.068579774617795, -19.984762550592073, -19.984759377000834
LBFGS Accumulation History: 3 points
Removed measurement 540e835f to history. Total: 3
th(0)=-43.914485530103214;dx=-4.438712424385222E-7
New Minimum: -43.914485530103214 > -45.650629386740796
WOLF (strong): th(2.8072329265690096E7)=-45.650629386740796; dx=8.131674779659284E-8 evalInputDelta=1.7361438566375824
New Minimum: -45.650629386740796 > -46.77441189216572
WOLF (strong): th(1.4036164632845048E7)=-46.77441189216572; dx=2.990254457751018E-9 evalInputDelta=2.8599263620625095
END: th(4678721.544281683)=-45.73783816757413; dx=-2.66939167604015E-7 evalInputDelta=1.8233526374709186
Fitness changed from -43.914485530103214 to -46.77441189216572
Iteration 8 complete. Error: -46.77441189216572 Total: 14.7999; Orientation: 1.2307; Line Search: 10.9356
Adding measurement 48a418f to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.819e+04, gradient 6.672e-04, dot -0.359; [d05daed3-6b8c-46ce-8a69-d826e1e79120 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -46.77441189216572, -22.068579774617795, -19.984762550592073, -19.984759377000834
LBFGS Accumulation History: 3 points
Removed measurement 48a418f to history. Total: 3
th(0)=-46.77441189216572;dx=-4.4398777565875385E-7
New Minimum: -46.77441189216572 > -49.3932287230294
END: th(1.0080000000000004E7)=-49.3932287230294; dx=-3.967901404569824E-8 evalInputDelta=2.618816830863679
Fitness changed from -46.77441189216572 to -49.3932287230294
Iteration 9 complete. Error: -49.3932287230294 Total: 9.0137; Orientation: 1.1219; Line Search: 5.3157
Adding measurement 4a1014c7 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.478e+04, gradient 5.560e-04, dot -0.456; [d05daed3-6b8c-46ce-8a69-d826e1e79120 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -49.3932287230294, -22.068579774617795, -19.984762550592073, -19.984759377000834
LBFGS Accumulation History: 3 points
Removed measurement 4a1014c7 to history. Total: 3
th(0)=-49.3932287230294;dx=-3.08200264672528E-7
New Minimum: -49.3932287230294 > -51.11697039110748
WOLF (strong): th(2.1716701675521396E7)=-51.11697039110748; dx=2.9423790609627418E-8 evalInputDelta=1.7237416680780768
New Minimum: -51.11697039110748 > -51.29466307548832
END: th(1.0858350837760698E7)=-51.29466307548832; dx=-4.5017215570018E-8 evalInputDelta=1.9014343524589208
Fitness changed from -49.3932287230294 to -51.29466307548832
Iteration 10 complete. Error: -51.29466307548832 Total: 11.6985; Orientation: 1.1066; Line Search: 8.0818
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>
Final threshold in iteration 11: -51.29466307548832 (> -Infinity) after 131.674s (< 5400.000s)
Returns
-51.29466307548832