BasicOptimizer.scala:89 executed in 136.32 seconds (2.001 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: 1961155446869
Reset training subject: 1962273606776
Adding measurement 539aa44c to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-7.530673392623436;dx=-7.645340938856766E-4
New Minimum: -7.530673392623436 > -7.532330111797272
WOLFE (weak): th(2.154434690031884)=-7.532330111797272; dx=-7.637845020078962E-4 evalInputDelta=0.0016567191738356968
New Minimum: -7.532330111797272 > -7.533986219026053
WOLFE (weak): th(4.308869380063768)=-7.533986219026053; dx=-7.625276656880877E-4 evalInputDelta=0.003312826402616764
New Minimum: -7.533986219026053 > -7.540625566896032
WOLFE (weak): th(12.926608140191302)=-7.540625566896032; dx=-7.625668524617173E-4 evalInputDelta=0.009952174272595649
New Minimum: -7.540625566896032 > -7.570508574065727
WOLFE (weak): th(51.70643256076521)=-7.570508574065727; dx=-7.565782880626837E-4 evalInputDelta=0.03983518144229059
New Minimum: -7.570508574065727 > -7.729170450520875
WOLFE (weak): th(258.53216280382605)=-7.729170450520875; dx=-7.453207949439263E-4 evalInputDelta=0.19849705789743854
New Minimum: -7.729170450520875 > -8.632913901538116
END: th(1551.1929768229563)=-8.632913901538116; dx=-6.060583399804368E-4 evalInputDelta=1.1022405089146794
Fitness changed from -7.530673392623436 to -8.632913901538116
Iteration 1 complete. Error: -8.632913901538116 Total: 11.0130; Orientation: 0.0209; Line Search: 7.7634
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>
Adding measurement 10a46347 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-8.632913901538116;dx=-7.595175697339563E-4
New Minimum: -8.632913901538116 > -10.723661487873873
END: th(3341.943960201201)=-10.723661487873873; dx=-4.4907820875581407E-4 evalInputDelta=2.090747586335757
Fitness changed from -8.632913901538116 to -10.723661487873873
Iteration 2 complete. Error: -10.723661487873873 Total: 3.3163; Orientation: 0.0186; Line Search: 2.2018
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>
Adding measurement 6f65d4dc to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-10.723661487873873;dx=-0.0010534170038306186
New Minimum: -10.723661487873873 > -14.649870899624204
END: th(7200.000000000001)=-14.649870899624204; dx=-3.224968839500884E-4 evalInputDelta=3.9262094117503317
Fitness changed from -10.723661487873873 to -14.649870899624204
Iteration 3 complete. Error: -14.649870899624204 Total: 3.3127; Orientation: 0.0183; Line Search: 2.2251
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>
Adding measurement 69ae933c to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.056e+03, gradient 5.071e-02, dot -0.236; [74e706e5-e155-4f02-8450-c4103fe60bb6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -14.649870899624204, -10.723661487873873, -8.632913901538116, -7.530673392623436
LBFGS Accumulation History: 3 points
Removed measurement 69ae933c to history. Total: 3
th(0)=-14.649870899624204;dx=-0.0025697051755469657
New Minimum: -14.649870899624204 > -25.6689541515149
END: th(15511.929768229566)=-25.6689541515149; dx=-1.1741262733616413E-4 evalInputDelta=11.019083251890695
Fitness changed from -14.649870899624204 to -25.6689541515149
Iteration 4 complete. Error: -25.6689541515149 Total: 3.7362; Orientation: 0.4513; Line Search: 2.2042
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>
Adding measurement 4e6b6ccd to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.234e+03, gradient 8.575e-02, dot -0.095; [74e706e5-e155-4f02-8450-c4103fe60bb6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -25.6689541515149, -10.723661487873873, -8.632913901538116, -7.530673392623436
LBFGS Accumulation History: 3 points
Removed measurement 4e6b6ccd to history. Total: 3
th(0)=-25.6689541515149;dx=-0.007351551563415595
New Minimum: -25.6689541515149 > -34.515860333103404
END: th(33419.43960201202)=-34.515860333103404; dx=-9.074809260966379E-5 evalInputDelta=8.846906181588505
Fitness changed from -25.6689541515149 to -34.515860333103404
Iteration 5 complete. Error: -34.515860333103404 Total: 3.7488; Orientation: 0.4565; Line Search: 2.2127
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>
Adding measurement 136c7e69 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.374e+03, gradient 1.001e-01, dot -0.048; [74e706e5-e155-4f02-8450-c4103fe60bb6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -34.515860333103404, -10.723661487873873, -8.632913901538116, -7.530673392623436
LBFGS Accumulation History: 3 points
Removed measurement 136c7e69 to history. Total: 3
th(0)=-34.515860333103404;dx=-0.010023358388278964
New Minimum: -34.515860333103404 > -45.61136293651465
WOLF (strong): th(72000.00000000003)=-45.61136293651465; dx=2.2721580490281737E-4 evalInputDelta=11.095502603411248
New Minimum: -45.61136293651465 > -63.85316905614008
WOLF (strong): th(36000.000000000015)=-63.85316905614008; dx=1.1572377914806169E-4 evalInputDelta=29.337308723036678
New Minimum: -63.85316905614008 > -76.66280598839343
END: th(12000.000000000005)=-76.66280598839343; dx=-7.445480310559261E-4 evalInputDelta=42.146945655290025
Fitness changed from -34.515860333103404 to -76.66280598839343
Iteration 6 complete. Error: -76.66280598839343 Total: 6.0881; Orientation: 0.4516; Line Search: 4.5586
Adding measurement 2ba6990d to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.292e+05, gradient 1.171e-01, dot -0.041; [74e706e5-e155-4f02-8450-c4103fe60bb6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -76.66280598839343, -10.723661487873873, -8.632913901538116, -7.530673392623436
LBFGS Accumulation History: 3 points
Removed measurement 2ba6990d to history. Total: 3
th(0)=-76.66280598839343;dx=-0.013714781680005445
New Minimum: -76.66280598839343 > -98.0333806343486
WOLF (strong): th(25853.216280382618)=-98.0333806343486; dx=3.470819433748346E-4 evalInputDelta=21.370574645955173
New Minimum: -98.0333806343486 > -114.46196248917535
END: th(12926.608140191309)=-114.46196248917535; dx=-5.862643804982257E-4 evalInputDelta=37.79915650078192
Fitness changed from -76.66280598839343 to -114.46196248917535
Iteration 7 complete. Error: -114.46196248917535 Total: 4.8661; Orientation: 0.4403; Line Search: 3.3717
Adding measurement 6e2db71f to history. Total: 3
Accepted: LBFGS Orientation magnitude: 4.781e+03, gradient 1.276e-01, dot 0.101; [74e706e5-e155-4f02-8450-c4103fe60bb6 = 1.000/1.000e+00]
Constructing line search parameters: LBFGS+Trust
th(0)=-114.46196248917535;dx=-61.87603816951451
Armijo: th(27849.53300167669)=-18.760624049758285; dx=9.210728427953746E-4 evalInputDelta=-95.70133843941707
Armijo: th(13924.766500838345)=-18.67401438382594; dx=0.0018516789176344737 evalInputDelta=-95.78794810534941
Armijo: th(4641.588833612782)=-18.751816643552498; dx=0.005598173081885566 evalInputDelta=-95.71014584562285
Armijo: th(1160.3972084031955)=-19.06042404786966; dx=0.023193753323154015 evalInputDelta=-95.40153844130569
Armijo: th(232.0794416806391)=-20.21441974311554; dx=0.1102642262805642 evalInputDelta=-94.2475427460598
Armijo: th(38.67990694677318)=-25.3423112192814; dx=0.6492138159811374 evalInputDelta=-89.11965126989395
Armijo: th(5.525700992396168)=-59.02033970554413; dx=6.643419649041421 evalInputDelta=-55.44162278363122
New Minimum: -114.46196248917535 > -128.40042764619605
END: th(0.690712624049521)=-128.40042764619605; dx=-10.249657982141208 evalInputDelta=13.938465157020701
Fitness changed from -114.46196248917535 to -128.40042764619605
Iteration 8 complete. Error: -128.40042764619605 Total: 11.6807; Orientation: 0.5268; Line Search: 10.0962
Adding measurement 328c8af3 to history. Total: 4
Rejected: LBFGS Orientation magnitude: 1.359e+03, gradient 1.212e-01, dot -0.090; [74e706e5-e155-4f02-8450-c4103fe60bb6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -128.40042764619605, -114.46196248917535, -10.723
...skipping 2971 bytes...
to history. Total: 3
th(0)=-163.7031452124109;dx=-0.011814852364155928
New Minimum: -163.7031452124109 > -199.53241707920355
END: th(4973.130893156552)=-199.53241707920355; dx=-0.007006872569115279 evalInputDelta=35.82927186679265
Fitness changed from -163.7031452124109 to -199.53241707920355
Iteration 11 complete. Error: -199.53241707920355 Total: 3.8652; Orientation: 0.5400; Line Search: 2.2413
Adding measurement 7e189e6f to history. Total: 3
Accepted: LBFGS Orientation magnitude: 1.510e+04, gradient 1.076e-01, dot 0.110; [74e706e5-e155-4f02-8450-c4103fe60bb6 = 1.000/1.000e+00]
th(0)=-199.53241707920355;dx=-179.5800345486157
Armijo: th(10714.285714285721)=-19.4127693653492; dx=0.0024890248876965073 evalInputDelta=-180.11964771385436
Armijo: th(5357.1428571428605)=-19.418820740936876; dx=0.004982472363891501 evalInputDelta=-180.1135963382667
Armijo: th(1785.714285714287)=-19.264498725623376; dx=0.015011347857232883 evalInputDelta=-180.26791835358017
Armijo: th(446.42857142857173)=-19.220399341786568; dx=0.05866757254050314 evalInputDelta=-180.312017737417
Armijo: th(89.28571428571435)=-19.92376031547862; dx=0.2830880356231154 evalInputDelta=-179.60865676372492
Armijo: th(14.880952380952392)=-30.082429324960792; dx=1.740649289564539 evalInputDelta=-169.44998775424276
Armijo: th(2.125850340136056)=-98.10865700998494; dx=24.394791559856124 evalInputDelta=-101.42376006921862
New Minimum: -199.53241707920355 > -207.73005796628493
END: th(0.265731292517007)=-207.73005796628493; dx=-36.93757191923851 evalInputDelta=8.197640887081377
Fitness changed from -199.53241707920355 to -207.73005796628493
Iteration 12 complete. Error: -207.73005796628493 Total: 11.9726; Orientation: 0.5376; Line Search: 10.3235
Adding measurement 1605bb3d to history. Total: 4
Accepted: LBFGS Orientation magnitude: 5.888e+03, gradient 1.152e-01, dot 0.050; [74e706e5-e155-4f02-8450-c4103fe60bb6 = 1.000/1.000e+00]
th(0)=-207.73005796628493;dx=-34.00594921118649
Armijo: th(0.5725007148256498)=-189.01449574596322; dx=6.9510440785738075 evalInputDelta=-18.715562220321715
Armijo: th(0.2862503574128249)=-198.97689133659017; dx=3.611925033665148 evalInputDelta=-8.75316662969476
Armijo: th(0.09541678580427497)=-204.98696513262172; dx=-0.10017540853211226 evalInputDelta=-2.743092833663212
Armijo: th(0.023854196451068743)=-207.06074314054547; dx=-0.17884281432347127 evalInputDelta=-0.6693148257394625
Armijo: th(0.004770839290213749)=-207.59851185097992; dx=-0.7453382530915613 evalInputDelta=-0.1315461153050137
Armijo: th(7.951398817022914E-4)=-207.70824210718249; dx=-1.0199190016985074 evalInputDelta=-0.02181585910244621
Armijo: th(1.1359141167175592E-4)=-207.7269678321068; dx=-1.0182263951979502 evalInputDelta=-0.003090134178137305
Armijo: th(1.419892645896949E-5)=-207.7296349149169; dx=-1.1718744185042143 evalInputDelta=-4.230513680454351E-4
Armijo: th(1.5776584954410543E-6)=-207.73001198248232; dx=-1.1292487545374104 evalInputDelta=-4.598380260745216E-5
Armijo: th(1.5776584954410542E-7)=-207.73005796628493; dx=-1.1301180950557015 evalInputDelta=0.0
Armijo: th(1.4342349958555038E-8)=-207.73005796628493; dx=-1.0906738828424745 evalInputDelta=0.0
New Minimum: -207.73005796628493 > -207.73006716304425
END: th(1.1951958298795865E-9)=-207.73006716304425; dx=-1.0777665611026492 evalInputDelta=9.196759322094294E-6
Fitness changed from -207.73005796628493 to -207.73006716304425
Iteration 13 complete. Error: -207.73006716304425 Total: 16.1035; Orientation: 0.5396; Line Search: 14.4963
Adding measurement 5f09a133 to history. Total: 5
Rejected: LBFGS Orientation magnitude: 1.636e+06, gradient 1.153e-01, dot -0.025; [74e706e5-e155-4f02-8450-c4103fe60bb6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -207.73006716304425, -207.73005796628493, -199.53241707920355, -10.723661487873873, -8.632913901538116, -7.530673392623436
Rejected: LBFGS Orientation magnitude: 2.341e+06, gradient 1.153e-01, dot -0.025; [74e706e5-e155-4f02-8450-c4103fe60bb6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -207.73006716304425, -207.73005796628493, -199.53241707920355, -10.723661487873873, -8.632913901538116
Accepted: LBFGS Orientation magnitude: 3.599e+06, gradient 1.153e-01, dot 0.022; [74e706e5-e155-4f02-8450-c4103fe60bb6 = 1.000/1.000e+00]
Overwriting history with 4 points
th(0)=-207.73006716304425;dx=-9231.281555271136
Armijo: th(2.5749713572740272E-9)=-207.7300027857206; dx=5820.753538653393 evalInputDelta=-6.437732366748605E-5
Armijo: th(1.2874856786370136E-9)=-207.73003037600458; dx=5823.43949662143 evalInputDelta=-3.678703967580077E-5
Armijo: th(4.2916189287900454E-10)=-207.73004876952524; dx=5793.244818900914 evalInputDelta=-1.839351901367081E-5
Armijo: th(1.0729047321975113E-10)=-207.73004876952524; dx=5806.988847458229 evalInputDelta=-1.839351901367081E-5
MIN ALPHA (2.1458094643950227E-11): th(0.0)=-207.73006716304425
Fitness changed from -207.73006716304425 to -207.73006716304425
Static Iteration Total: 9.5077; Orientation: 1.7554; Line Search: 6.7038
Iteration 14 failed. Error: -207.73006716304425
Previous Error: 0.0 -> -207.73006716304425
Retrying iteration 14
Reset training subject: 2065222816873
Adding measurement 30b14084 to history. Total: 0
LBFGS Accumulation History: 1 points
th(0)=-207.73006716304425;dx=-0.013245820257955579
WOLFE (weak): th(2.1544346900318838E-10)=-207.73006716304425; dx=-0.012507809188257724 evalInputDelta=0.0
WOLFE (weak): th(4.3088693800637676E-10)=-207.73006716304425; dx=-0.012509059273075678 evalInputDelta=0.0
WOLFE (weak): th(1.2926608140191302E-9)=-207.73006716304425; dx=-0.012514344744089315 evalInputDelta=0.0
WOLFE (weak): th(5.170643256076521E-9)=-207.73006716304425; dx=-0.012507111007692567 evalInputDelta=0.0
WOLFE (weak): th(2.5853216280382606E-8)=-207.73006716304425; dx=-0.01251196523661296 evalInputDelta=0.0
WOLFE (weak): th(1.5511929768229565E-7)=-207.73006716304425; dx=-0.012513982233214534 evalInputDelta=0.0
Armijo: th(1.0858350837760695E-6)=-207.73006716304425; dx=-0.012513018718194342 evalInputDelta=0.0
WOLFE (weak): th(6.204771907291826E-7)=-207.73006716304425; dx=-0.012514340178370952 evalInputDelta=0.0
WOLFE (weak): th(8.531561372526261E-7)=-207.73006716304425; dx=-0.012516322396075249 evalInputDelta=0.0
WOLFE (weak): th(9.694956105143478E-7)=-207.73006716304425; dx=-0.0125099545670301 evalInputDelta=0.0
WOLFE (weak): th(1.0276653471452087E-6)=-207.73006716304425; dx=-0.012510384805967119 evalInputDelta=0.0
WOLFE (weak): th(1.056750215460639E-6)=-207.73006716304425; dx=-0.012514558712951311 evalInputDelta=0.0
WOLFE (weak): th(1.0712926496183543E-6)=-207.73006716304425; dx=-0.012510935990320245 evalInputDelta=0.0
Armijo: th(1.078563866697212E-6)=-207.73006716304425; dx=-0.012516799242105353 evalInputDelta=0.0
Armijo: th(1.074928258157783E-6)=-207.73006716304425; dx=-0.012509845015873149 evalInputDelta=0.0
Armijo: th(1.0731104538880688E-6)=-207.73006716304425; dx=-0.01251567303428326 evalInputDelta=0.0
WOLFE (weak): th(1.0722015517532117E-6)=-207.73006716304425; dx=-0.01251270398951329 evalInputDelta=0.0
WOLFE (weak): th(1.0726560028206402E-6)=-207.73006716304425; dx=-0.01251062244755569 evalInputDelta=0.0
Armijo: th(1.0728832283543546E-6)=-207.73006716304425; dx=-0.012511722933144676 evalInputDelta=0.0
WOLFE (weak): th(1.0727696155874975E-6)=-207.73006716304425; dx=-0.012519253690610233 evalInputDelta=0.0
WOLFE (weak): th(1.072826421970926E-6)=-207.73006716304425; dx=-0.01251532240170822 evalInputDelta=0.0
WOLFE (weak): th(1.0728548251626403E-6)=-207.73006716304425; dx=-0.012516535756061748 evalInputDelta=0.0
Armijo: th(1.0728690267584975E-6)=-207.73006716304425; dx=-0.012515026645844782 evalInputDelta=0.0
Armijo: th(1.072861925960569E-6)=-207.73006716304425; dx=-0.01251452733189218 evalInputDelta=0.0
mu ~= nu (1.0728548251626403E-6): th(0.0)=-207.73006716304425
Fitness changed from -207.73006716304425 to -207.73006716304425
Static Iteration Total: 32.2542; Orientation: 0.0192; Line Search: 30.1318
Iteration 15 failed. Error: -207.73006716304425
Previous Error: 0.0 -> -207.73006716304425
Optimization terminated 15
Final threshold in iteration 15: -207.73006716304425 (> -Infinity) after 136.322s (< 3600.000s)
Returns
-207.73006716304425