BasicOptimizer.scala:89 executed in 208.19 seconds (2.188 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: 15658558219831
Reset training subject: 15662766264741
Adding measurement 31edbbb3 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-0.4236043691635132;dx=-6.421674542377625E-7
New Minimum: -0.4236043691635132 > -0.42360469698905945
END: th(2.154434690031884)=-0.42360469698905945; dx=-5.27297953806825E-7 evalInputDelta=3.2782554626464844E-7
Fitness changed from -0.4236043691635132 to -0.42360469698905945
Iteration 1 complete. Error: -0.42360469698905945 Total: 21.3365; Orientation: 0.0453; Line Search: 8.4684
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/d1cbbbff-c911-4963-a2b8-c0998460e173.jpg)
Adding measurement 524dc77b to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-0.42360469698905945;dx=-5.273315196358531E-7
New Minimum: -0.42360469698905945 > -0.42360612750053406
WOLFE (weak): th(4.641588833612779)=-0.42360612750053406; dx=-5.27283987142089E-7 evalInputDelta=1.430511474609375E-6
New Minimum: -0.42360612750053406 > -0.42360733449459076
WOLFE (weak): th(9.283177667225559)=-0.42360733449459076; dx=-5.272813783037535E-7 evalInputDelta=2.637505531311035E-6
New Minimum: -0.42360733449459076 > -0.4236123412847519
WOLFE (weak): th(27.849533001676676)=-0.4236123412847519; dx=-5.272802464345828E-7 evalInputDelta=7.644295692443848E-6
New Minimum: -0.4236123412847519 > -0.4236341714859009
WOLFE (weak): th(111.3981320067067)=-0.4236341714859009; dx=-5.272533849552342E-7 evalInputDelta=2.9474496841430664E-5
New Minimum: -0.4236341714859009 > -0.42375175654888153
WOLFE (weak): th(556.9906600335335)=-0.42375175654888153; dx=-5.272087043415464E-7 evalInputDelta=1.4705955982208252E-4
New Minimum: -0.42375175654888153 > -0.4244855046272278
WOLFE (weak): th(3341.9439602012008)=-0.4244855046272278; dx=-5.267360570339014E-7 evalInputDelta=8.80807638168335E-4
New Minimum: -0.4244855046272278 > -0.429752916097641
WOLFE (weak): th(23393.607721408407)=-0.429752916097641; dx=-5.239747327841129E-7 evalInputDelta=0.006148219108581543
New Minimum: -0.429752916097641 > -0.4716210663318634
WOLFE (weak): th(187148.86177126726)=-0.4716210663318634; dx=-4.985197039607622E-7 evalInputDelta=0.048016369342803955
New Minimum: -0.4716210663318634 > -0.7548180520534515
END: th(1684339.7559414054)=-0.7548180520534515; dx=-2.7194384096941173E-7 evalInputDelta=0.3312133550643921
Fitness changed from -0.42360469698905945 to -0.7548180520534515
Iteration 2 complete. Error: -0.7548180520534515 Total: 48.6268; Orientation: 0.0560; Line Search: 43.5649
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/ad9a3842-b3fe-4c87-9f6c-ba16a4de443f.jpg)
Adding measurement 157c65fc to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-0.7548180520534515;dx=-2.5350873798551285E-7
New Minimum: -0.7548180520534515 > -1.0790400058031082
END: th(3628800.0000000005)=-1.0790400058031082; dx=-1.2215936708761217E-7 evalInputDelta=0.3242219537496567
Fitness changed from -0.7548180520534515 to -1.0790400058031082
Iteration 3 complete. Error: -1.0790400058031082 Total: 13.3691; Orientation: 0.0461; Line Search: 8.8644
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>![Iteration 3](etc/56922e43-14ec-45ff-b866-0853efaf4204.jpg)
Adding measurement 3a4f9020 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.006e+03, gradient 3.630e-04, dot -0.679; [70c1594e-d83c-4de3-b4cd-0d4086d26765 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.0790400058031082, -0.7548180520534515, -0.42360469698905945, -0.4236043691635132
LBFGS Accumulation History: 3 points
Removed measurement 3a4f9020 to history. Total: 3
th(0)=-1.0790400058031082;dx=-1.3175298712196817E-7
New Minimum: -1.0790400058031082 > -1.3905723839998245
END: th(7818012.603187701)=-1.3905723839998245; dx=-4.4477108879603525E-8 evalInputDelta=0.3115323781967163
Fitness changed from -1.0790400058031082 to -1.3905723839998245
Iteration 4 complete. Error: -1.3905723839998245 Total: 14.5571; Orientation: 1.4415; Line Search: 8.6760
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>![Iteration 4](etc/77f1fc17-32c5-42be-bbec-ade9282be06f.jpg)
Adding measurement e80f0c2 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.826e+03, gradient 2.887e-04, dot -0.507; [70c1594e-d83c-4de3-b4cd-0d4086d26765 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.3905723839998245, -0.7548180520534515, -0.42360469698905945, -0.4236043691635132
LBFGS Accumulation History: 3 points
Removed measurement e80f0c2 to history. Total: 3
th(0)=-1.3905723839998245;dx=-8.335311158123943E-8
New Minimum: -1.3905723839998245 > -1.6100334525108337
END: th(1.6843397559414055E7)=-1.6100334525108337; dx=-6.227723911164775E-10 evalInputDelta=0.21946106851100922
Fitness changed from -1.3905723839998245 to -1.6100334525108337
Iteration 5 complete. Error: -1.6100334525108337 Total: 13.8487; Orientation: 1.1416; Line Search: 8.3948
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>![Iteration 5](etc/dc33ffc2-b12e-485f-b73f-fe491fc84acb.jpg)
Adding measurement 34ce871f to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.269e+03, gradient 2.958e-04, dot -0.186; [70c1594e-d83c-4de3-b4cd-0d4086d26765 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.6100334525108337, -0.7548180520534515, -0.42360469698905945, -0.4236043691635132
LBFGS Accumulation History: 3 points
Removed measurement 34ce871f to history. Total: 3
th(0)=-1.6100334525108337;dx=-8.75188974447295E-8
Armijo: th(3.628800000000001E7)=-1.4671206325292587; dx=3.2953325794068505E-8 evalInputDelta=-0.142912819981575
New Minimum: -1.6100334525108337 > -1.733381450176239
WOLF (strong): th(1.8144000000000004E7)=-1.733381450176239; dx=2.2085107560138507E-8 evalInputDelta=0.12334799766540527
New Minimum: -1.733381450176239 > -1.7637810707092285
END: th(6048000.000000001)=-1.7637810707092285; dx=-2.2111869038252604E-8 evalInputDelta=0.15374761819839478
Fitness changed from -1.6100334525108337 to -1.7637810707092285
Iteration 6 complete. Error: -1.7637810707092285 Total: 22.1851; Orientation: 1.0338; Line Search: 17.0161
Adding measurement 6411d608 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.900e+03, gradient 1.850e-04, dot -0.396; [70c1594e-d83c-4de3-b4cd-0d4086d26765 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.7637810707092285, -0.7548180520534515, -0.42360469698905945, -0.4236043691635132
LBFGS Accumulation History: 3 points
Removed measurement 6411d608 to history. Total: 3
th(0)=-1.7637810707092285;dx=-3.4211498977448414E-8
New Minimum: -1.7637810707092285 > -1.8881243616342545
END: th(1.3030021005312836E7)=-1.8881243616342545; dx=-6.40486016046529E-9 evalInputDelta=0.12434329092502594
Fitness changed from -1.7637810707092285 to -1.8881243616342545
Iteration 7 complete. Error: -1.8881243616342545 Total: 14.1701; Orientation: 1.0156; Line Search: 8.7889
Adding measurement 7d8d84ab to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.045e+03, gradient 1.872e-04, dot -0.346; [70c1594e-d83c-4de3-b4cd-0d4086d26765 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.8881243616342545, -0.7548180520534515, -0.42360469698905945, -0.4236043691635132
LBFGS Accumulation History: 3 points
Removed measurement 7d8d84ab to history. Total: 3
th(0)=-1.8881243616342545;dx=-3.505231311270931E-8
New Minimum: -1.8881243616342545 > -1.9061422795057297
WOLF (strong): th(2.8072329265690096E7)=-1.9061422795057297; dx=1.091064341682986E-8 evalInputDelta=0.01801791787147522
New Minimum: -1.9061422795057297 > -1.9614789932966232
WOLF (strong): th(1.4036164632845048E7)=-1.9614789932966232; dx=3.394384043586331E-9 evalInputDelta=0.07335463166236877
END: th(4678721.544281683)=-1.9442174434661865; dx=-1.4162567064310786E-8 evalInputDelta=0.05609308183193207
Fitness changed from -1.8881243616342545 to -1.9614789932966232
Iteration 8 complete. Error: -1.9614789932966232 Total: 23.6195; Orientation: 1.0137; Line Search: 18.1354
Adding measurement 886d2b5 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.937e+03, gradient 1.932e-04, dot -0.279; [70c1594e-d83c-4de3-b4cd-0d4086d26765 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.9614789932966232, -0.7548180520534515, -0.42360469698905945, -0.4236043691635132
LBFGS Accumulation History: 3 points
Removed measurement 886d2b5 to history. Total: 3
th(0)=-1.9614789932966232;dx=-3.7345202698064865E-8
New Minimum: -1.9614789932966232 > -2.0415980517864227
WOLF (strong): th(1.0080000000000004E7)=-2.0415980517864227; dx=2.1033760522553466E-9 evalInputDelta=0.0801190584897995
END: th(5040000.000000002)=-2.0264719873666763; dx=-1.4868342701269836E-8 evalInputDelta=0.0649929940700531
Fitness changed from -1.9614789932966232 to -2.0415980517864227
Iteration 9 complete. Error: -2.0415980517864227 Total: 17.6981; Orientation: 1.0076; Line Search: 12.6407
Adding measurement 230209ad to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.178e+03, gradient 1.585e-04, dot -0.338; [70c1594e-d83c-4de3-b4cd-0d4086d26765 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -2.0415980517864227, -0.7548180520534515, -0.42360469698905945, -0.4236043691635132
LBFGS Accumulation History: 3 points
Removed measurement 230209ad to history. Total: 3
th(0)=-2.0415980517864227;dx=-2.5113508032521947E-8
New Minimum: -2.0415980517864227 > -2.0961680710315704
WOLF (strong): th(1.0858350837760698E7)=-2.0961680710315704; dx=4.953852916780028E-10 evalInputDelta=0.054570019245147705
END: th(5429175.418880349)=-2.0863151997327805; dx=-8.563442807241894E-9 evalInputDelta=0.04471714794635773
Fitness changed from -2.0415980517864227 to -2.0961680710315704
Iteration 10 complete. Error: -2.0961680710315704 Total: 18.7055; Orientation: 1.4115; Line Search: 13.0770
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/74b10efe-eeff-47f6-80dc-002a2056ef30.jpg)
Final threshold in iteration 11: -2.0961680710315704 (> -Infinity) after 208.191s (< 5400.000s)
Returns
-2.0961680710315704