BasicOptimizer.scala:89 executed in 7.07 seconds (0.483 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: 137456225673600
Reset training subject: 137456362669800
Adding measurement 5ac3e5dd to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-3.2128442849165144;dx=-0.0021920003814306062
New Minimum: -3.2128442849165144 > -3.2183061776524413
WOLFE (weak): th(2.154434690031884)=-3.2183061776524413; dx=-0.0021492561221655767 evalInputDelta=0.005461892735926899
New Minimum: -3.2183061776524413 > -3.223811112241963
WOLFE (weak): th(4.308869380063768)=-3.223811112241963; dx=-0.002090910156881982 evalInputDelta=0.010966827325448403
New Minimum: -3.223811112241963 > -3.2460041287265384
WOLFE (weak): th(12.926608140191302)=-3.2460041287265384; dx=-0.0021752768615523038 evalInputDelta=0.033159843810024014
New Minimum: -3.2460041287265384 > -3.349656999534831
WOLFE (weak): th(51.70643256076521)=-3.349656999534831; dx=-0.002218879464006906 evalInputDelta=0.13681271461831646
New Minimum: -3.349656999534831 > -3.911399724771406
WOLFE (weak): th(258.53216280382605)=-3.911399724771406; dx=-0.0020422304506918587 evalInputDelta=0.6985554398548914
New Minimum: -3.911399724771406 > -8.708727419298151
END: th(1551.1929768229563)=-8.708727419298151; dx=-0.0015427458371284012 evalInputDelta=5.4958831343816374
Fitness changed from -3.2128442849165144 to -8.708727419298151
Iteration 1 complete. Error: -8.708727419298151 Total: 1.1735; Orientation: 0.0016; Line Search: 0.8101
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>
Adding measurement 7dbcd21e to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-8.708727419298151;dx=-0.003317556232911614
New Minimum: -8.708727419298151 > -19.204152265930308
END: th(3341.943960201201)=-19.204152265930308; dx=-0.0010634143074935343 evalInputDelta=10.495424846632156
Fitness changed from -8.708727419298151 to -19.204152265930308
Iteration 2 complete. Error: -19.204152265930308 Total: 0.3600; Orientation: 0.0015; Line Search: 0.2342
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>
Adding measurement 7e024172 to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-19.204152265930308;dx=-0.0034558501375271623
New Minimum: -19.204152265930308 > -31.480536732050005
END: th(7200.000000000001)=-31.480536732050005; dx=-4.8461057328284894E-4 evalInputDelta=12.276384466119698
Fitness changed from -19.204152265930308 to -31.480536732050005
Iteration 3 complete. Error: -31.480536732050005 Total: 0.3672; Orientation: 0.0015; Line Search: 0.2400
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>
Adding measurement 1d325399 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.063e+02, gradient 7.874e-02, dot -0.106; [09fe448b-2844-415f-acc3-accf018a47e4 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -31.480536732050005, -19.204152265930308, -8.708727419298151, -3.2128442849165144
LBFGS Accumulation History: 3 points
Removed measurement 1d325399 to history. Total: 3
th(0)=-31.480536732050005;dx=-0.005933619791785732
New Minimum: -31.480536732050005 > -38.675470362353835
END: th(15511.929768229566)=-38.675470362353835; dx=-5.240289694136454E-5 evalInputDelta=7.194933630303829
Fitness changed from -31.480536732050005 to -38.675470362353835
Iteration 4 complete. Error: -38.675470362353835 Total: 0.4113; Orientation: 0.0319; Line Search: 0.2502
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>
Adding measurement 72677442 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.565e+02, gradient 7.761e-02, dot -0.084; [09fe448b-2844-415f-acc3-accf018a47e4 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -38.675470362353835, -19.204152265930308, -8.708727419298151, -3.2128442849165144
LBFGS Accumulation History: 3 points
Removed measurement 72677442 to history. Total: 3
th(0)=-38.675470362353835;dx=-0.005748799844786049
Armijo: th(33419.43960201202)=-33.07352716713053; dx=1.855786630597307E-4 evalInputDelta=-5.601943195223306
New Minimum: -38.675470362353835 > -53.43758892502835
END: th(16709.71980100601)=-53.43758892502835; dx=-2.563130044350219E-4 evalInputDelta=14.762118562674516
Fitness changed from -38.675470362353835 to -53.43758892502835
Iteration 5 complete. Error: -53.43758892502835 Total: 0.5559; Orientation: 0.0310; Line Search: 0.3901
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>
Adding measurement 74ba4e0c to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.413e+03, gradient 8.014e-02, dot -0.085; [09fe448b-2844-415f-acc3-accf018a47e4 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -53.43758892502835, -19.204152265930308, -8.708727419298151, -3.2128442849165144
LBFGS Accumulation History: 3 points
Removed measurement 74ba4e0c to history. Total: 3
th(0)=-53.43758892502835;dx=-0.0061485253624141666
New Minimum: -53.43758892502835 > -72.25071189010544
WOLF (strong): th(36000.000000000015)=-72.25071189010544; dx=1.6179960922670198E-4 evalInputDelta=18.813122965077085
New Minimum: -72.25071189010544 > -83.31112664227932
END: th(18000.000000000007)=-83.31112664227932; dx=-4.99508443008317E-4 evalInputDelta=29.87353771725097
Fitness changed from -53.43758892502835 to -83.31112664227932
Iteration 6 complete. Error: -83.31112664227932 Total: 0.5392; Orientation: 0.0314; Line Search: 0.3719
Adding measurement 79ecdbd4 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.685e+03, gradient 6.052e-02, dot -0.132; [09fe448b-2844-415f-acc3-accf018a47e4 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -83.31112664227932, -19.204152265930308, -8.708727419298151, -3.2128442849165144
LBFGS Accumulation History: 3 points
Removed measurement 79ecdbd4 to history. Total: 3
th(0)=-83.31112664227932;dx=-0.003470480420798713
Armijo: th(38779.824420573925)=-75.92559417302212; dx=-2.319866089116744E-5 evalInputDelta=-7.3855324692572
New Minimum: -83.31112664227932 > -96.53856674047161
END: th(19389.912210286962)=-96.53856674047161; dx=-9.309475796200757E-4 evalInputDelta=13.22744009819229
Fitness changed from -83.31112664227932 to -96.53856674047161
Iteration 7 complete. Error: -96.53856674047161 Total: 0.5289; Orientation: 0.0327; Line Search: 0.3717
Adding measurement 8081fee to history. Total: 3
Rejected: LBFGS Orientation magnitude: 7.634e+04, gradient 6.717e-02, dot -0.156; [09fe448b-2844-415f-acc3-accf018a47e4 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -96.53856674047161, -19.204152265930308, -8.708727419298151, -3.2128442849165144
LBFGS Accumulation History: 3 points
Removed measurement 8081fee to history. Total: 3
th(0)=-96.53856674047161;dx=-0.004180781724647477
Armijo: th(41774.29950251503)=-80.92392236380007; dx=6.062274551969065E-5 evalInputDelta=-15.614644376671535
New Minimum: -96.53856674047161 > -104.73147948968767
END: th(20887.149751257515)=-104.73147948968767; dx=-5.005537215397634E-4 evalInputDelta=8.192912749216063
Fitness changed from -96.53856674047161 to -104.73147948968767
Iteration 8 complete. Error: -104.73147948968767 Total: 1.0769; Orientation: 0.0360; Line Search: 0.9149
Adding measurement 97b0417 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.888e+04, gradient 7.627e-02, dot -0.123; [09fe448b-2844-415f-acc3-accf018a47e4 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -104.73147948968767, -19.204152265930308, -8.708727419298151, -3.2128442849165144
LBFGS Accumulation History: 3 points
Removed measurement 97b0417 to history. Total: 3
th(0)=-104.73147948968767;dx=-0.005524350938904299
Armijo: th(45000.00000000002)=-46.50520632999822; dx=-4.732780389824634E-5 evalInputDelta=-58.226273159689455
Armijo: th(22500.00000000001)=-77.88937922545423; dx=-1.7361057796405965E-4 evalInputDelta=-26.842100264233437
New Minimum: -104.73147948968767 > -113.4558865979792
END: th(7500.000000000004)=-113.4558865979792; dx=-0.0020603021771495424 evalInputDelta=8.72440710829153
Fitness changed from -104.73147948968767 to -113.4558865979792
Iteration 9 complete. Error: -113.4558865979792 Total: 0.6452; Orientation: 0.0327; Line Search: 0.4920
Adding measurement 3988a1cd to history. Total: 3
Accepted: LBFGS Orientation magnitude: 1.509e+04, gradient 7.011e-02, dot 0.184; [09fe448b-2844-415f-acc3-accf018a47e4 = 1.000/1.000e+00]
Constructing line search parameters: LBFGS+Trust
th(0)=-113.4558865979792;dx=-188.55692371818327
Armijo: th(16158.260175239137)=-92.02744763683994; dx=0.0022724589610359372 evalInputDelta=-21.428438961139264
Armijo: th(8079.130087619568)=-92.02628395592977; dx=0.004657270131910262 evalInputDelta=-21.42960264204943
Armijo: th(2693.043362539856)=-91.92262722620211; dx=0.014123821609328542 evalInputDelta=-21.533259371777092
Armijo: th(673.260840634964)=-91.91176496335085; dx=0.05455263834070574 evalInputDelta=-21.544121634628354
Armijo: th(134.6521681269928)=-93.82004281367568; dx=0.27614972343580696 evalInputDelta=-19.635843784303518
Armijo: th(22.442028021165466)=-96.65194486936642; dx=1.7689579923353471 evalInputDelta=-16.803941728612784
Armijo: th(3.206004003023638)=-97.54385869990247; dx=6.369259550778514 evalInputDelta=-15.91202789807673
Armijo: th(0.40075050037795473)=-108.9038408862639; dx=-16.32931094248686 evalInputDelta=-4.552045711715309
New Minimum: -113.4558865979792 > -118.165805319024
END: th(0.044527833375328306)=-118.165805319024; dx=-84.45678767957821 evalInputDelta=4.709918721044801
Fitness changed from -113.4558865979792 to -118.165805319024
Iteration 10 complete. Error: -118.165805319024 Total: 1.3941; Orientation: 0.0351; Line Search: 1.2388
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>
Final threshold in iteration 11: -118.165805319024 (> -Infinity) after 7.066s (< 5400.000s)
Returns
-118.165805319024