BasicOptimizer.scala:89 executed in 36.85 seconds (0.865 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: 216198656194000
Reset training subject: 216199274412600
Adding measurement 76ef4a0f to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-140.8317883376227;dx=-0.10689987972614143
New Minimum: -140.8317883376227 > -140.9836016258818
WOLFE (weak): th(2.154434690031884)=-140.9836016258818; dx=-0.1069303194845514 evalInputDelta=0.1518132882590919
New Minimum: -140.9836016258818 > -141.13535757904415
WOLFE (weak): th(4.308869380063768)=-141.13535757904415; dx=-0.1068372434292911 evalInputDelta=0.3035692414214566
New Minimum: -141.13535757904415 > -141.74116789067145
WOLFE (weak): th(12.926608140191302)=-141.74116789067145; dx=-0.10654855923796662 evalInputDelta=0.9093795530487512
New Minimum: -141.74116789067145 > -144.46466687479193
WOLFE (weak): th(51.70643256076521)=-144.46466687479193; dx=-0.10562947200695644 evalInputDelta=3.6328785371692334
New Minimum: -144.46466687479193 > -158.98413162883486
WOLFE (weak): th(258.53216280382605)=-158.98413162883486; dx=-0.10118257950543877 evalInputDelta=18.152343291212162
New Minimum: -158.98413162883486 > -227.78497125466095
END: th(1551.1929768229563)=-227.78497125466095; dx=-0.06193756823337375 evalInputDelta=86.95318291703825
Fitness changed from -140.8317883376227 to -227.78497125466095
Iteration 1 complete. Error: -227.78497125466095 Total: 6.2565; Orientation: 0.0162; Line Search: 4.5303
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/a8755f42-beff-45aa-83eb-a2d95a2c7e7f.jpg)
Adding measurement 6ff64f00 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-227.78497125466095;dx=-0.10028442189786677
New Minimum: -227.78497125466095 > -361.98536756282147
END: th(3341.943960201201)=-361.98536756282147; dx=-0.03687073827689339 evalInputDelta=134.20039630816052
Fitness changed from -227.78497125466095 to -361.98536756282147
Iteration 2 complete. Error: -361.98536756282147 Total: 1.8597; Orientation: 0.0248; Line Search: 1.2236
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/850ffb41-e641-4295-b148-4ba12037931a.jpg)
Adding measurement 401ceaee to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-361.98536756282147;dx=-0.11685813870803943
New Minimum: -361.98536756282147 > -536.11807502134
END: th(7200.000000000001)=-536.11807502134; dx=-0.024975909979149565 evalInputDelta=174.13270745851855
Fitness changed from -361.98536756282147 to -536.11807502134
Iteration 3 complete. Error: -536.11807502134 Total: 1.8037; Orientation: 0.0160; Line Search: 1.1960
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>![Iteration 3](etc/3c2279e8-dc77-44c5-9e96-d7aace1e0f9d.jpg)
Adding measurement 7a4eb7a5 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.870e+03, gradient 3.560e-01, dot -0.314; [c752074a-17f8-4312-b9df-bfa28a4e0355 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -536.11807502134, -361.98536756282147, -227.78497125466095, -140.8317883376227
LBFGS Accumulation History: 3 points
Removed measurement 7a4eb7a5 to history. Total: 3
th(0)=-536.11807502134;dx=-0.12671176403053247
New Minimum: -536.11807502134 > -665.6156609930175
END: th(15511.929768229566)=-665.6156609930175; dx=-0.009525240302710871 evalInputDelta=129.4975859716775
Fitness changed from -536.11807502134 to -665.6156609930175
Iteration 4 complete. Error: -665.6156609930175 Total: 2.0210; Orientation: 0.2927; Line Search: 1.1589
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>![Iteration 4](etc/389d8ee2-32b3-4b8b-a00e-d8e19d8e37e2.jpg)
Adding measurement 53eae8df to history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.549e+03, gradient 3.723e-01, dot -0.189; [c752074a-17f8-4312-b9df-bfa28a4e0355 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -665.6156609930175, -361.98536756282147, -227.78497125466095, -140.8317883376227
LBFGS Accumulation History: 3 points
Removed measurement 53eae8df to history. Total: 3
th(0)=-665.6156609930175;dx=-0.1384967370436017
New Minimum: -665.6156609930175 > -690.4731280481035
END: th(33419.43960201202)=-690.4731280481035; dx=-0.0017456155975417017 evalInputDelta=24.857467055085976
Fitness changed from -665.6156609930175 to -690.4731280481035
Iteration 5 complete. Error: -690.4731280481035 Total: 2.0463; Orientation: 0.2880; Line Search: 1.1801
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>![Iteration 5](etc/5e9c7a1e-5703-402a-a399-e929b974805a.jpg)
Adding measurement 681feb86 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.211e+03, gradient 3.083e-01, dot -0.114; [c752074a-17f8-4312-b9df-bfa28a4e0355 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -690.4731280481035, -361.98536756282147, -227.78497125466095, -140.8317883376227
LBFGS Accumulation History: 3 points
Removed measurement 681feb86 to history. Total: 3
th(0)=-690.4731280481035;dx=-0.09502074012843975
New Minimum: -690.4731280481035 > -728.7298180908438
END: th(72000.00000000003)=-728.7298180908438; dx=-8.655201499363294E-4 evalInputDelta=38.256690042740274
Fitness changed from -690.4731280481035 to -728.7298180908438
Iteration 6 complete. Error: -728.7298180908438 Total: 2.6847; Orientation: 0.2867; Line Search: 1.8019
Adding measurement 3c21581 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.992e+04, gradient 2.574e-01, dot -0.081; [c752074a-17f8-4312-b9df-bfa28a4e0355 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -728.7298180908438, -361.98536756282147, -227.78497125466095, -140.8317883376227
LBFGS Accumulation History: 3 points
Removed measurement 3c21581 to history. Total: 3
th(0)=-728.7298180908438;dx=-0.06623643323401598
Armijo: th(155119.2976822957)=-567.7619224136516; dx=4.2206308923561404E-4 evalInputDelta=-160.96789567719213
New Minimum: -728.7298180908438 > -1022.3540497075464
END: th(77559.64884114785)=-1022.3540497075464; dx=-0.0034621273538958945 evalInputDelta=293.6242316167027
Fitness changed from -728.7298180908438 to -1022.3540497075464
Iteration 7 complete. Error: -1022.3540497075464 Total: 2.6153; Orientation: 0.2788; Line Search: 1.8008
Adding measurement 7ab636d9 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.301e+05, gradient 2.554e-01, dot -0.099; [c752074a-17f8-4312-b9df-bfa28a4e0355 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1022.3540497075464, -361.98536756282147, -227.78497125466095, -140.8317883376227
LBFGS Accumulation History: 3 points
Removed measurement 7ab636d9 to history. Total: 3
th(0)=-1022.3540497075464;dx=-0.06520186649435517
Armijo: th(167097.19801006012)=-665.7333077044881; dx=6.862900348795807E-4 evalInputDelta=-356.62074200305835
New Minimum: -1022.3540497075464 > -1241.497451026856
END: th(83548.59900503006)=-1241.497451026856; dx=-0.003157113210454199 evalInputDelta=219.14340131930953
Fitness changed from -1022.3540497075464 to -1241.497451026856
Iteration 8 complete. Error: -1241.497451026856 Total: 2.6707; Orientation: 0.2859; Line Search: 1.8119
Adding measurement 5acefe2 to history. Total: 3
Accepted: LBFGS Orientation magnitude: 2.811e+04, gradient 2.554e-01, dot 0.138; [c752074a-17f8-4312-b9df-bfa28a4e0355 = 1.000/1.000e+00]
Constructing line search parameters: LBFGS+Trust
th(0)=-1241.497451026856;dx=-989.2897270252394
Armijo: th(180000.0000000001)=261.535260578049; dx=0.0050741530585376345 evalInputDelta=-1503.032711604905
Armijo: th(90000.00000000004)=256.9505759987726; dx=0.010102244206400705 evalInputDelta=-1498.4480270256286
Armijo: th(30000.000000000015)=243.10836156925916; dx=0.029721090188820295 evalInputDelta=-1484.6058125961151
Armijo: th(7500.000000000004)=222.97214443067003; dx=0.11631243794450041 evalInputDelta=-1464.4695954575259
Armijo: th(1500.0000000000007)=192.12398596762637; dx=0.5646430539013816 evalInputDelta=-1433.6214369944823
Armijo: th(250.0000000000001)=142.44784604239305; dx=3.2144912608499316 evalInputDelta=-1383.9452970692491
Armijo: th(35.71428571428573)=24.55212389571477; dx=18.986132443392407 evalInputDelta=-1266.0495749225706
Armijo: th(4.464285714285716)=-346.3907419203; dx=85.57756075470729 evalInputDelta=-895.106709106556
Armijo: th(0.49603174603174627)=-1011.3194877154074; dx=95.00162310113234 evalInputDelta=-230.1779633114486
Armijo: th(0.04960317460317463)=-1219.4797938995696; dx=-120.817179518594 evalInputDelta=-22.017657127286384
Armijo: th(0.004509379509379512)=-1239.556459144839; dx=-157.9137639938436 evalInputDelta=-1.9409918820169878
Armijo: th(3.7578162578162595E-4)=-1241.336335408671; dx=-160.66652640122913 evalInputDelta=-0.16111561818502196
Armijo: th(2.890627890627892E-5)=-1241.4850439054721; dx=-161.06914685644884 evalInputDelta=-0.0124071213838306
Armijo: th(2.0647342075913514E-6)=-1241.4964440873541; dx=-160.74724638396668 evalInputDelta=-0.0010069395018490468
Armijo: th(1.3764894717275675E-7)=-1241.4973743035819; dx=-161.54836096724534 evalInputDelta=-7.672327410546131E-5
Armijo: th(8.603059198297297E-9)=-1241.497383840325; dx=-160.1163480729204 evalInputDelta=-6.718653094139881E-5
Armijo: th(5.060623057821939E-10)=-1241.4973933770682; dx=-161.4083304179522 evalInputDelta=-5.7649787777336314E-5
MIN ALPHA (2.8114572543455216E-11): th(0.0)=-1241.497451026856
Fitness changed from -1241.497451026856 to -1241.497451026856
Static Iteration Total: 12.5583; Orientation: 0.2813; Line Search: 11.7253
Iteration 9 failed. Error: -1241.497451026856
Previous Error: 0.0 -> -1241.497451026856
Retrying iteration 9
Reset training subject: 216233172515400
Adding measurement 35d8a21f to history. Total: 0
LBFGS Accumulation History: 1 points
th(0)=-1241.497451026856;dx=-0.06518309198656391
END: th(2.1544346900318838E-10)=-1241.497451026856; dx=-0.04190721887749803 evalInputDelta=0.0
Fitness changed from -1241.497451026856 to -1241.497451026856
Static Iteration Total: 2.3357; Orientation: 0.0162; Line Search: 1.1770
Iteration 10 failed. Error: -1241.497451026856
Previous Error: 0.0 -> -1241.497451026856
Optimization terminated 10
Final threshold in iteration 10: -1241.497451026856 (> -Infinity) after 36.852s (< 5400.000s)
Returns
-1241.497451026856