BasicOptimizer.scala:89 executed in 77.50 seconds (1.155 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: 138989862319900
Reset training subject: 138990962649700
Adding measurement 5fcef70b to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-3.3220719662023455;dx=-1.3461265097921862E-5
New Minimum: -3.3220719662023455 > -3.3221015419398188
WOLFE (weak): th(2.154434690031884)=-3.3221015419398188; dx=-1.3098613469703997E-5 evalInputDelta=2.957573747330855E-5
New Minimum: -3.3221015419398188 > -3.3221312500388422
WOLFE (weak): th(4.308869380063768)=-3.3221312500388422; dx=-1.319154731271437E-5 evalInputDelta=5.9283836496781817E-5
New Minimum: -3.3221312500388422 > -3.322249681918049
WOLFE (weak): th(12.926608140191302)=-3.322249681918049; dx=-1.3200916737500221E-5 evalInputDelta=1.7771571570346367E-4
New Minimum: -3.322249681918049 > -3.322782109041188
WOLFE (weak): th(51.70643256076521)=-3.322782109041188; dx=-1.3135848787879156E-5 evalInputDelta=7.101428388427422E-4
New Minimum: -3.322782109041188 > -3.325623283749973
WOLFE (weak): th(258.53216280382605)=-3.325623283749973; dx=-1.3136980552291867E-5 evalInputDelta=0.003551317547627608
New Minimum: -3.325623283749973 > -3.343296931252129
WOLFE (weak): th(1551.1929768229563)=-3.343296931252129; dx=-1.3066448470950192E-5 evalInputDelta=0.02122496504978333
New Minimum: -3.343296931252129 > -3.4685440592155747
WOLFE (weak): th(10858.350837760694)=-3.4685440592155747; dx=-1.2956711702767635E-5 evalInputDelta=0.14647209301322928
New Minimum: -3.4685440592155747 > -4.385942051130357
END: th(86866.80670208555)=-4.385942051130357; dx=-1.075209428452973E-5 evalInputDelta=1.0638700849280114
Fitness changed from -3.3220719662023455 to -4.385942051130357
Iteration 1 complete. Error: -4.385942051130357 Total: 11.2806; Orientation: 0.0183; Line Search: 8.3633
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/bdb78996-6847-4510-be20-df85f2b640e1.jpg)
Adding measurement 19c6f5f to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-4.385942051130357;dx=-1.3144745763234754E-5
New Minimum: -4.385942051130357 > -6.526495686300066
END: th(187148.86177126726)=-6.526495686300066; dx=-9.641716589233374E-6 evalInputDelta=2.1405536351697094
Fitness changed from -4.385942051130357 to -6.526495686300066
Iteration 2 complete. Error: -6.526495686300066 Total: 2.9863; Orientation: 0.0190; Line Search: 1.9982
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/b6feb1a7-668e-447d-a1e7-421d2164668d.jpg)
Adding measurement 39236f4a to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-6.526495686300066;dx=-1.5168362262491068E-5
New Minimum: -6.526495686300066 > -9.807519655889914
END: th(403200.00000000006)=-9.807519655889914; dx=-5.39974165064313E-6 evalInputDelta=3.2810239695898478
Fitness changed from -6.526495686300066 to -9.807519655889914
Iteration 3 complete. Error: -9.807519655889914 Total: 2.9256; Orientation: 0.0153; Line Search: 1.9016
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>![Iteration 3](etc/83dd2d13-83df-4e24-992d-ea7e6df8c52e.jpg)
Adding measurement 64225277 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.230e+04, gradient 4.060e-03, dot -0.324; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -9.807519655889914, -6.526495686300066, -4.385942051130357, -3.3220719662023455
LBFGS Accumulation History: 3 points
Removed measurement 64225277 to history. Total: 3
th(0)=-9.807519655889914;dx=-1.6376150859369688E-5
New Minimum: -9.807519655889914 > -13.00234345688799
END: th(868668.0670208557)=-13.00234345688799; dx=-2.56344392973994E-6 evalInputDelta=3.1948238009980763
Fitness changed from -9.807519655889914 to -13.00234345688799
Iteration 4 complete. Error: -13.00234345688799 Total: 3.3222; Orientation: 0.2838; Line Search: 1.9324
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>![Iteration 4](etc/a79f38e4-5fdd-4e5e-b8e9-db0b4503d28a.jpg)
Adding measurement 4c00d817 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.699e+04, gradient 4.331e-03, dot -0.250; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -13.00234345688799, -6.526495686300066, -4.385942051130357, -3.3220719662023455
LBFGS Accumulation History: 3 points
Removed measurement 4c00d817 to history. Total: 3
th(0)=-13.00234345688799;dx=-1.86025664404119E-5
New Minimum: -13.00234345688799 > -15.217012308047185
END: th(1871488.617712673)=-15.217012308047185; dx=-7.725313687613793E-8 evalInputDelta=2.2146688511591943
Fitness changed from -13.00234345688799 to -15.217012308047185
Iteration 5 complete. Error: -15.217012308047185 Total: 3.3266; Orientation: 0.2940; Line Search: 2.0309
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>![Iteration 5](etc/ed54a2d1-deef-4b00-8fa5-6739d5aada6a.jpg)
Adding measurement 3f1e218c to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.464e+04, gradient 3.944e-03, dot -0.138; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -15.217012308047185, -6.526495686300066, -4.385942051130357, -3.3220719662023455
LBFGS Accumulation History: 3 points
Removed measurement 3f1e218c to history. Total: 3
th(0)=-15.217012308047185;dx=-1.5387649232747438E-5
New Minimum: -15.217012308047185 > -16.10318392270932
WOLF (strong): th(4032000.0000000014)=-16.10318392270932; dx=9.221894054267833E-7 evalInputDelta=0.8861716146621355
New Minimum: -16.10318392270932 > -21.428679313420467
WOLF (strong): th(2016000.0000000007)=-21.428679313420467; dx=2.3216694692272498E-7 evalInputDelta=6.2116670053732825
New Minimum: -21.428679313420467 > -21.996926677144753
END: th(672000.0000000002)=-21.996926677144753; dx=-5.735252857497403E-6 evalInputDelta=6.779914369097568
Fitness changed from -15.217012308047185 to -21.996926677144753
Iteration 6 complete. Error: -21.996926677144753 Total: 5.0513; Orientation: 0.2824; Line Search: 3.8123
Adding measurement 3e632c01 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.735e+04, gradient 3.492e-03, dot -0.187; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -21.996926677144753, -6.526495686300066, -4.385942051130357, -3.3220719662023455
LBFGS Accumulation History: 3 points
Removed measurement 3e632c01 to history. Total: 3
th(0)=-21.996926677144753;dx=-1.2080215597941951E-5
New Minimum: -21.996926677144753 > -26.978917498106224
END: th(1447780.1117014263)=-26.978917498106224; dx=-1.875495952004831E-6 evalInputDelta=4.981990820961471
Fitness changed from -21.996926677144753 to -26.978917498106224
Iteration 7 complete. Error: -26.978917498106224 Total: 2.9666; Orientation: 0.2931; Line Search: 1.7951
Adding measurement 7f4f31c1 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.734e+04, gradient 3.814e-03, dot -0.222; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -26.978917498106224, -6.526495686300066, -4.385942051130357, -3.3220719662023455
LBFGS Accumulation History: 3 points
Removed measurement 7f4f31c1 to history. Total: 3
th(0)=-26.978917498106224;dx=-1.4423168081276008E-5
Armijo: th(3119147.6961877886)=-23.879735971730263; dx=1.3708345206663995E-6 evalInputDelta=-3.0991815263759612
New Minimum: -26.978917498106224 > -29.50863535788001
WOLF (strong): th(1559573.8480938943)=-29.50863535788001; dx=7.247931107435781E-7 evalInputDelta=2.529717859773786
New Minimum: -29.50863535788001 > -30.922117012676207
END: th(519857.94936463144)=-30.922117012676207; dx=-4.748359646718776E-6 evalInputDelta=3.943199514569983
Fitness changed from -26.978917498106224 to -30.922117012676207
Iteration 8 complete. Error: -30.922117012676207 Total: 4.8417; Orientation: 0.2789; Line Search: 3.7541
Adding measurement 6e21ec84 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 7.374e+04, gradient 3.226e-03, dot -0.248; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -30.922117012676207, -6.526495686300066, -4.385942051130357, -3.3220719662023455
LBFGS Accumulation History: 3 points
Removed measurement 6e21ec84 to history. Total: 3
th(0)=-30.922117012676207;dx=-1.027144019486564E-5
New Minimum: -30.922117012676207 > -33.51366270944907
END: th(1120000.0000000005)=-33.51366270944907; dx=-2.3002947287729055E-6 evalInputDelta=2.591545696772865
Fitness changed from -30.922117012676207 to -33.51366270944907
Iteration 9 complete. Error: -33.51366270944907 Total: 2.8870; Orientation: 0.2800; Line Search: 1.7591
Adding measurement 603a0dcf to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.800e+05, gradient 3.671e-03, dot -0.281; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -33.51366270944907, -6.526495686300066, -4.385942051130357, -3.3220719662023455
LBFGS Accumulation History: 3 points
Removed measurement 603a0dcf to history. Total: 3
th(0)=-33.51366270944907;dx=-1.3368897352125776E-5
Armijo: th(2412966.852835711)=-30.357345188967393; dx=1.2468884076915283E-6 evalInputDelta=-3.1563175204816787
New Minimum: -33.51366270944907 > -34.72008832217407
WOLF (strong): th(1206483.4264178555)=-34.72008832217407; dx=9.52618184964955E-7 evalInputDelta=1.206425612724999
New Minimum: -34.72008832217407 > -36.1147221332755
END: th(402161.14213928516)=-36.1147221332755; dx=-4.212679323157435E-6 evalInputDelta=2.6010594238264275
Fitness changed from -33.51366270944907 to -36.1147221332755
Iteration 10 complete. Error: -36.1147221332755 Total: 4.7607; Orientation: 0.2709; Line Search: 3.5524
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/b7b016bd-3ac1-4c9b-934e-9369126a08ab.jpg)
Adding measurement 2499e4dd to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.237e+05, gradient 3.001e-03, dot -0.319; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -36.1147221332755, -6.526495686300066, -4.385942051130357, -3.3220719662023455
LBFGS Accumulation History: 3 points
Removed measurement 2499e4dd to history. Total: 3
th(0)=-36.1147221332755;dx=-8.869309668115605E-6
New Minimum: -36.1147221332755 > -38.133158439638535
END: th(866429.9156077192)=-38.133158439638535; dx=-2.8969169939956757E-6 evalInputDelta=2.0184363063630357
Fitness changed from -36.1147221332755 to -38.133158439638535
Iteration 11 complete. Error: -38.133158439638535 Total: 3.2756; Orientation: 0.3041; Line Search: 2.0048
Adding measurement 745d33a to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.617e+07, gradient 3.219e-03, dot -0.323; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -38.133158439638535, -6.526495686300066, -4.385942051130357, -3.3220719662023455
LBFGS Accumulation History: 3 points
Removed measurement 745d33a to history. Total: 3
th(0)=-38.133158439638535;dx=-1.0296911743423997E-5
Armijo: th(1866666.666666668)=-37.610168880236785; dx=1.00972559027691E-7 evalInputDelta=-0.5229895594017506
New Minimum: -38.133158439638535 > -39.55146899785348
END: th(933333.333333334)=-39.55146899785348; dx=-9.41418311761175E-7 evalInputDelta=1.418310558214948
Fitness changed from -38.133158439638535 to -39.55146899785348
Iteration 12 complete. Error: -39.55146899785348 Total: 3.8621; Orientation: 0.3018; Line Search: 2.7023
Adding measurement 331c309b to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.414e+05, gradient 3.608e-03, dot -0.256; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -39.55146899785348, -6.526495686300066, -4.385942051130357, -3.3220719662023455
LBFGS Accumulation History: 3 points
Removed measurement 331c309b to history. Total: 3
th(0)=-39.55146899785348;dx=-1.2913786221265372E-5
Armijo: th(2010805.7106964262)=-35.389113242081166; dx=1.9080518980385106E-6 evalInputDelta=-4.162355755772317
New Minimum: -39.55146899785348 > -40.34903520786304
WOLF (strong): th(1005402.8553482131)=-40.34903520786304; dx=1.17439788631271E-6 evalInputDelta=0.7975662100095562
New Minimum: -40.34903520786304 > -41.478006818660596
END: th(335134.28511607106)=-41.478006818660596; dx=-4.440449151111972E-6 evalInputDelta=1.9265378208071127
Fitness changed from -39.55146899785348 to -41.478006818660596
Iteration 13 complete. Error: -41.478006818660596 Total: 4.7839; Orientation: 0.2840; Line Search: 3.6203
Adding measurement 20b5e5a4 to history. Total: 3
Accepted: LBFGS Orientation magnitude: 1.023e+05, gradient 2.854e-03, dot 0.406; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Constructing line search parameters: LBFGS+Trust
th(0)=-41.478006818660596;dx=-118.94499851790809
Armijo: th(722024.9296730995)=-13.958717012973285; dx=1.4509560415242159E-5 evalInputDelta=-27.51928980568731
Armijo: th(361012.46483654977)=-13.958765495656552; dx=2.8869766189729064E-5 evalInputDelta=-27.519241323004046
Armijo: th(120337.48827884992)=-13.958827108823558; dx=8.66525888347951E-5 evalInputDelta=-27.51917970983704
Armijo: th(30084.37206971248)=-13.956202247913263; dx=3.4509910353074146E-4 evalInputDelta=-27.521804570747335
Armijo: th(6016.874413942496)=-13.953445536746692; dx=0.0017275243107030274 evalInputDelta=-27.524561281913904
Armijo: th(1002.8124023237493)=-13.964888111195933; dx=0.01041658143122975 evalInputDelta=-27.513118707464663
Armijo: th(143.25891461767847)=-14.051298928024938; dx=0.0746836094296684 evalInputDelta=-27.426707890635658
Armijo: th(17.90736432720981)=-14.631500273533842; dx=0.6320096888091603 evalInputDelta=-26.846506545126754
Armijo: th(1.9897071474677566)=-19.090714202092844; dx=6.318779339617439 evalInputDelta=-22.387292616567752
Armijo: th(0.19897071474677566)=-35.543995095707565; dx=18.73072547150039 evalInputDelta=-5.934011722953031
New Minimum: -41.478006818660596 > -42.23513107532309
END: th(0.018088246795161425)=-42.23513107532309; dx=-40.544157686476495 evalInputDelta=0.7571242566624932
Fitness changed from -41.478006818660596 to -42.23513107532309
Iteration 14 complete. Error: -42.23513107532309 Total: 12.3806; Orientation: 0.2838; Line Search: 11.2685
Adding measurement 69ea6ed5 to history. Total: 4
Rejected: LBFGS Orientation magnitude: 1.529e+06, gradient 3.064e-03, dot -0.231; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -42.23513107532309, -41.478006818660596, -6.526495686300066, -4.385942051130357, -3.3220719662023455
Rejected: LBFGS Orientation magnitude: 1.454e+06, gradient 3.064e-03, dot -0.306; [90916eba-006f-4032-ac17-29d98535eb00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -42.23513107532309, -41.478006818660596, -6.526495686300066, -4.385942051130357
LBFGS Accumulation History: 3 points
Removed measurement 69ea6ed5 to history. Total: 4
Removed measurement 20b5e5a4 to history. Total: 3
th(0)=-42.23513107532309;dx=-9.297288005011786E-6
Armijo: th(0.03896994637735382)=-42.23512974002625; dx=-5.863263998845918E-6 evalInputDelta=-1.3352968366575624E-6
Armijo: th(0.01948497318867691)=-42.23512974002625; dx=-5.867061062055413E-6 evalInputDelta=-1.3352968366575624E-6
Armijo: th(0.006494991062892304)=-42.23512706943246; dx=-5.827922369833343E-6 evalInputDelta=-4.005890630764952E-6
Armijo: th(0.001623747765723076)=-42.23512974002625; dx=-5.822036592115024E-6 evalInputDelta=-1.3352968366575624E-6
Armijo: th(3.2474955314461517E-4)=-42.23512974002625; dx=-5.857458163109763E-6 evalInputDelta=-1.3352968366575624E-6
Armijo: th(5.4124925524102526E-5)=-42.23512974002625; dx=-5.852133001845197E-6 evalInputDelta=-1.3352968366575624E-6
END: th(7.732132217728932E-6)=-42.23513107532309; dx=-5.860371398762841E-6 evalInputDelta=0.0
Fitness changed from -42.23513107532309 to -42.23513107532309
Static Iteration Total: 8.8494; Orientation: 0.7395; Line Search: 7.1533
Iteration 15 failed. Error: -42.23513107532309
Previous Error: 0.0 -> -42.23513107532309
Retrying iteration 15
Final threshold in iteration 15: -42.23513107532309 (> -Infinity) after 77.500s (< 5400.000s)
Returns
-42.23513107532309