BasicOptimizer.scala:89 executed in 123.69 seconds (2.011 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: 2102726409032
Reset training subject: 2103843888464
Adding measurement f48386f to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-0.8084159198891104;dx=-5.783841282689803E-5
New Minimum: -0.8084159198891104 > -0.8085661452988346
WOLFE (weak): th(2.154434690031884)=-0.8085661452988346; dx=-5.784247959382015E-5 evalInputDelta=1.5022540972420284E-4
New Minimum: -0.8085661452988346 > -0.8087169155852505
WOLFE (weak): th(4.308869380063768)=-0.8087169155852505; dx=-5.784885851641934E-5 evalInputDelta=3.009956961400606E-4
New Minimum: -0.8087169155852505 > -0.8093190290302622
WOLFE (weak): th(12.926608140191302)=-0.8093190290302622; dx=-5.787541196119924E-5 evalInputDelta=9.0310914115177E-4
New Minimum: -0.8093190290302622 > -0.8120317994182413
WOLFE (weak): th(51.70643256076521)=-0.8120317994182413; dx=-5.784667035415847E-5 evalInputDelta=0.0036158795291308943
New Minimum: -0.8120317994182413 > -0.8264725315469572
WOLFE (weak): th(258.53216280382605)=-0.8264725315469572; dx=-5.8037177807216704E-5 evalInputDelta=0.018056611657846777
New Minimum: -0.8264725315469572 > -0.9165762444726185
WOLFE (weak): th(1551.1929768229563)=-0.9165762444726185; dx=-5.672366251771455E-5 evalInputDelta=0.1081603245835081
New Minimum: -0.9165762444726185 > -1.4111908745927895
END: th(10858.350837760694)=-1.4111908745927895; dx=-2.5748344033969964E-5 evalInputDelta=0.602774954703679
Fitness changed from -0.8084159198891104 to -1.4111908745927895
Iteration 1 complete. Error: -1.4111908745927895 Total: 12.1094; Orientation: 0.0190; Line Search: 8.8621
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>
Adding measurement 575c3099 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-1.4111908745927895;dx=-5.660801358644008E-5
New Minimum: -1.4111908745927895 > -2.1212038106901727
END: th(23393.607721408407)=-2.1212038106901727; dx=-1.908622143171531E-5 evalInputDelta=0.7100129360973833
Fitness changed from -1.4111908745927895 to -2.1212038106901727
Iteration 2 complete. Error: -2.1212038106901727 Total: 3.3315; Orientation: 0.0188; Line Search: 2.2327
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>
Adding measurement 427cd628 to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-2.1212038106901727;dx=-1.3590495598357548E-4
New Minimum: -2.1212038106901727 > -3.7127855416843882
END: th(50400.00000000001)=-3.7127855416843882; dx=-8.718381930591645E-6 evalInputDelta=1.5915817309942155
Fitness changed from -2.1212038106901727 to -3.7127855416843882
Iteration 3 complete. Error: -3.7127855416843882 Total: 3.3274; Orientation: 0.0202; Line Search: 2.2338
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>
Adding measurement 26306820 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.921e+03, gradient 1.854e-02, dot -0.170; [eb2b128c-5c1b-43f2-9a16-a33b40b76610 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -3.7127855416843882, -2.1212038106901727, -1.4111908745927895, -0.8084159198891104
LBFGS Accumulation History: 3 points
Removed measurement 26306820 to history. Total: 3
th(0)=-3.7127855416843882;dx=-3.4339884151145803E-4
New Minimum: -3.7127855416843882 > -6.706772276547481
END: th(108583.50837760697)=-6.706772276547481; dx=-1.1888277092496396E-5 evalInputDelta=2.9939867348630926
Fitness changed from -3.7127855416843882 to -6.706772276547481
Iteration 4 complete. Error: -6.706772276547481 Total: 3.8044; Orientation: 0.4743; Line Search: 2.2349
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>
Adding measurement 10ccfcfb to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.720e+03, gradient 2.119e-02, dot -0.092; [eb2b128c-5c1b-43f2-9a16-a33b40b76610 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -6.706772276547481, -2.1212038106901727, -1.4111908745927895, -0.8084159198891104
LBFGS Accumulation History: 3 points
Removed measurement 10ccfcfb to history. Total: 3
th(0)=-6.706772276547481;dx=-4.480665545277252E-4
New Minimum: -6.706772276547481 > -13.13297012418994
END: th(233936.07721408413)=-13.13297012418994; dx=-6.1225504389740706E-6 evalInputDelta=6.4261978476424595
Fitness changed from -6.706772276547481 to -13.13297012418994
Iteration 5 complete. Error: -13.13297012418994 Total: 3.7986; Orientation: 0.4927; Line Search: 2.2091
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>
Adding measurement 7905ccc9 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.690e+03, gradient 2.382e-02, dot -0.057; [eb2b128c-5c1b-43f2-9a16-a33b40b76610 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -13.13297012418994, -2.1212038106901727, -1.4111908745927895, -0.8084159198891104
LBFGS Accumulation History: 3 points
Removed measurement 7905ccc9 to history. Total: 3
th(0)=-13.13297012418994;dx=-5.637488489673586E-4
New Minimum: -13.13297012418994 > -14.620918981518901
WOLF (strong): th(504000.0000000002)=-14.620918981518901; dx=9.022986743034904E-6 evalInputDelta=1.487948857328961
New Minimum: -14.620918981518901 > -24.51848693738165
WOLF (strong): th(252000.0000000001)=-24.51848693738165; dx=4.1597222441135845E-6 evalInputDelta=11.385516813191709
New Minimum: -24.51848693738165 > -28.440658565167958
END: th(84000.00000000003)=-28.440658565167958; dx=-3.893175801024251E-5 evalInputDelta=15.307688440978017
Fitness changed from -13.13297012418994 to -28.440658565167958
Iteration 6 complete. Error: -28.440658565167958 Total: 6.0940; Orientation: 0.5515; Line Search: 4.4627
Adding measurement fa30db5 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.513e+06, gradient 3.419e-02, dot -0.059; [eb2b128c-5c1b-43f2-9a16-a33b40b76610 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -28.440658565167958, -2.1212038106901727, -1.4111908745927895, -0.8084159198891104
LBFGS Accumulation History: 3 points
Removed measurement fa30db5 to history. Total: 3
th(0)=-28.440658565167958;dx=-0.0011659304568542553
New Minimum: -28.440658565167958 > -30.614971359047882
WOLF (strong): th(180972.5139626783)=-30.614971359047882; dx=3.0521459216537166E-5 evalInputDelta=2.174312793879924
New Minimum: -30.614971359047882 > -40.365290059539966
WOLF (strong): th(90486.25698133915)=-40.365290059539966; dx=3.0624154824723917E-6 evalInputDelta=11.924631494372008
New Minimum: -40.365290059539966 > -42.744149531055136
END: th(30162.08566044638)=-42.744149531055136; dx=-2.1530355608033078E-4 evalInputDelta=14.303490965887178
Fitness changed from -28.440658565167958 to -42.744149531055136
Iteration 7 complete. Error: -42.744149531055136 Total: 6.0679; Orientation: 0.4649; Line Search: 4.5379
Adding measurement 186ce6f4 to history. Total: 3
Accepted: LBFGS Orientation magnitude: 7.832e+03, gradient 3.869e-02, dot 0.129; [eb2b128c-5c1b-43f2-9a16-a33b40b76610 = 1.000/1.000e+00]
Constructing line search parameters: LBFGS+Trust
th(0)=-42.744149531055136;dx=-39.17268568944927
Armijo: th(64982.24367057892)=-9.507114073817615; dx=5.9150113647483623E-5 evalInputDelta=-33.237035457237525
Armijo: th(32491.12183528946)=-9.51080708081627; dx=1.1593454239332705E-4 evalInputDelta=-33.233342450238865
Armijo: th(10830.373945096488)=-9.525815013250078; dx=3.542066861493394E-4 evalInputDelta=-33.21833451780506
Armijo: th(2707.593486274122)=-9.611565705394021; dx=0.0013939397547484548 evalInputDelta=-33.132583825661115
Armijo: th(541.5186972548244)=-9.533981174884786; dx=0.0077946279235965605 evalInputDelta=-33.21016835617035
Armijo: th(90.25311620913739)=-9.25706255719336; dx=0.048476119551869756 evalInputDelta=-33.48708697386178
Armijo: th(12.893302315591056)=-12.891357932871657; dx=0.6711947774144089 evalInputDelta=-29.85279159818348
New Minimum: -42.744149531055136 > -44.96139546027574
WOLF (strong): th(1.611662789448882)=-44.96139546027574; dx=0.1145395030615246 evalInputDelta=2.217245929220603
New Minimum: -44.96139546027574 > -47.78820139544
...skipping 504 bytes...
9903
New Minimum: -47.78820139544592 > -48.379032514946346
END: th(0.3858024691358026)=-48.379032514946346; dx=-4.161698933028055 evalInputDelta=0.5908311195004288
Fitness changed from -47.78820139544592 to -48.379032514946346
Iteration 9 complete. Error: -48.379032514946346 Total: 3.9033; Orientation: 0.6036; Line Search: 2.2309
Adding measurement 7344e78a to history. Total: 5
Rejected: LBFGS Orientation magnitude: 3.171e+03, gradient 3.672e-02, dot -0.000; [eb2b128c-5c1b-43f2-9a16-a33b40b76610 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -48.379032514946346, -47.78820139544592, -42.744149531055136, -2.1212038106901727, -1.4111908745927895, -0.8084159198891104
Rejected: LBFGS Orientation magnitude: 6.167e+03, gradient 3.672e-02, dot -0.012; [eb2b128c-5c1b-43f2-9a16-a33b40b76610 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -48.379032514946346, -47.78820139544592, -42.744149531055136, -2.1212038106901727, -1.4111908745927895
Accepted: LBFGS Orientation magnitude: 2.180e+04, gradient 3.672e-02, dot 0.062; [eb2b128c-5c1b-43f2-9a16-a33b40b76610 = 1.000/1.000e+00]
Overwriting history with 4 points
th(0)=-48.379032514946346;dx=-49.29782676935737
Armijo: th(0.8311862230061282)=-38.41597434662421; dx=5.0144258639386985 evalInputDelta=-9.963058168322135
Armijo: th(0.4155931115030641)=-45.05384646634966; dx=-0.44049684327477534 evalInputDelta=-3.3251860485966844
New Minimum: -48.379032514946346 > -48.446451460913416
END: th(0.13853103716768803)=-48.446451460913416; dx=-11.2998339551445 evalInputDelta=0.06741894596706999
Fitness changed from -48.379032514946346 to -48.446451460913416
Iteration 10 complete. Error: -48.446451460913416 Total: 7.2017; Orientation: 1.6513; Line Search: 4.4844
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>
Adding measurement 51770336 to history. Total: 4
Accepted: LBFGS Orientation magnitude: 2.417e+04, gradient 3.366e-02, dot 0.049; [eb2b128c-5c1b-43f2-9a16-a33b40b76610 = 1.000/1.000e+00]
th(0)=-48.446451460913416;dx=-39.787381741581854
Armijo: th(0.29845607212016334)=-44.83163078098107; dx=-1.3259766043372696 evalInputDelta=-3.6148206799323432
Armijo: th(0.14922803606008167)=-47.11138478239712; dx=-7.633019699082502 evalInputDelta=-1.3350666785162986
Armijo: th(0.04974267868669389)=-48.147716465804244; dx=-13.979916313896014 evalInputDelta=-0.29873499510917156
Armijo: th(0.012435669671673472)=-48.39292948199441; dx=-16.223334281100723 evalInputDelta=-0.053521978919008006
Armijo: th(0.0024871339343346946)=-48.43611897078077; dx=-16.619075007860722 evalInputDelta=-0.010332490132647365
Armijo: th(4.1452232238911574E-4)=-48.444877053945774; dx=-16.747957061822213 evalInputDelta=-0.0015744069676415506
Armijo: th(5.9217474627016535E-5)=-48.44623214360711; dx=-16.75153269880486 evalInputDelta=-2.1931730630342372E-4
Armijo: th(7.402184328377067E-6)=-48.446422740846465; dx=-16.787391770230087 evalInputDelta=-2.872006695042728E-5
Armijo: th(8.224649253752297E-7)=-48.44644623908433; dx=-16.548111793990913 evalInputDelta=-5.221829084689489E-6
New Minimum: -48.446451460913416 > -48.44645407182775
END: th(8.224649253752297E-8)=-48.44645407182775; dx=-16.865986594569875 evalInputDelta=2.610914336287351E-6
Fitness changed from -48.446451460913416 to -48.44645407182775
Iteration 11 complete. Error: -48.44645407182775 Total: 13.9317; Orientation: 0.5558; Line Search: 12.2897
Adding measurement 3b33ce5f to history. Total: 5
Accepted: LBFGS Orientation magnitude: 7.985e+05, gradient 3.367e-02, dot 0.032; [eb2b128c-5c1b-43f2-9a16-a33b40b76610 = 1.000/1.000e+00]
th(0)=-48.44645407182775;dx=-868.9925147462478
Armijo: th(1.7719469665628796E-7)=-48.446422740846465; dx=-543.4965521075335 evalInputDelta=-3.133098128671463E-5
Armijo: th(8.859734832814398E-8)=-48.44643057359369; dx=-534.7556827169647 evalInputDelta=-2.3498234064334156E-5
Armijo: th(2.953244944271466E-8)=-48.44644101725468; dx=-536.6384583715569 evalInputDelta=-1.3054573074100517E-5
Armijo: th(7.383112360678665E-9)=-48.44644623908433; dx=-534.8681965009165 evalInputDelta=-7.83274342097684E-6
Armijo: th(1.476622472135733E-9)=-48.446448849998944; dx=-536.8054310277439 evalInputDelta=-5.221828807577822E-6
Armijo: th(2.461037453559555E-10)=-48.446448849998944; dx=-534.8521191325465 evalInputDelta=-5.221828807577822E-6
MIN ALPHA (3.5157677907993646E-11): th(0.0)=-48.44645407182775
Fitness changed from -48.44645407182775 to -48.44645407182775
Static Iteration Total: 10.6598; Orientation: 0.6630; Line Search: 8.9338
Iteration 12 failed. Error: -48.44645407182775
Previous Error: 0.0 -> -48.44645407182775
Retrying iteration 12
Reset training subject: 2190788962474
Adding measurement 31934854 to history. Total: 0
LBFGS Accumulation History: 1 points
th(0)=-48.44645407182775;dx=-0.0011313897454121808
WOLFE (weak): th(2.1544346900318838E-10)=-48.44645407182775; dx=-0.001078358759990003 evalInputDelta=0.0
WOLFE (weak): th(4.3088693800637676E-10)=-48.44645407182775; dx=-0.0010783650019240425 evalInputDelta=0.0
WOLFE (weak): th(1.2926608140191302E-9)=-48.44645407182775; dx=-0.0010782235906863996 evalInputDelta=0.0
WOLFE (weak): th(5.170643256076521E-9)=-48.44645407182775; dx=-0.0010783899789528928 evalInputDelta=0.0
WOLFE (weak): th(2.5853216280382606E-8)=-48.44645407182775; dx=-0.0010786504910905155 evalInputDelta=0.0
WOLFE (weak): th(1.5511929768229565E-7)=-48.44645407182775; dx=-0.0010786409973536624 evalInputDelta=0.0
WOLFE (weak): th(1.0858350837760695E-6)=-48.44645407182775; dx=-0.0010787038221759838 evalInputDelta=0.0
Armijo: th(8.686680670208556E-6)=-48.446451460913416; dx=-0.0010780892799785152 evalInputDelta=-2.610914336287351E-6
Armijo: th(4.886257876992313E-6)=-48.446448849998944; dx=-0.001078231643401431 evalInputDelta=-5.221828807577822E-6
Armijo: th(2.986046480384191E-6)=-48.446451460913416; dx=-0.0010780725529087286 evalInputDelta=-2.610914336287351E-6
Armijo: th(2.0359407820801304E-6)=-48.446448849998944; dx=-0.0010785778130380241 evalInputDelta=-5.221828807577822E-6
Armijo: th(1.5608879329281E-6)=-48.446448849998944; dx=-0.001078816422808416 evalInputDelta=-5.221828807577822E-6
WOLFE (weak): th(1.3233615083520847E-6)=-48.44645407182775; dx=-0.0010785601296587964 evalInputDelta=0.0
WOLFE (weak): th(1.4421247206400922E-6)=-48.44645407182775; dx=-0.0010782988279643847 evalInputDelta=0.0
WOLFE (weak): th(1.501506326784096E-6)=-48.44645407182775; dx=-0.0010790263985725793 evalInputDelta=0.0
WOLFE (weak): th(1.531197129856098E-6)=-48.44645407182775; dx=-0.001078219378429322 evalInputDelta=0.0
WOLFE (weak): th(1.546042531392099E-6)=-48.44645407182775; dx=-0.001079233932328033 evalInputDelta=0.0
WOLFE (weak): th(1.5534652321600995E-6)=-48.44645407182775; dx=-0.001078688845279745 evalInputDelta=0.0
Armijo: th(1.5571765825440997E-6)=-48.446448849998944; dx=-0.0010779425478311508 evalInputDelta=-5.221828807577822E-6
WOLFE (weak): th(1.5553209073520996E-6)=-48.44645407182775; dx=-0.0010791283848738344 evalInputDelta=0.0
WOLFE (weak): th(1.5562487449480997E-6)=-48.44645407182775; dx=-0.0010785975663112624 evalInputDelta=0.0
WOLFE (weak): th(1.5567126637460998E-6)=-48.44645407182775; dx=-0.001078679158095063 evalInputDelta=0.0
Armijo: th(1.5569446231450998E-6)=-48.446448849998944; dx=-0.0010782701328711207 evalInputDelta=-5.221828807577822E-6
WOLFE (weak): th(1.5568286434455998E-6)=-48.44645407182775; dx=-0.0010783598325797754 evalInputDelta=0.0
Armijo: th(1.5568866332953498E-6)=-48.446448849998944; dx=-0.0010783914222454631 evalInputDelta=-5.221828807577822E-6
WOLFE (weak): th(1.5568576383704748E-6)=-48.44645407182775; dx=-0.0010782659027244173 evalInputDelta=0.0
Armijo: th(1.5568721358329122E-6)=-48.446448849998944; dx=-0.0010786981909554699 evalInputDelta=-5.221828807577822E-6
mu ~= nu (1.5568576383704748E-6): th(0.0)=-48.44645407182775
Fitness changed from -48.44645407182775 to -48.44645407182775
Static Iteration Total: 35.6290; Orientation: 0.0186; Line Search: 33.4900
Iteration 13 failed. Error: -48.44645407182775
Previous Error: 0.0 -> -48.44645407182775
Optimization terminated 13
Final threshold in iteration 13: -48.44645407182775 (> -Infinity) after 123.691s (< 3600.000s)
Returns
-48.44645407182775