BasicOptimizer.scala:89 executed in 7.31 seconds (0.000 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: 163094264767100
Reset training subject: 163094389493900
Adding measurement 400c8463 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-11.895205363697226;dx=-0.1674941768248811
New Minimum: -11.895205363697226 > -12.255846146656207
WOLFE (weak): th(2.154434690031884)=-12.255846146656207; dx=-0.16701549802866356 evalInputDelta=0.3606407829589813
New Minimum: -12.255846146656207 > -12.60763473508339
WOLFE (weak): th(4.308869380063768)=-12.60763473508339; dx=-0.17035669780947116 evalInputDelta=0.7124293713861647
New Minimum: -12.60763473508339 > -14.013605863302713
WOLFE (weak): th(12.926608140191302)=-14.013605863302713; dx=-0.16833780311540228 evalInputDelta=2.118400499605487
New Minimum: -14.013605863302713 > -20.25757447796919
WOLFE (weak): th(51.70643256076521)=-20.25757447796919; dx=-0.160180814457752 evalInputDelta=8.362369114271964
New Minimum: -20.25757447796919 > -43.56502329716825
END: th(258.53216280382605)=-43.56502329716825; dx=-0.08011363182081947 evalInputDelta=31.669817933471027
Fitness changed from -11.895205363697226 to -43.56502329716825
Iteration 1 complete. Error: -43.56502329716825 Total: 1.0014; Orientation: 0.0015; Line Search: 0.6600
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/8ccfad48-5798-4070-95fc-218a75074538.jpg)
Adding measurement 4fcaa2a7 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-43.56502329716825;dx=-0.16981924940108198
New Minimum: -43.56502329716825 > -72.45585266862506
END: th(556.9906600335335)=-72.45585266862506; dx=-0.019069521865288402 evalInputDelta=28.890829371456803
Fitness changed from -43.56502329716825 to -72.45585266862506
Iteration 2 complete. Error: -72.45585266862506 Total: 0.3417; Orientation: 0.0015; Line Search: 0.2194
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/1cfdcaab-e1c9-4550-a136-768cee357a60.jpg)
Adding measurement 446385d6 to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-72.45585266862506;dx=-0.17878861439119953
New Minimum: -72.45585266862506 > -86.11010790606264
WOLF (strong): th(1200.0)=-86.11010790606264; dx=0.0013700495977188587 evalInputDelta=13.654255237437582
New Minimum: -86.11010790606264 > -100.29965844595384
WOLF (strong): th(600.0)=-100.29965844595384; dx=0.0010818371239187119 evalInputDelta=27.843805777328782
New Minimum: -100.29965844595384 > -100.6076605790409
END: th(200.0)=-100.6076605790409; dx=-0.08201002509034747 evalInputDelta=28.15180791041584
Fitness changed from -72.45585266862506 to -100.6076605790409
Iteration 3 complete. Error: -100.6076605790409 Total: 0.5583; Orientation: 0.0015; Line Search: 0.4419
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>![Iteration 3](etc/86ee05fe-cd52-4305-9ff6-afc76ff8069f.jpg)
Adding measurement 4fe9ebf3 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.719e+02, gradient 3.673e-01, dot -0.448; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -100.6076605790409, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 4fe9ebf3 to history. Total: 3
th(0)=-100.6076605790409;dx=-0.1303862452576155
New Minimum: -100.6076605790409 > -115.3679109753336
END: th(430.88693800637674)=-115.3679109753336; dx=-0.017158735969844536 evalInputDelta=14.760250396292705
Fitness changed from -100.6076605790409 to -115.3679109753336
Iteration 4 complete. Error: -115.3679109753336 Total: 0.3703; Orientation: 0.0272; Line Search: 0.2235
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>![Iteration 4](etc/24a3d29f-7ccf-42de-b646-3ef024456844.jpg)
Adding measurement 2d9914da to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.002e+02, gradient 4.355e-01, dot -0.340; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -115.3679109753336, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 2d9914da to history. Total: 3
th(0)=-115.3679109753336;dx=-0.18727364345630726
Armijo: th(928.3177667225558)=-109.2991344030226; dx=0.01515181251834402 evalInputDelta=-6.068776572310995
New Minimum: -115.3679109753336 > -128.28503724616522
WOLF (strong): th(464.1588833612779)=-128.28503724616522; dx=0.013496486240871991 evalInputDelta=12.917126270831616
New Minimum: -128.28503724616522 > -133.28854390944483
END: th(154.71962778709263)=-133.28854390944483; dx=-0.06036316190485975 evalInputDelta=17.920632934111225
Fitness changed from -115.3679109753336 to -133.28854390944483
Iteration 5 complete. Error: -133.28854390944483 Total: 0.5843; Orientation: 0.0285; Line Search: 0.4396
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>![Iteration 5](etc/26467a4d-ca00-4adc-8bdb-f5283f0239cb.jpg)
Adding measurement 12e59bfe to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.764e+02, gradient 3.237e-01, dot -0.412; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -133.28854390944483, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 12e59bfe to history. Total: 3
th(0)=-133.28854390944483;dx=-0.0999042337929892
New Minimum: -133.28854390944483 > -149.27022999412844
END: th(333.33333333333337)=-149.27022999412844; dx=-0.03313766311281276 evalInputDelta=15.981686084683616
Fitness changed from -133.28854390944483 to -149.27022999412844
Iteration 6 complete. Error: -149.27022999412844 Total: 0.3769; Orientation: 0.0268; Line Search: 0.2300
Adding measurement 4a87486f to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.769e+02, gradient 3.426e-01, dot -0.408; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -149.27022999412844, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 4a87486f to history. Total: 3
th(0)=-149.27022999412844;dx=-0.11434133019628079
New Minimum: -149.27022999412844 > -156.848516190782
END: th(718.1448966772947)=-156.848516190782; dx=-0.00520990898623262 evalInputDelta=7.578286196653551
Fitness changed from -149.27022999412844 to -156.848516190782
Iteration 7 complete. Error: -156.848516190782 Total: 0.3711; Orientation: 0.0322; Line Search: 0.2268
Adding measurement 7469618c to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.070e+03, gradient 4.334e-01, dot -0.294; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -156.848516190782, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 7469618c to history. Total: 3
th(0)=-156.848516190782;dx=-0.1832428406256003
Armijo: th(1547.1962778709267)=-130.32041342878713; dx=0.00567313980310531 evalInputDelta=-26.52810276199486
New Minimum: -156.848516190782 > -158.67247738068818
WOLF (strong): th(773.5981389354633)=-158.67247738068818; dx=0.010185466347739262 evalInputDelta=1.8239611899061856
New Minimum: -158.67247738068818 > -177.44641576754938
END: th(257.8660463118211)=-177.44641576754938; dx=-0.04697903871388587 evalInputDelta=20.59789957676739
Fitness changed from -156.848516190782 to -177.44641576754938
Iteration 8 complete. Error: -177.44641576754938 Total: 0.5819; Orientation: 0.0291; Line Search: 0.4428
Adding measurement 21edbaf7 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.302e+03, gradient 3.259e-01, dot -0.377; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -177.44641576754938, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 21edbaf7 to history. Total: 3
th(0)=-177.44641576754938;dx=-0.10347457743649774
New Minimum: -177.44641576754938 > -197.64862880564084
END: th(555.5555555555557)=-197.64862880564084; dx=-3.637239908178102E-4 evalInputDelta=20.202213038091458
Fitness changed from -177.44641576754938 to -197.64862880564084
Iteration 9 complete. Error: -197.64862880564084 Total: 0.3632; Orientation: 0.0275; Line Search: 0.2219
Adding measurement 73c73672 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.861e+03, gradient 4.100e-01, dot -0.306; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -197.64862880564084, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 73c73672 to history. Total: 3
th(0)=-197.64862880564084;dx=-0.1593223919059076
Armijo: th(1196.9081611288245)=-170.74696304949322; dx=0.013191081383457294 evalInputDelta=-26.901665756147622
New Minimum: -197.64862880564084 > -202.82518257726284
END: th(598.4540805644123)=-202.82518257726284; dx=-5.885537162961676E-4 evalInputDelta=5.176553771621997
Fitness changed from -197.64862880564084 to -202.82518257726284
Iteration 10 complete. Error: -202.82518257726284 Total: 0.4732; Orientation: 0.0263; Line Search: 0.3406
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/19ed586c-59b6-4510-9009-ced766608b2e.jpg)
Adding measurement 302f2df to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.178e+03, gradient 4.267e-01, dot -0.298; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -202.82518257726284, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 302f2df to history. Total: 3
th(0)=-202.82518257726284;dx=-0.17446899198058502
Armijo: th(1289.3302315591056)=-158.86378181283172; dx=0.02540009851540151 evalInputDelta=-43.96140076443112
New Minimum: -202.82518257726284 > -215.35243642689534
WOLF (strong): th(644.6651157795528)=-215.35243642689534; dx=0.029679337715806123 evalInputDelta=12.527253849632501
New Minimum: -215.35243642689534 > -229.54556839274855
END: th(214.8883719265176)=-229.54556839274855; dx=-0.06291140692714098 evalInputDelta=26.720385815485713
Fitness changed from -202.82518257726284 to -229.54556839274855
Iteration 11 complete. Error: -229.54556839274855 Total: 0.5839; Orientation: 0.0261; Line Search: 0.4423
Adding measurement 5cc986d5 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.324e+03, gradient 3.036e-01, dot -0.410; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -229.54556839274855, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 5cc986d5 to history. Total: 3
th(0)=-229.54556839274855;dx=-0.08830494800684538
New Minimum: -229.54556839274855 > -250.81500746316996
END: th(462.9629629629631)=-250.81500746316996; dx=-0.026883973316144574 evalInputDelta=21.269439070421413
Fitness changed from -229.54556839274855 to -250.81500746316996
Iteration 12 complete. Error: -250.81500746316996 Total: 0.3560; Orientation: 0.0293; Line Search: 0.2209
Adding measurement 48155e58 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.256e+03, gradient 3.250e-01, dot -0.418; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -250.81500746316996, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 48155e58 to history. Total: 3
th(0)=-250.81500746316996;dx=-0.10177211085586585
New Minimum: -250.81500746316996 > -257.97913554200466
END: th(997.4234676073539)=-257.97913554200466; dx=-0.007903533159810846 evalInputDelta=7.164128078834693
Fitness changed from -250.81500746316996 to -257.97913554200466
Iteration 13 complete. Error: -257.97913554200466 Total: 0.3684; Orientation: 0.0267; Line Search: 0.2221
Adding measurement 73f13adc to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.367e+03, gradient 4.138e-01, dot -0.279; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -257.97913554200466, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 73f13adc to history. Total: 3
th(0)=-257.97913554200466;dx=-0.16660498200475204
Armijo: th(2148.8837192651763)=-164.06560711343496; dx=0.020707164353709142 evalInputDelta=-93.91352842856969
Armijo: th(1074.4418596325881)=-246.33669952171155; dx=0.038668293099742755 evalInputDelta=-11.642436020293104
New Minimum: -257.97913554200466 > -296.76154410991325
END: th(358.14728654419605)=-296.76154410991325; dx=-0.04073890264098093 evalInputDelta=38.78240856790859
Fitness changed from -257.97913554200466 to -296.76154410991325
Iteration 14 complete. Error: -296.76154410991325 Total: 0.5958; Orientation: 0.0328; Line Search: 0.4557
Adding measurement 6b7e570e to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.079e+04, gradient 2.912e-01, dot -0.443; [09de304f-6bec-48a6-841f-a968ababf2c6 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -296.76154410991325, -72.45585266862506, -43.56502329716825, -11.895205363697226
LBFGS Accumulation History: 3 points
Removed measurement 6b7e570e to history. Total: 3
th(0)=-296.76154410991325;dx=-0.08177460269232102
New Minimum: -296.76154410991325 > -323.42935376214695
END: th(771.6049382716053)=-323.42935376214695; dx=-0.022773091052276782 evalInputDelta=26.6678096522337
Fitness changed from -296.76154410991325 to -323.42935376214695
Iteration 15 complete. Error: -323.42935376214695 Total: 0.3699; Orientation: 0.0301; Line Search: 0.2280
<a id="p-15"></a>Iteration 15
<a id="p-14"></a>![Iteration 15](etc/86e18e63-914e-4706-9c9a-24e27e61a3a4.jpg)
Final threshold in iteration 16: -323.42935376214695 (> -Infinity) after 7.308s (< 5400.000s)
Returns
-323.42935376214695