BasicOptimizer.scala:89 executed in 6.86 seconds (0.323 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: 137294781867100
Reset training subject: 137295115873200
Adding measurement 241b971f to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-0.5917154152552577;dx=-2.2822570794847032E-5
New Minimum: -0.5917154152552577 > -0.5917872221675728
WOLFE (weak): th(2.154434690031884)=-0.5917872221675728; dx=-2.227715426587483E-5 evalInputDelta=7.180691231511993E-5
New Minimum: -0.5917872221675728 > -0.5918584938068973
WOLFE (weak): th(4.308869380063768)=-0.5918584938068973; dx=-2.17887532311981E-5 evalInputDelta=1.4307855163953054E-4
New Minimum: -0.5918584938068973 > -0.5921444564523618
WOLFE (weak): th(12.926608140191302)=-0.5921444564523618; dx=-2.204000491466956E-5 evalInputDelta=4.290411971040742E-4
New Minimum: -0.5921444564523618 > -0.5934351154230608
WOLFE (weak): th(51.70643256076521)=-0.5934351154230608; dx=-2.2837987525132128E-5 evalInputDelta=0.0017197001678030954
New Minimum: -0.5934351154230608 > -0.6003317829027958
WOLFE (weak): th(258.53216280382605)=-0.6003317829027958; dx=-2.1717260160680307E-5 evalInputDelta=0.008616367647538037
New Minimum: -0.6003317829027958 > -0.6441554724489195
WOLFE (weak): th(1551.1929768229563)=-0.6441554724489195; dx=-2.304214449908355E-5 evalInputDelta=0.05244005719366174
New Minimum: -0.6441554724489195 > -0.9727544238819377
WOLFE (weak): th(10858.350837760694)=-0.9727544238819377; dx=-2.435648170419872E-5 evalInputDelta=0.38103900862667994
New Minimum: -0.9727544238819377 > -2.081002349873566
END: th(86866.80670208555)=-2.081002349873566; dx=-4.3404084330556005E-6 evalInputDelta=1.4892869346183082
Fitness changed from -0.5917154152552577 to -2.081002349873566
Iteration 1 complete. Error: -2.081002349873566 Total: 1.9740; Orientation: 0.0257; Line Search: 1.2740
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>
Adding measurement 5d3f8661 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-2.081002349873566;dx=-3.8413508313676794E-5
New Minimum: -2.081002349873566 > -3.487238033773166
END: th(187148.86177126726)=-3.487238033773166; dx=-5.327852505903775E-7 evalInputDelta=1.4062356838996002
Fitness changed from -2.081002349873566 to -3.487238033773166
Iteration 2 complete. Error: -3.487238033773166 Total: 0.4401; Orientation: 0.0037; Line Search: 0.2741
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>
Adding measurement 3791af to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-3.487238033773166;dx=-5.5606491645025305E-5
New Minimum: -3.487238033773166 > -4.3958300630079075
WOLF (strong): th(403200.00000000006)=-4.3958300630079075; dx=6.66188294379309E-7 evalInputDelta=0.9085920292347414
New Minimum: -4.3958300630079075 > -6.077121073882001
WOLF (strong): th(201600.00000000003)=-6.077121073882001; dx=1.8040801279832437E-7 evalInputDelta=2.589883040108835
New Minimum: -6.077121073882001 > -6.202754002188086
END: th(67200.00000000001)=-6.202754002188086; dx=-1.2680062367691483E-5 evalInputDelta=2.7155159684149197
Fitness changed from -3.487238033773166 to -6.202754002188086
Iteration 3 complete. Error: -6.202754002188086 Total: 0.6516; Orientation: 0.0019; Line Search: 0.5118
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>
Adding measurement 3ffe74da to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.827e+03, gradient 6.224e-03, dot -0.344; [a88f7d65-baec-42f4-83cf-b8ed791e8f00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -6.202754002188086, -3.487238033773166, -2.081002349873566, -0.5917154152552577
LBFGS Accumulation History: 3 points
Removed measurement 3ffe74da to history. Total: 3
th(0)=-6.202754002188086;dx=-3.438984140142745E-5
New Minimum: -6.202754002188086 > -6.975636456913451
END: th(144778.01117014262)=-6.975636456913451; dx=-1.1658520265698871E-6 evalInputDelta=0.772882454725365
Fitness changed from -6.202754002188086 to -6.975636456913451
Iteration 4 complete. Error: -6.975636456913451 Total: 0.4416; Orientation: 0.0642; Line Search: 0.2412
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>
Adding measurement 45cddfd3 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.004e+03, gradient 7.288e-03, dot -0.318; [a88f7d65-baec-42f4-83cf-b8ed791e8f00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -6.975636456913451, -3.487238033773166, -2.081002349873566, -0.5917154152552577
LBFGS Accumulation History: 3 points
Removed measurement 45cddfd3 to history. Total: 3
th(0)=-6.975636456913451;dx=-4.542619593781813E-5
New Minimum: -6.975636456913451 > -8.050728129084167
WOLF (strong): th(311914.76961877884)=-8.050728129084167; dx=3.04924157305668E-6 evalInputDelta=1.075091672170716
New Minimum: -8.050728129084167 > -9.96589086449376
WOLF (strong): th(155957.38480938942)=-9.96589086449376; dx=8.354221438439944E-7 evalInputDelta=2.9902544075803092
END: th(51985.79493646314)=-9.596364742371584; dx=-1.9235056795676775E-5 evalInputDelta=2.6207282854581333
Fitness changed from -6.975636456913451 to -9.96589086449376
Iteration 5 complete. Error: -9.96589086449376 Total: 0.6227; Orientation: 0.0341; Line Search: 0.4607
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>
Adding measurement 3524ee20 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.222e+03, gradient 6.303e-03, dot -0.298; [a88f7d65-baec-42f4-83cf-b8ed791e8f00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -9.96589086449376, -3.487238033773166, -2.081002349873566, -0.5917154152552577
LBFGS Accumulation History: 3 points
Removed measurement 3524ee20 to history. Total: 3
th(0)=-9.96589086449376;dx=-3.5540099294250524E-5
New Minimum: -9.96589086449376 > -12.588443326825113
END: th(112000.00000000004)=-12.588443326825113; dx=-8.938771476633453E-6 evalInputDelta=2.6225524623313525
Fitness changed from -9.96589086449376 to -12.588443326825113
Iteration 6 complete. Error: -12.588443326825113 Total: 0.7236; Orientation: 0.0307; Line Search: 0.5687
Adding measurement 25d5327 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 4.752e+03, gradient 5.863e-03, dot -0.327; [a88f7d65-baec-42f4-83cf-b8ed791e8f00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -12.588443326825113, -3.487238033773166, -2.081002349873566, -0.5917154152552577
LBFGS Accumulation History: 3 points
Removed measurement 25d5327 to history. Total: 3
th(0)=-12.588443326825113;dx=-3.055752421557866E-5
New Minimum: -12.588443326825113 > -13.073537503525012
WOLF (strong): th(241296.68528357107)=-13.073537503525012; dx=1.7089200603643527E-6 evalInputDelta=0.4850941766998993
New Minimum: -13.073537503525012 > -14.279298230221947
END: th(120648.34264178554)=-14.279298230221947; dx=-6.757869274005055E-6 evalInputDelta=1.6908549033968345
Fitness changed from -12.588443326825113 to -14.279298230221947
Iteration 7 complete. Error: -14.279298230221947 Total: 0.4836; Orientation: 0.0336; Line Search: 0.3376
Adding measurement 5df17e60 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.431e+03, gradient 5.733e-03, dot -0.387; [a88f7d65-baec-42f4-83cf-b8ed791e8f00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -14.279298230221947, -3.487238033773166, -2.081002349873566, -0.5917154152552577
LBFGS Accumulation History: 3 points
Removed measurement 5df17e60 to history. Total: 3
th(0)=-14.279298230221947;dx=-2.951841330253118E-5
New Minimum: -14.279298230221947 > -14.343164748541335
WOLF (strong): th(259928.97468231575)=-14.343164748541335; dx=2.287696698846356E-6 evalInputDelta=0.06386651831938828
New Minimum: -14.343164748541335 > -15.674974060021434
END: th(129964.48734115787)=-15.674974060021434; dx=-2.746920980115715E-6 evalInputDelta=1.3956758297994867
Fitness changed from -14.279298230221947 to -15.674974060021434
Iteration 8 complete. Error: -15.674974060021434 Total: 0.5220; Orientation: 0.0358; Line Search: 0.3795
Adding measurement 138c2ba to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.189e+03, gradient 5.643e-03, dot -0.381; [a88f7d65-baec-42f4-83cf-b8ed791e8f00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -15.674974060021434, -3.487238033773166, -2.081002349873566, -0.5917154152552577
LBFGS Accumulation History: 3 points
Removed measurement 138c2ba to history. Total: 3
th(0)=-15.674974060021434;dx=-2.8602945001718535E-5
Armijo: th(280000.0000000002)=-14.573424862186876; dx=4.462736741207453E-6 evalInputDelta=-1.101549197834558
New Minimum: -15.674974060021434 > -16.63777796898284
WOLF (strong): th(140000.0000000001)=-16.63777796898284; dx=1.0013324575710562E-6 evalInputDelta=0.9628039089614049
END: th(46666.66666666669)=-16.63665683429581; dx=-1.434675687376405E-5 evalInputDelta=0.9616827742743759
Fitness changed from -15.674974060021434 to -16.63777796898284
Iteration 9 complete. Error: -16.63777796898284 Total: 0.6041; Orientation: 0.0298; Line Search: 0.4630
Adding measurement 342cc706 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.569e+04, gradient 6.028e-03, dot -0.403; [a88f7d65-baec-42f4-83cf-b8ed791e8f00 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -16.63777796898284, -3.487238033773166, -2.081002349873566, -0.5917154152552577
LBFGS Accumulation History: 3 points
Removed measurement 342cc706 to history. Total: 3
th(0)=-16.63777796898284;dx=-3.226266157434073E-5
New Minimum: -16.63777796898284 > -18.11383974587859
END: th(100540.2855348213)=-18.11383974587859; dx=-5.196932967930634E-6 evalInputDelta=1.476061776895751
Fitness changed from -16.63777796898284 to -18.11383974587859
Iteration 10 complete. Error: -18.11383974587859 Total: 0.3688; Orientation: 0.0350; Line Search: 0.2225
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>
Final threshold in iteration 11: -18.11383974587859 (> -Infinity) after 6.844s (< 5400.000s)
Returns
-18.11383974587859