BasicOptimizer.scala:89 executed in 43.27 seconds (1.155 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: 215436716712000
Reset training subject: 215437348459700
Adding measurement 23cb2db3 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-110.14939251704932;dx=-0.11136995411054262
New Minimum: -110.14939251704932 > -110.30153518603623
WOLFE (weak): th(2.154434690031884)=-110.30153518603623; dx=-0.11130695384780588 evalInputDelta=0.15214266898691164
New Minimum: -110.30153518603623 > -110.45372426640503
WOLFE (weak): th(4.308869380063768)=-110.45372426640503; dx=-0.11150798417858167 evalInputDelta=0.30433174935571117
New Minimum: -110.45372426640503 > -111.06407073151732
WOLFE (weak): th(12.926608140191302)=-111.06407073151732; dx=-0.11152179727256309 evalInputDelta=0.9146782144679975
New Minimum: -111.06407073151732 > -113.84419549538273
WOLFE (weak): th(51.70643256076521)=-113.84419549538273; dx=-0.11398554355898453 evalInputDelta=3.6948029783334135
New Minimum: -113.84419549538273 > -128.58443608780235
WOLFE (weak): th(258.53216280382605)=-128.58443608780235; dx=-0.11018945631826742 evalInputDelta=18.435043570753024
New Minimum: -128.58443608780235 > -201.04733691190737
END: th(1551.1929768229563)=-201.04733691190737; dx=-0.06691057487612215 evalInputDelta=90.89794439485804
Fitness changed from -110.14939251704932 to -201.04733691190737
Iteration 1 complete. Error: -201.04733691190737 Total: 6.0994; Orientation: 0.0157; Line Search: 4.3022
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/5e688c38-c638-48ad-81b3-f543b875dc05.jpg)
Adding measurement 368a476a to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-201.04733691190737;dx=-0.14118964928695923
New Minimum: -201.04733691190737 > -313.7860191370801
END: th(3341.943960201201)=-313.7860191370801; dx=-0.03594092446729573 evalInputDelta=112.73868222517271
Fitness changed from -201.04733691190737 to -313.7860191370801
Iteration 2 complete. Error: -313.7860191370801 Total: 2.0135; Orientation: 0.0158; Line Search: 1.4215
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/f08e6e9f-4537-40ae-ad06-c3d86076ae3c.jpg)
Adding measurement 1d6a3f4f to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-313.7860191370801;dx=-0.1669233399461768
New Minimum: -313.7860191370801 > -468.09369700654173
END: th(7200.000000000001)=-468.09369700654173; dx=-0.017176707127882024 evalInputDelta=154.30767786946166
Fitness changed from -313.7860191370801 to -468.09369700654173
Iteration 3 complete. Error: -468.09369700654173 Total: 1.8054; Orientation: 0.0161; Line Search: 1.1964
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>![Iteration 3](etc/90e16054-6199-4851-96b4-38433baa37a9.jpg)
Adding measurement 415922b3 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 7.225e+03, gradient 3.867e-01, dot -0.211; [4d25761f-8f77-4137-b959-4791dd75192e = 1.000/1.000e+00]
Orientation rejected. Popping history element from -468.09369700654173, -313.7860191370801, -201.04733691190737, -110.14939251704932
LBFGS Accumulation History: 3 points
Removed measurement 415922b3 to history. Total: 3
th(0)=-468.09369700654173;dx=-0.1493071106595842
New Minimum: -468.09369700654173 > -608.3509820229465
END: th(15511.929768229566)=-608.3509820229465; dx=-0.007832753748607821 evalInputDelta=140.25728501640475
Fitness changed from -468.09369700654173 to -608.3509820229465
Iteration 4 complete. Error: -608.3509820229465 Total: 2.0635; Orientation: 0.2964; Line Search: 1.1811
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>![Iteration 4](etc/c5661969-d831-43fe-a685-be3dfc8c5cc3.jpg)
Adding measurement 651470cc to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.403e+03, gradient 3.304e-01, dot -0.158; [4d25761f-8f77-4137-b959-4791dd75192e = 1.000/1.000e+00]
Orientation rejected. Popping history element from -608.3509820229465, -313.7860191370801, -201.04733691190737, -110.14939251704932
LBFGS Accumulation History: 3 points
Removed measurement 651470cc to history. Total: 3
th(0)=-608.3509820229465;dx=-0.10890920947019062
New Minimum: -608.3509820229465 > -717.5937617756545
END: th(33419.43960201202)=-717.5937617756545; dx=-0.0025459339243554756 evalInputDelta=109.24277975270797
Fitness changed from -608.3509820229465 to -717.5937617756545
Iteration 5 complete. Error: -717.5937617756545 Total: 2.0878; Orientation: 0.3190; Line Search: 1.1766
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>![Iteration 5](etc/9a31b98e-cabf-4dfe-be57-30560ddf72ac.jpg)
Adding measurement 7b110025 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 7.240e+03, gradient 2.999e-01, dot -0.129; [4d25761f-8f77-4137-b959-4791dd75192e = 1.000/1.000e+00]
Orientation rejected. Popping history element from -717.5937617756545, -313.7860191370801, -201.04733691190737, -110.14939251704932
LBFGS Accumulation History: 3 points
Removed measurement 7b110025 to history. Total: 3
th(0)=-717.5937617756545;dx=-0.08960935118459515
New Minimum: -717.5937617756545 > -776.9472798609299
WOLF (strong): th(72000.00000000003)=-776.9472798609299; dx=2.9418288384550214E-4 evalInputDelta=59.35351808527548
New Minimum: -776.9472798609299 > -1160.8568029361988
END: th(36000.000000000015)=-1160.8568029361988; dx=-0.0075795818869499165 evalInputDelta=443.2630411605444
Fitness changed from -717.5937617756545 to -1160.8568029361988
Iteration 6 complete. Error: -1160.8568029361988 Total: 2.6803; Orientation: 0.2946; Line Search: 1.8100
Adding measurement 4e75f1a8 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.411e+04, gradient 2.990e-01, dot -0.132; [4d25761f-8f77-4137-b959-4791dd75192e = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1160.8568029361988, -313.7860191370801, -201.04733691190737, -110.14939251704932
LBFGS Accumulation History: 3 points
Removed measurement 4e75f1a8 to history. Total: 3
th(0)=-1160.8568029361988;dx=-0.08917361602568767
Armijo: th(77559.64884114785)=-962.2574699831159; dx=0.0010058796628609264 evalInputDelta=-198.59933295308292
New Minimum: -1160.8568029361988 > -1609.5694229824192
END: th(38779.824420573925)=-1609.5694229824192; dx=-0.008390410040900204 evalInputDelta=448.7126200462203
Fitness changed from -1160.8568029361988 to -1609.5694229824192
Iteration 7 complete. Error: -1609.5694229824192 Total: 2.9814; Orientation: 0.2914; Line Search: 2.1234
Adding measurement 66276625 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.274e+04, gradient 3.132e-01, dot -0.139; [4d25761f-8f77-4137-b959-4791dd75192e = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1609.5694229824192, -313.7860191370801, -201.04733691190737, -110.14939251704932
LBFGS Accumulation History: 3 points
Removed measurement 66276625 to history. Total: 3
th(0)=-1609.5694229824192;dx=-0.0978905458300651
Armijo: th(83548.59900503006)=-1134.7147006697703; dx=0.0021389618657297414 evalInputDelta=-474.85472231264885
New Minimum: -1609.5694229824192 > -1996.0347263216586
END: th(41774.29950251503)=-1996.0347263216586; dx=-0.007629213698357461 evalInputDelta=386.4653033392394
Fitness changed from -1609.5694229824192 to -1996.0347263216586
Iteration 8 complete. Error: -1996.0347263216586 Total: 2.6664; Orientation: 0.2775; Line Search: 1.8169
Adding measurement c0c9462 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.609e+05, gradient 3.306e-01, dot -0.151; [4d25761f-8f77-4137-b959-4791dd75192e = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1996.0347263216586, -313.7860191370801, -201.04733691190737, -110.14939251704932
LBFGS Accumulation History: 3 points
Removed measurement c0c9462 to history. Total: 3
th(0)=-1996.0347263216586;dx=-0.1091052419424515
Armijo: th(90000.00000000004)=-1257.3890288503073; dx=0.00279507907583126 evalInputDelta=-738.6456974713512
New Minimum: -1996.0347263216586 > -2290.969417959212
END: th(45000.00000000002)=-2290.969417959212; dx=-0.00646400040132737 evalInputDelta=294.93469163755344
Fitness changed from -1996.0347263216586 to -2290.969417959212
Iteration 9 complete. Error: -2290.969417959212 Total: 2.6631; Orientation: 0.2881; Line Search: 1.8023
Adding measurement 4938b33b to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.844e+04, gradient 3.369e-01, dot -0.044; [4d25761f-8f77-4137-b959-4791dd75192e = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2290.969417959212, -313.7860191370801, -201.04733691190737, -110.14939251704932
LBFGS Accumulation History: 3 points
Removed measurement 4938b33b to history. Total: 3
th(0)=-2290.969417959212;dx=-0.11319738986392248
Armijo: th(96949.56105143482)=-1270.0766596775536; dx=0.003294606838906951 evalInputDelta=-1020.8927582816584
New Minimum: -2290.969417959212 > -2501.5242287668166
END: th(48474.78052571741)=-2501.5242287668166; dx=-0.00630076600129364 evalInputDelta=210.55481080760455
Fitness changed from -2290.969417959212 to -2501.5242287668166
Iteration 10 complete. Error: -2501.5242287668166 Total: 2.6731; Orientation: 0.2893; Line Search: 1.8429
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/dad0fedf-d9ca-4e28-9401-bfccdf4fe9d9.jpg)
Adding measurement 6e4eab10 to history. Total: 3
Accepted: LBFGS Orientation magnitude: 5.595e+04, gradient 3.464e-01, dot 0.163; [4d25761f-8f77-4137-b959-4791dd75192e = 1.000/1.000e+00]
Constructing line search parameters: LBFGS+Trust
th(0)=-2501.5242287668166;dx=-3159.777206351301
Armijo: th(104435.74875628759)=-603.5148840407364; dx=0.013525210419827557 evalInputDelta=-1898.0093447260801
Armijo: th(52217.874378143795)=-603.6120548099343; dx=0.027040897576226894 evalInputDelta=-1897.9121739568823
Armijo: th(17405.95812604793)=-603.7101476717771; dx=0.08108724327459445 evalInputDelta=-1897.8140810950395
Armijo: th(4351.489531511983)=-604.0734450137263; dx=0.3244597658654757 evalInputDelta=-1897.4507837530903
Armijo: th(870.2979063023965)=-609.7746424101874; dx=1.6110013511692096 evalInputDelta=-1891.7495863566292
Armijo: th(145.04965105039943)=-634.8685482496096; dx=9.431930594201226 evalInputDelta=-1866.655680517207
Armijo: th(20.72137872148563)=-754.1536733458306; dx=57.93905206704112 evalInputDelta=-1747.370555420986
Armijo: th(2.590172340185704)=-1207.8561906295213; dx=256.67646045338097 evalInputDelta=-1293.6680381372953
Armijo: th(0.28779692668730045)=-2197.395006679775; dx=213.88741369302082 evalInputDelta=-304.1292220870414
Armijo: th(0.028779692668730046)=-2484.3216206421876; dx=-498.30663525872944 evalInputDelta=-17.202608124629023
Armijo: th(0.002616335697157277)=-2500.236001564459; dx=-654.2564947952687 evalInputDelta=-1.2882272023575752
Armijo: th(2.180279747631064E-4)=-2501.4189038303584; dx=-675.5172854652828 evalInputDelta=-0.10532493645814611
Armijo: th(1.6771382674085107E-5)=-2501.516216424774; dx=-671.8386354548215 evalInputDelta=-0.00801234204254797
Armijo: th(1.1979559052917934E-6)=-2501.5238370440384; dx=-672.468928469597 evalInputDelta=-3.917227782039845E-4
Armijo: th(7.986372701945289E-8)=-2501.524104072847; dx=-677.2166572076958 evalInputDelta=-1.246939696102345E-4
Armijo: th(4.9914829387158055E-9)=-2501.5242287668166; dx=-676.9029894292089 evalInputDelta=0.0
Armijo: th(2.936166434538709E-10)=-2501.5242287668166; dx=-676.628110151351 evalInputDelta=0.0
MIN ALPHA (1.6312035747437272E-11): th(0.0)=-2501.5242287668166
Fitness changed from -2501.5242287668166 to -2501.5242287668166
Static Iteration Total: 12.6793; Orientation: 0.2860; Line Search: 11.8203
Iteration 11 failed. Error: -2501.5242287668166
Previous Error: 0.0 -> -2501.5242287668166
Retrying iteration 11
Reset training subject: 215477130044800
Adding measurement 1241ef8b to history. Total: 0
LBFGS Accumulation History: 1 points
th(0)=-2501.5242287668166;dx=-0.11984335683829735
END: th(2.1544346900318838E-10)=-2501.5242287668166; dx=-0.08882537957968314 evalInputDelta=0.0
Fitness changed from -2501.5242287668166 to -2501.5242287668166
Static Iteration Total: 2.8555; Orientation: 0.0156; Line Search: 1.1603
Iteration 12 failed. Error: -2501.5242287668166
Previous Error: 0.0 -> -2501.5242287668166
Optimization terminated 12
Final threshold in iteration 12: -2501.5242287668166 (> -Infinity) after 43.270s (< 5400.000s)
Returns
-2501.5242287668166