BasicOptimizer.scala:89 executed in 46.92 seconds (0.862 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: 218288697471700
Reset training subject: 218289348848600
Adding measurement 70fbbc29 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-220.17683766406947;dx=-0.17074177397446938
New Minimum: -220.17683766406947 > -220.4312619489664
WOLFE (weak): th(2.154434690031884)=-220.4312619489664; dx=-0.17085009322824235 evalInputDelta=0.2544242848969418
New Minimum: -220.4312619489664 > -220.6861621499821
WOLFE (weak): th(4.308869380063768)=-220.6861621499821; dx=-0.17082793486856054 evalInputDelta=0.5093244859126287
New Minimum: -220.6861621499821 > -221.7061461615338
WOLFE (weak): th(12.926608140191302)=-221.7061461615338; dx=-0.17118682646865618 evalInputDelta=1.529308497464342
New Minimum: -221.7061461615338 > -226.34300208031533
WOLFE (weak): th(51.70643256076521)=-226.34300208031533; dx=-0.17029692438113575 evalInputDelta=6.166164416245863
New Minimum: -226.34300208031533 > -251.80257777108534
WOLFE (weak): th(258.53216280382605)=-251.80257777108534; dx=-0.16685925442707683 evalInputDelta=31.625740107015872
New Minimum: -251.80257777108534 > -371.4164770462739
END: th(1551.1929768229563)=-371.4164770462739; dx=-0.09055611793738619 evalInputDelta=151.23963938220442
Fitness changed from -220.17683766406947 to -371.4164770462739
Iteration 1 complete. Error: -371.4164770462739 Total: 6.0856; Orientation: 0.0170; Line Search: 4.3020
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/0ccbd8c4-5592-444c-b6a1-c996d017bc35.jpg)
Adding measurement 6d529bd0 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-371.4164770462739;dx=-0.18189798910339264
New Minimum: -371.4164770462739 > -529.5788417187472
END: th(3341.943960201201)=-529.5788417187472; dx=-0.04475475887986004 evalInputDelta=158.1623646724733
Fitness changed from -371.4164770462739 to -529.5788417187472
Iteration 2 complete. Error: -529.5788417187472 Total: 1.8318; Orientation: 0.0176; Line Search: 1.2188
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/a06991b6-4a1d-489e-ae0c-0a5153f7730e.jpg)
Adding measurement 5f0b2d94 to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-529.5788417187472;dx=-0.16385478962386374
New Minimum: -529.5788417187472 > -656.5869333145458
END: th(7200.000000000001)=-656.5869333145458; dx=-0.02362127123526655 evalInputDelta=127.00809159579865
Fitness changed from -529.5788417187472 to -656.5869333145458
Iteration 3 complete. Error: -656.5869333145458 Total: 1.9817; Orientation: 0.0161; Line Search: 1.4082
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>![Iteration 3](etc/6aa7f732-ba69-4ddd-a9d7-b491e97b8094.jpg)
Adding measurement 1231bef8 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.468e+03, gradient 4.029e-01, dot -0.256; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -656.5869333145458, -529.5788417187472, -371.4164770462739, -220.17683766406947
LBFGS Accumulation History: 3 points
Removed measurement 1231bef8 to history. Total: 3
th(0)=-656.5869333145458;dx=-0.16206487993349494
New Minimum: -656.5869333145458 > -673.8566454099637
END: th(15511.929768229566)=-673.8566454099637; dx=-0.004039034258906568 evalInputDelta=17.269712095417844
Fitness changed from -656.5869333145458 to -673.8566454099637
Iteration 4 complete. Error: -673.8566454099637 Total: 2.1191; Orientation: 0.3017; Line Search: 1.2085
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>![Iteration 4](etc/58ec518a-8a61-4152-9e31-b18f0340c213.jpg)
Adding measurement 61d4baad to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.783e+03, gradient 3.792e-01, dot -0.177; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -673.8566454099637, -529.5788417187472, -371.4164770462739, -220.17683766406947
LBFGS Accumulation History: 3 points
Removed measurement 61d4baad to history. Total: 3
th(0)=-673.8566454099637;dx=-0.14356267231616834
Armijo: th(33419.43960201202)=-550.32455541555; dx=0.0019678426016802287 evalInputDelta=-123.5320899944137
New Minimum: -673.8566454099637 > -895.270029851511
END: th(16709.71980100601)=-895.270029851511; dx=-0.0068481822609484854 evalInputDelta=221.41338444154735
Fitness changed from -673.8566454099637 to -895.270029851511
Iteration 5 complete. Error: -895.270029851511 Total: 2.7570; Orientation: 0.3095; Line Search: 1.8186
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>![Iteration 5](etc/213ae7be-b348-470a-9fb8-59a97fc18e4d.jpg)
Adding measurement e7cabbb to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.289e+03, gradient 3.615e-01, dot -0.160; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -895.270029851511, -529.5788417187472, -371.4164770462739, -220.17683766406947
LBFGS Accumulation History: 3 points
Removed measurement e7cabbb to history. Total: 3
th(0)=-895.270029851511;dx=-0.13039676491736216
Armijo: th(36000.000000000015)=-724.4171472791751; dx=0.0041267387130217645 evalInputDelta=-170.85288257233594
New Minimum: -895.270029851511 > -1154.4299950868547
END: th(18000.000000000007)=-1154.4299950868547; dx=-0.008908647578836613 evalInputDelta=259.15996523534363
Fitness changed from -895.270029851511 to -1154.4299950868547
Iteration 6 complete. Error: -1154.4299950868547 Total: 2.7157; Orientation: 0.3093; Line Search: 1.7867
Adding measurement 1c067fd3 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.487e+03, gradient 3.433e-01, dot -0.165; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1154.4299950868547, -529.5788417187472, -371.4164770462739, -220.17683766406947
LBFGS Accumulation History: 3 points
Removed measurement 1c067fd3 to history. Total: 3
th(0)=-1154.4299950868547;dx=-0.11773217577663841
Armijo: th(38779.824420573925)=-946.9007985219225; dx=0.004289094238879915 evalInputDelta=-207.52919656493214
New Minimum: -1154.4299950868547 > -1426.827309025128
END: th(19389.912210286962)=-1426.827309025128; dx=-0.011413259149376142 evalInputDelta=272.3973139382733
Fitness changed from -1154.4299950868547 to -1426.827309025128
Iteration 7 complete. Error: -1426.827309025128 Total: 2.7753; Orientation: 0.3002; Line Search: 1.9121
Adding measurement 5bcfc59b to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.685e+04, gradient 3.380e-01, dot -0.173; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1426.827309025128, -529.5788417187472, -371.4164770462739, -220.17683766406947
LBFGS Accumulation History: 3 points
Removed measurement 5bcfc59b to history. Total: 3
th(0)=-1426.827309025128;dx=-0.11404385979313897
Armijo: th(41774.29950251503)=-1144.3137290810369; dx=0.0047120632519017875 evalInputDelta=-282.51357994409113
New Minimum: -1426.827309025128 > -1662.4090240601574
END: th(20887.149751257515)=-1662.4090240601574; dx=-0.009866208462578822 evalInputDelta=235.58171503502945
Fitness changed from -1426.827309025128 to -1662.4090240601574
Iteration 8 complete. Error: -1662.4090240601574 Total: 3.0039; Orientation: 0.5282; Line Search: 1.8814
Adding measurement f8b71fd to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.220e+04, gradient 3.417e-01, dot -0.176; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1662.4090240601574, -529.5788417187472, -371.4164770462739, -220.17683766406947
LBFGS Accumulation History: 3 points
Removed measurement f8b71fd to history. Total: 3
th(0)=-1662.4090240601574;dx=-0.11649646661948278
Armijo: th(45000.00000000002)=-1255.647581861617; dx=0.006552119505112059 evalInputDelta=-406.7614421985404
New Minimum: -1662.4090240601574 > -1890.4762460631332
END: th(22500.00000000001)=-1890.4762460631332; dx=-0.008274049223229269 evalInputDelta=228.06722200297577
Fitness changed from -1662.4090240601574 to -1890.4762460631332
Iteration 9 complete. Error: -1890.4762460631332 Total: 2.6815; Orientation: 0.3074; Line Search: 1.8334
Adding measurement 256191fe to history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.547e+04, gradient 3.417e-01, dot -0.184; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1890.4762460631332, -529.5788417187472, -371.4164770462739, -220.17683766406947
LBFGS Accumulation History: 3 points
Removed measurement 256191fe to history. Total: 3
th(0)=-1890.4762460631332;dx=-0.11661197864914265
Armijo: th(48474.78052571741)=-1420.1293186440278; dx=0.006633969273070661 evalInputDelta=-470.34692741910544
New Minimum: -1890.4762460631332 > -2075.3906387272873
END: th(24237.390262858706)=-2075.3906387272873; dx=-0.007430326145559055 evalInputDelta=184.9143926641541
Fitness changed from -1890.4762460631332 to -2075.3906387272873
Iteration 10 complete. Error: -2075.3906387272873 Total: 2.7290; Orientation: 0.2943; Line Search: 1.8298
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/1804f17c-2266-4c6c-926d-756cba8960f6.jpg)
Adding measurement 190d7842 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 4.854e+05, gradient 3.421e-01, dot -0.183; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2075.3906387272873, -529.5788417187472, -371.4164770462739, -220.17683766406947
LBFGS Accumulation History: 3 points
Removed measurement 190d7842 to history. Total: 3
th(0)=-2075.3906387272873;dx=-0.1167230813056116
Armijo: th(52217.874378143795)=-1512.0595924337517; dx=0.007454939166431553 evalInputDelta=-563.3310462935356
New Minimum: -2075.3906387272873 > -2281.4466878170406
END: th(26108.937189071898)=-2281.4466878170406; dx=-0.006188832725441745 evalInputDelta=206.0560490897533
Fitness changed from -2075.3906387272873 to -2281.4466878170406
Iteration 11 complete. Error: -2281.4466878170406 Total: 2.9865; Orientation: 0.2981; Line Search: 2.1105
Adding measurement 65cc76c5 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.306e+05, gradient 3.500e-01, dot -0.167; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2281.4466878170406, -529.5788417187472, -371.4164770462739, -220.17683766406947
LBFGS Accumulation History: 3 points
Removed measurement 65cc76c5 to history. Total: 3
th(0)=-2281.4466878170406;dx=-0.12214339720926137
Armijo: th(56250.00000000004)=-1552.2922670257847; dx=0.007915703648518613 evalInputDelta=-729.1544207912559
New Minimum: -2281.4466878170406 > -2421.676371196324
END: th(28125.00000000002)=-2421.676371196324; dx=-0.0038469517362440917 evalInputDelta=140.22968337928341
Fitness changed from -2281.4466878170406 to -2421.676371196324
Iteration 12 complete. Error: -2421.676371196324 Total: 2.7544; Orientation: 0.2923; Line Search: 1.9056
Adding measurement 41f2497a to history. Total: 3
Accepted: LBFGS Orientation magnitude: 3.996e+04, gradient 3.442e-01, dot 0.206; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Constructing line search parameters: LBFGS+Trust
th(0)=-2421.676371196324;dx=-2830.1654178086637
Armijo: th(60593.47565714677)=-746.1579476790414; dx=0.022124219875298806 evalInputDelta=-1675.5184235172826
Armijo: th(30296.737828573387)=-746.2503784268981; dx=0.0442393307723416 evalInputDelta=-1675.4259927694259
Armijo: th(10098.912609524463)=-746.9916412090686; dx=0.1327662915616044 evalInputDelta=-1674.6847299872554
Armijo: th(2524.7281523811157)=-749.157439922616; dx=0.5298201489778589 evalInputDelta=-1672.518931273708
Armijo: th(504.94563047622313)=-763.4584875752732; dx=2.6125665780023626 evalInputDelta=-1658.2178836210508
Armijo: th(84.15760507937053)=-837.9304698402354; dx=14.763283469993247 evalInputDelta=-1583.7459013560886
Armijo: th(12.022515011338646)=-1130.8496163650443; dx=76.31533623185673 evalInputDelta=-1290.8267548312797
Armijo: th(1.5028143764173307)=-1954.3992720434321; dx=119.49678213051263 evalInputDelta=-467.2770991528919
New Minimum: -2421.676371196324 > -2484.236963118773
END: th(0.16697937515748118)=-2484.236963118773; dx=-690.052221214002 evalInputDelta=62.56059192244902
Fitness changed from -2421.676371196324 to -2484.236963118773
Iteration 13 complete. Error: -2484.236963118773 Total: 7.5507; Orientation: 0.3293; Line Search: 6.6363
Adding measurement 25011a65 to history. Total: 4
Rejected: LBFGS Orientation magnitude: 3.025e+04, gradient 3.350e-01, dot -0.000; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2484.236963118773, -2421.676371196324, -529.5788417187472, -371.4164770462739, -220.17683766406947
Rejected: LBFGS Orientation magnitude: 1.393e+05, gradient 3.350e-01, dot -0.129; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2484.236963118773, -2421.676371196324, -529.5788417187472, -371.4164770462739
LBFGS Accumulation History: 3 points
Removed measurement 25011a65 to history. Total: 4
Removed measurement 41f2497a to history. Total: 3
th(0)=-2484.236963118773;dx=-0.11193650555463969
New Minimum: -2484.236963118773 > -2484.2543627669556
END: th(0.3597461583591256)=-2484.2543627669556; dx=-0.08106570110969298 evalInputDelta=0.017399648182617966
Fitness changed from -2484.236963118773 to -2484.2543627669556
Iteration 14 complete. Error: -2484.2543627669556 Total: 2.8394; Orientation: 0.9115; Line Search: 1.3431
Adding measurement 234d324 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.190e+05, gradient 3.348e-01, dot -0.135; [a66a4a3b-dc31-4e86-93ef-0f2d2e759545 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2484.2543627669556, -529.5788417187472, -371.4164770462739, -220.17683766406947
LBFGS Accumulation History: 3 points
Removed measurement 234d324 to history. Total: 3
th(0)=-2484.2543627669556;dx=-0.11193263453350777
New Minimum: -2484.2543627669556 > -2484.2918753497675
END: th(0.7750496031746038)=-2484.2918753497675; dx=-0.08099970138192876 evalInputDelta=0.037512582811814354
Fitness changed from -2484.2543627669556 to -2484.2918753497675
Iteration 15 complete. Error: -2484.2918753497675 Total: 2.0836; Orientation: 0.2957; Line Search: 1.2295
<a id="p-15"></a>Iteration 15
<a id="p-14"></a>![Iteration 15](etc/f30270c1-8574-4392-81d0-bb637bc3ac20.jpg)
Final threshold in iteration 16: -2484.2918753497675 (> -Infinity) after 46.918s (< 5400.000s)
Returns
-2484.2918753497675