BasicOptimizer.scala:89 executed in 45.89 seconds (1.216 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: 209764078380800
Reset training subject: 209764995386300
Adding measurement 6ef4996b to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-10.01645657713858;dx=-0.09176940219426288
New Minimum: -10.01645657713858 > -10.155533289114217
WOLFE (weak): th(2.154434690031884)=-10.155533289114217; dx=-0.09225631897305797 evalInputDelta=0.13907671197563687
New Minimum: -10.155533289114217 > -10.294917689610429
WOLFE (weak): th(4.308869380063768)=-10.294917689610429; dx=-0.09258735484211117 evalInputDelta=0.2784611124718488
New Minimum: -10.294917689610429 > -10.859989210626065
WOLFE (weak): th(12.926608140191302)=-10.859989210626065; dx=-0.09362157287386677 evalInputDelta=0.8435326334874844
New Minimum: -10.859989210626065 > -13.524592121033432
WOLFE (weak): th(51.70643256076521)=-13.524592121033432; dx=-0.09856413064596567 evalInputDelta=3.508135543894852
New Minimum: -13.524592121033432 > -29.123357922879165
WOLFE (weak): th(258.53216280382605)=-29.123357922879165; dx=-0.09277627240043605 evalInputDelta=19.106901345740585
New Minimum: -29.123357922879165 > -99.58781062935455
END: th(1551.1929768229563)=-99.58781062935455; dx=-0.04142125896781655 evalInputDelta=89.57135405221597
Fitness changed from -10.01645657713858 to -99.58781062935455
Iteration 1 complete. Error: -99.58781062935455 Total: 7.5159; Orientation: 0.0154; Line Search: 5.1550
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/d9b7ee07-d136-448c-bc33-436e87060e3b.jpg)
Adding measurement 184129ef to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-99.58781062935455;dx=-0.11916628295453852
New Minimum: -99.58781062935455 > -272.0831300022838
END: th(3341.943960201201)=-272.0831300022838; dx=-0.03030374528438842 evalInputDelta=172.49531937292923
Fitness changed from -99.58781062935455 to -272.0831300022838
Iteration 2 complete. Error: -272.0831300022838 Total: 2.4356; Orientation: 0.0157; Line Search: 1.7195
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/fc197a15-cd76-425b-a088-a57226dce672.jpg)
Adding measurement 420bcfe8 to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-272.0831300022838;dx=-0.1322477728992632
New Minimum: -272.0831300022838 > -449.1013295205028
END: th(7200.000000000001)=-449.1013295205028; dx=-0.014374641000759612 evalInputDelta=177.01819951821903
Fitness changed from -272.0831300022838 to -449.1013295205028
Iteration 3 complete. Error: -449.1013295205028 Total: 2.3395; Orientation: 0.0158; Line Search: 1.5709
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>![Iteration 3](etc/be0176fc-a7a1-4872-a7f2-71d11917fbb2.jpg)
Adding measurement 31d9c148 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.042e+03, gradient 3.362e-01, dot -0.210; [51256892-e4d8-47ff-bcac-c2e7da15169b = 1.000/1.000e+00]
Orientation rejected. Popping history element from -449.1013295205028, -272.0831300022838, -99.58781062935455, -10.01645657713858
LBFGS Accumulation History: 3 points
Removed measurement 31d9c148 to history. Total: 3
th(0)=-449.1013295205028;dx=-0.1130184452282997
New Minimum: -449.1013295205028 > -645.8701433193828
END: th(15511.929768229566)=-645.8701433193828; dx=-0.009397492248468118 evalInputDelta=196.76881379888
Fitness changed from -449.1013295205028 to -645.8701433193828
Iteration 4 complete. Error: -645.8701433193828 Total: 2.5358; Orientation: 0.2949; Line Search: 1.4924
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>![Iteration 4](etc/58fe959e-0cd2-4de2-a8d3-4072daf181f5.jpg)
Adding measurement 2bfcc97f to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.566e+03, gradient 3.256e-01, dot -0.167; [51256892-e4d8-47ff-bcac-c2e7da15169b = 1.000/1.000e+00]
Orientation rejected. Popping history element from -645.8701433193828, -272.0831300022838, -99.58781062935455, -10.01645657713858
LBFGS Accumulation History: 3 points
Removed measurement 2bfcc97f to history. Total: 3
th(0)=-645.8701433193828;dx=-0.1059856891380305
New Minimum: -645.8701433193828 > -729.7229166509694
END: th(33419.43960201202)=-729.7229166509694; dx=-0.0024431205661846114 evalInputDelta=83.8527733315866
Fitness changed from -645.8701433193828 to -729.7229166509694
Iteration 5 complete. Error: -729.7229166509694 Total: 3.1521; Orientation: 0.2970; Line Search: 2.1449
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>![Iteration 5](etc/16e108c0-01b0-414c-ab82-9106d8f0d770.jpg)
Adding measurement 66147e6a to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.920e+03, gradient 3.041e-01, dot -0.123; [51256892-e4d8-47ff-bcac-c2e7da15169b = 1.000/1.000e+00]
Orientation rejected. Popping history element from -729.7229166509694, -272.0831300022838, -99.58781062935455, -10.01645657713858
LBFGS Accumulation History: 3 points
Removed measurement 66147e6a to history. Total: 3
th(0)=-729.7229166509694;dx=-0.09242184894428038
New Minimum: -729.7229166509694 > -793.6043015292015
END: th(72000.00000000003)=-793.6043015292015; dx=-2.0451864811988794E-4 evalInputDelta=63.8813848782321
Fitness changed from -729.7229166509694 to -793.6043015292015
Iteration 6 complete. Error: -793.6043015292015 Total: 2.4895; Orientation: 0.2907; Line Search: 1.5023
Adding measurement 58ff6f0e to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.037e+04, gradient 2.652e-01, dot -0.084; [51256892-e4d8-47ff-bcac-c2e7da15169b = 1.000/1.000e+00]
Orientation rejected. Popping history element from -793.6043015292015, -272.0831300022838, -99.58781062935455, -10.01645657713858
LBFGS Accumulation History: 3 points
Removed measurement 58ff6f0e to history. Total: 3
th(0)=-793.6043015292015;dx=-0.07033663972734085
Armijo: th(155119.2976822957)=-639.7131056390343; dx=8.071980190519047E-4 evalInputDelta=-153.89119589016718
New Minimum: -793.6043015292015 > -1174.57884930657
END: th(77559.64884114785)=-1174.57884930657; dx=-0.003022925357153189 evalInputDelta=380.97454777736846
Fitness changed from -793.6043015292015 to -1174.57884930657
Iteration 7 complete. Error: -1174.57884930657 Total: 3.1839; Orientation: 0.2896; Line Search: 2.2017
Adding measurement 6963f341 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.379e+04, gradient 2.362e-01, dot -0.101; [51256892-e4d8-47ff-bcac-c2e7da15169b = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1174.57884930657, -272.0831300022838, -99.58781062935455, -10.01645657713858
LBFGS Accumulation History: 3 points
Removed measurement 6963f341 to history. Total: 3
th(0)=-1174.57884930657;dx=-0.05576554770289441
Armijo: th(167097.19801006012)=-857.2712442561658; dx=4.983368472480574E-4 evalInputDelta=-317.30760505040416
New Minimum: -1174.57884930657 > -1503.5006122076695
END: th(83548.59900503006)=-1503.5006122076695; dx=-0.004083986149995035 evalInputDelta=328.92176290109956
Fitness changed from -1174.57884930657 to -1503.5006122076695
Iteration 8 complete. Error: -1503.5006122076695 Total: 3.6483; Orientation: 0.4121; Line Search: 2.4473
Adding measurement 35ec9001 to history. Total: 3
Accepted: LBFGS Orientation magnitude: 4.291e+04, gradient 2.481e-01, dot 0.133; [51256892-e4d8-47ff-bcac-c2e7da15169b = 1.000/1.000e+00]
Constructing line search parameters: LBFGS+Trust
th(0)=-1503.5006122076695;dx=-1422.451083373764
Armijo: th(180000.0000000001)=-391.4797561196905; dx=0.005638635867654987 evalInputDelta=-1112.0208560879792
Armijo: th(90000.00000000004)=-391.51136982339347; dx=0.011288902015818291 evalInputDelta=-1111.9892423842762
Armijo: th(30000.000000000015)=-391.58744218899903; dx=0.0338299041182257 evalInputDelta=-1111.9131700186704
Armijo: th(7500.000000000004)=-391.77071562297647; dx=0.13534432977850894 evalInputDelta=-1111.729896584693
Armijo: th(1500.0000000000007)=-393.67646899823615; dx=0.6735824265656878 evalInputDelta=-1109.8241432094333
Armijo: th(250.0000000000001)=-417.1790147985125; dx=3.857315019011147 evalInputDelta=-1086.321597409157
Armijo: th(35.71428571428573)=-508.6443245966832; dx=22.230743622846646 evalInputDelta=-994.8562876109863
Armijo: th(4.464285714285716)=-670.2346521484124; dx=106.58690071387429 evalInputDelta=-833.2659600592572
Armijo: th(0.49603174603174627)=-1214.0654736591846; dx=123.03287966063141 evalInputDelta=-289.43513854848493
Armijo: th(0.04960317460317463)=-1475.750042945566; dx=-142.49246058979872 evalInputDelta=-27.750569262103454
Armijo: th(0.004509379509379512)=-1501.076374341627; dx=-207.10975789810897 evalInputDelta=-2.424237866042631
Armijo: th(3.7578162578162595E-4)=-1503.3017136605026; dx=-219.20272293255806 evalInputDelta=-0.19889854716689115
Armijo: th(2.890627890627892E-5)=-1503.4852162429813; dx=-219.6060239705952 evalInputDelta=-0.015395964688195818
Armijo: th(2.0647342075913514E-6)=-1503.4995525074808; dx=-219.77477142218373 evalInputDelta=-0.0010597001887617807
Armijo: th(1.3764894717275675E-7)=-1503.5004546644927; dx=-218.47929241127048 evalInputDelta=-1.5754317678329244E-4
Armijo: th(8.603059198297297E-9)=-1503.5005628721933; dx=-219.57981510746143 evalInputDelta=-4.933547620566969E-5
Armijo: th(5.060623057821939E-10)=-1503.5006122076695; dx=-219.26364545014354 evalInputDelta=0.0
MIN ALPHA (2.8114572543455216E-11): th(0.0)=-1503.5006122076695
Fitness changed from -1503.5006122076695 to -1503.5006122076695
Static Iteration Total: 15.6443; Orientation: 0.2799; Line Search: 14.6398
Iteration 9 failed. Error: -1503.5006122076695
Previous Error: 0.0 -> -1503.5006122076695
Retrying iteration 9
Reset training subject: 209807023435300
Adding measurement 4bf5d098 to history. Total: 0
LBFGS Accumulation History: 1 points
th(0)=-1503.5006122076695;dx=-0.06151312211758771
END: th(2.1544346900318838E-10)=-1503.5006122076695; dx=-0.03894910937962773 evalInputDelta=0.0
Fitness changed from -1503.5006122076695 to -1503.5006122076695
Static Iteration Total: 2.9400; Orientation: 0.0151; Line Search: 1.4909
Iteration 10 failed. Error: -1503.5006122076695
Previous Error: 0.0 -> -1503.5006122076695
Optimization terminated 10
Final threshold in iteration 10: -1503.5006122076695 (> -Infinity) after 45.885s (< 5400.000s)
Returns
-1503.5006122076695