BasicOptimizer.scala:89 executed in 7.86 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: 159402644856100
Reset training subject: 159402774765000
Adding measurement 2a064804 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-33.603354368346736;dx=-0.0810674498985906
New Minimum: -33.603354368346736 > -33.796537287378825
WOLFE (weak): th(2.154434690031884)=-33.796537287378825; dx=-0.08187500845482719 evalInputDelta=0.19318291903208973
New Minimum: -33.796537287378825 > -33.98994207275698
WOLFE (weak): th(4.308869380063768)=-33.98994207275698; dx=-0.08195678861574748 evalInputDelta=0.38658770441024615
New Minimum: -33.98994207275698 > -34.76737530706319
WOLFE (weak): th(12.926608140191302)=-34.76737530706319; dx=-0.08422800845969103 evalInputDelta=1.1640209387164546
New Minimum: -34.76737530706319 > -38.23050207703922
WOLFE (weak): th(51.70643256076521)=-38.23050207703922; dx=-0.08145956799905787 evalInputDelta=4.627147708692483
New Minimum: -38.23050207703922 > -54.11555380907138
END: th(258.53216280382605)=-54.11555380907138; dx=-0.06483320365524264 evalInputDelta=20.512199440724643
Fitness changed from -33.603354368346736 to -54.11555380907138
Iteration 1 complete. Error: -54.11555380907138 Total: 1.0302; Orientation: 0.0015; Line Search: 0.6800
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/b66a9a5e-5a4e-4dfa-a2ee-5d60e58c5be9.jpg)
Adding measurement b5c1acb to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-54.11555380907138;dx=-0.09182443866098963
New Minimum: -54.11555380907138 > -94.35212367608638
END: th(556.9906600335335)=-94.35212367608638; dx=-0.04479639018780271 evalInputDelta=40.236569867015
Fitness changed from -54.11555380907138 to -94.35212367608638
Iteration 2 complete. Error: -94.35212367608638 Total: 0.3453; Orientation: 0.0015; Line Search: 0.2230
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/5097f0ac-e839-4387-8c78-9b81f69aa4c1.jpg)
Adding measurement 61a56f1 to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-94.35212367608638;dx=-0.09834817980343344
New Minimum: -94.35212367608638 > -135.92997824017704
END: th(1200.0)=-135.92997824017704; dx=-0.02379366712192446 evalInputDelta=41.57785456409066
Fitness changed from -94.35212367608638 to -135.92997824017704
Iteration 3 complete. Error: -135.92997824017704 Total: 0.3579; Orientation: 0.0015; Line Search: 0.2345
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>![Iteration 3](etc/eca78f3d-cbff-4f7a-bc3d-3054eb7051d2.jpg)
Adding measurement 59c4dcb0 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.659e+03, gradient 3.883e-01, dot -0.257; [071fdc4b-22c6-4834-9aa9-d657c3ac9548 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -135.92997824017704, -94.35212367608638, -54.11555380907138, -33.603354368346736
LBFGS Accumulation History: 3 points
Removed measurement 59c4dcb0 to history. Total: 3
th(0)=-135.92997824017704;dx=-0.14045372466557543
New Minimum: -135.92997824017704 > -182.29219761827437
END: th(2585.3216280382608)=-182.29219761827437; dx=-0.005366457173377923 evalInputDelta=46.362219378097336
Fitness changed from -135.92997824017704 to -182.29219761827437
Iteration 4 complete. Error: -182.29219761827437 Total: 0.3687; Orientation: 0.0282; Line Search: 0.2239
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>![Iteration 4](etc/ccb53e76-ff7b-4228-a055-4d447e8f0cf3.jpg)
Adding measurement 37ff4505 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.108e+03, gradient 3.573e-01, dot -0.187; [071fdc4b-22c6-4834-9aa9-d657c3ac9548 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -182.29219761827437, -94.35212367608638, -54.11555380907138, -33.603354368346736
LBFGS Accumulation History: 3 points
Removed measurement 37ff4505 to history. Total: 3
th(0)=-182.29219761827437;dx=-0.11912849230145253
New Minimum: -182.29219761827437 > -263.7557760031048
END: th(5569.9066003353355)=-263.7557760031048; dx=-0.0030567691473531336 evalInputDelta=81.46357838483044
Fitness changed from -182.29219761827437 to -263.7557760031048
Iteration 5 complete. Error: -263.7557760031048 Total: 0.3949; Orientation: 0.0274; Line Search: 0.2251
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>![Iteration 5](etc/8e58d5db-e428-4931-9a9f-5dade1839388.jpg)
Adding measurement 7dca5ea9 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.277e+03, gradient 3.366e-01, dot -0.212; [071fdc4b-22c6-4834-9aa9-d657c3ac9548 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -263.7557760031048, -94.35212367608638, -54.11555380907138, -33.603354368346736
LBFGS Accumulation History: 3 points
Removed measurement 7dca5ea9 to history. Total: 3
th(0)=-263.7557760031048;dx=-0.10482327597618529
New Minimum: -263.7557760031048 > -469.48560614251
WOLF (strong): th(12000.000000000002)=-469.48560614251; dx=3.897672968783063E-4 evalInputDelta=205.72983013940518
New Minimum: -469.48560614251 > -609.6649182132755
END: th(6000.000000000001)=-609.6649182132755; dx=-0.006725653195069668 evalInputDelta=345.9091422101707
Fitness changed from -263.7557760031048 to -609.6649182132755
Iteration 6 complete. Error: -609.6649182132755 Total: 0.4909; Orientation: 0.0302; Line Search: 0.3406
Adding measurement 2d821b19 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.578e+04, gradient 3.428e-01, dot -0.268; [071fdc4b-22c6-4834-9aa9-d657c3ac9548 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -609.6649182132755, -94.35212367608638, -54.11555380907138, -33.603354368346736
LBFGS Accumulation History: 3 points
Removed measurement 2d821b19 to history. Total: 3
th(0)=-609.6649182132755;dx=-0.11328953517516221
New Minimum: -609.6649182132755 > -634.2198209217369
WOLF (strong): th(12926.608140191305)=-634.2198209217369; dx=0.008350937179136705 evalInputDelta=24.554902708461327
New Minimum: -634.2198209217369 > -909.6955534683018
WOLF (strong): th(6463.304070095653)=-909.6955534683018; dx=0.005228873386441538 evalInputDelta=300.03063525502625
END: th(2154.434690031884)=-869.4713551923376; dx=-0.05347401488041311 evalInputDelta=259.806436979062
Fitness changed from -609.6649182132755 to -909.6955534683018
Iteration 7 complete. Error: -909.6955534683018 Total: 0.5901; Orientation: 0.0289; Line Search: 0.4530
Adding measurement 2c80c428 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 4.166e+04, gradient 3.897e-01, dot -0.266; [071fdc4b-22c6-4834-9aa9-d657c3ac9548 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -909.6955534683018, -94.35212367608638, -54.11555380907138, -33.603354368346736
LBFGS Accumulation History: 3 points
Removed measurement 2c80c428 to history. Total: 3
th(0)=-909.6955534683018;dx=-0.14739622354849408
New Minimum: -909.6955534683018 > -1228.4907407058467
END: th(4641.58883361278)=-1228.4907407058467; dx=-0.0066477088804864585 evalInputDelta=318.79518723754495
Fitness changed from -909.6955534683018 to -1228.4907407058467
Iteration 8 complete. Error: -1228.4907407058467 Total: 0.3592; Orientation: 0.0268; Line Search: 0.2224
Adding measurement 392dd56d to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.565e+08, gradient 3.571e-01, dot -0.307; [071fdc4b-22c6-4834-9aa9-d657c3ac9548 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1228.4907407058467, -94.35212367608638, -54.11555380907138, -33.603354368346736
LBFGS Accumulation History: 3 points
Removed measurement 392dd56d to history. Total: 3
th(0)=-1228.4907407058467;dx=-0.1225071357229286
Armijo: th(10000.000000000004)=-1189.5622093862935; dx=0.014608533871912025 evalInputDelta=-38.92853131955326
New Minimum: -1228.4907407058467 > -1497.2703496696913
END: th(5000.000000000002)=-1497.2703496696913; dx=-0.006702656923799709 evalInputDelta=268.77960896384457
Fitness changed from -1228.4907407058467 to -1497.2703496696913
Iteration 9 complete. Error: -1497.2703496696913 Total: 0.4737; Orientation: 0.0278; Line Search: 0.3384
Adding measurement 79963a4d to history. Total: 3
Accepted: LBFGS Orientation magnitude: 3.733e+04, gradient 3.980e-01, dot 0.357; [071fdc4b-22c6-4834-9aa9-d657c3ac9548 = 1.000/1.000e+00]
Constructing line search parameters: LBFGS+Trust
th(0)=-1497.2703496696913;dx=-5197.373873184788
Armijo: th(10772.173450159424)=-946.3809684793963; dx=0.04842747239949553 evalInputDelta=-550.889381190295
Armijo: th(5386.086725079712)=-946.377765482685; dx=0.09683543199983613 evalInputDelta=-550.8925841870063
Armijo: th(1795.3622416932374)=-946.3142316376733; dx=0.29019882577064926 evalInputDelta=-550.956118032018
Armijo: th(448.84056042330934)=-945.2592237053284; dx=1.1555315344441441 evalInputDelta=-552.0111259643629
Armijo: th(89.76811208466187)=-948.4112702303785; dx=5.550603330616189 evalInputDelta=-548.8590794393128
Armijo: th(14.961352014110311)=-961.4634028396505; dx=32.416326481420874 evalInputDelta=-535.8069468300408
Armijo: th(2.1373360020157586)=-1128.3416481722193; dx=203.37898548283724 evalInputDelta=-368.92870149747205
New Minimum: -1497.2703496696913 > -1743.6174322367851
WOLF (strong): th(0.2671670002519698)=-1743.6174322367851; dx=54.73184014763913 evalInputDelta=246.34708256709382
END: th(0.02968522225021887)=-1633.9900550492955; dx=-2828.9523389416154 evalInputDelta=136.7197053796042
Fitness changed from -1497.2703496696913 to -1743.6174322367851
Iteration 10 complete. Error: -1743.6174322367851 Total: 1.2627; Orientation: 0.0280; Line Search: 1.1212
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/2ac49ee8-b215-42a8-96b2-dac1f86a736e.jpg)
Adding measurement 41536287 to history. Total: 4
Accepted: LBFGS Orientation magnitude: 1.299e+04, gradient 4.937e-01, dot 0.065; [071fdc4b-22c6-4834-9aa9-d657c3ac9548 = 1.000/1.000e+00]
th(0)=-1743.6174322367851;dx=-429.92448197818067
Armijo: th(0.06395487259717787)=-1687.7283549197127; dx=457.16475227680553 evalInputDelta=-55.889077317072406
Armijo: th(0.031977436298588936)=-1715.8924063005816; dx=454.37496991910416 evalInputDelta=-27.725025936203565
Armijo: th(0.010659145432862978)=-1734.4419851929324; dx=468.3132614437933 evalInputDelta=-9.175447043852728
Armijo: th(0.0026647863582157445)=-1741.3178917130554; dx=455.570971927243 evalInputDelta=-2.2995405237297746
Armijo: th(5.329572716431489E-4)=-1743.157695103917; dx=460.98266280558323 evalInputDelta=-0.45973713286821294
Armijo: th(8.882621194052482E-5)=-1743.5408655950682; dx=449.57614885164503 evalInputDelta=-0.07656664171690863
Armijo: th(1.2689458848646402E-5)=-1743.6063202454848; dx=451.57188602239114 evalInputDelta=-0.011111991300367663
Armijo: th(1.5861823560808003E-6)=-1743.6159984354354; dx=457.93980130209644 evalInputDelta=-0.0014338013497763313
Armijo: th(1.7624248400897781E-7)=-1743.6172171666578; dx=456.24921655314176 evalInputDelta=-2.150701272967126E-4
Armijo: th(1.762424840089778E-8)=-1743.6174322367851; dx=452.3006140577487 evalInputDelta=0.0
Armijo: th(1.6022044000816165E-9)=-1743.6174322367851; dx=464.0978605355398 evalInputDelta=0.0
WOLF (strong): th(1.335170333401347E-10)=-1743.6174322367851; dx=462.42342542106786 evalInputDelta=0.0
MIN ALPHA (1.0270541026164208E-11): th(0.0)=-1743.6174322367851
Fitness changed from -1743.6174322367851 to -1743.6174322367851
Static Iteration Total: 1.7430; Orientation: 0.0328; Line Search: 1.5871
Iteration 11 failed. Error: -1743.6174322367851
Previous Error: 0.0 -> -1743.6174322367851
Retrying iteration 11
Reset training subject: 159410061488200
Adding measurement 7c237855 to history. Total: 0
LBFGS Accumulation History: 1 points
th(0)=-1743.6174322367851;dx=-0.2393667578749349
END: th(2.1544346900318838E-10)=-1743.6174322367851; dx=-0.1685810388127924 evalInputDelta=0.0
Fitness changed from -1743.6174322367851 to -1743.6174322367851
Static Iteration Total: 0.4447; Orientation: 0.0015; Line Search: 0.2236
Iteration 12 failed. Error: -1743.6174322367851
Previous Error: 0.0 -> -1743.6174322367851
Optimization terminated 12
Final threshold in iteration 12: -1743.6174322367851 (> -Infinity) after 7.862s (< 5400.000s)
Returns
-1743.6174322367851