BasicOptimizer.scala:89 executed in 48.39 seconds (0.986 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: 137312704311600
Reset training subject: 137313996820900
Adding measurement 4f944ff5 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-2.1888536603985327;dx=-1.1858346526089082E-5
New Minimum: -2.1888536603985327 > -2.1888783184414757
WOLFE (weak): th(2.154434690031884)=-2.1888783184414757; dx=-1.1677862243534667E-5 evalInputDelta=2.465804294304874E-5
New Minimum: -2.1888783184414757 > -2.1889030768500155
WOLFE (weak): th(4.308869380063768)=-2.1889030768500155; dx=-1.1687671924423548E-5 evalInputDelta=4.941645148281992E-5
New Minimum: -2.1889030768500155 > -2.1890023089615296
WOLFE (weak): th(12.926608140191302)=-2.1890023089615296; dx=-1.1714900203823705E-5 evalInputDelta=1.4864856299690032E-4
New Minimum: -2.1890023089615296 > -2.1894489990435275
WOLFE (weak): th(51.70643256076521)=-2.1894489990435275; dx=-1.1713964680271528E-5 evalInputDelta=5.953386449948361E-4
New Minimum: -2.1894489990435275 > -2.1918316513411362
WOLFE (weak): th(258.53216280382605)=-2.1918316513411362; dx=-1.1691015589646158E-5 evalInputDelta=0.0029779909426035367
New Minimum: -2.1918316513411362 > -2.2067523690551516
WOLFE (weak): th(1551.1929768229563)=-2.2067523690551516; dx=-1.1835695385101499E-5 evalInputDelta=0.01789870865661891
New Minimum: -2.2067523690551516 > -2.314946538485267
WOLFE (weak): th(10858.350837760694)=-2.314946538485267; dx=-1.1771041166233343E-5 evalInputDelta=0.1260928780867343
New Minimum: -2.314946538485267 > -3.162996675378981
END: th(86866.80670208555)=-3.162996675378981; dx=-1.0227010334335886E-5 evalInputDelta=0.9741430149804482
Fitness changed from -2.1888536603985327 to -3.162996675378981
Iteration 1 complete. Error: -3.162996675378981 Total: 11.5034; Orientation: 0.0197; Line Search: 8.4068
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>
Adding measurement 354e6aaa to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-3.162996675378981;dx=-1.3185464780543618E-5
New Minimum: -3.162996675378981 > -5.011481016197922
END: th(187148.86177126726)=-5.011481016197922; dx=-7.3403661404614666E-6 evalInputDelta=1.848484340818941
Fitness changed from -3.162996675378981 to -5.011481016197922
Iteration 2 complete. Error: -5.011481016197922 Total: 3.0911; Orientation: 0.0183; Line Search: 2.0331
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>
Adding measurement 5a2c8199 to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-5.011481016197922;dx=-1.540679441495068E-5
New Minimum: -5.011481016197922 > -7.635503608941542
END: th(403200.00000000006)=-7.635503608941542; dx=-4.569130459955347E-6 evalInputDelta=2.6240225927436196
Fitness changed from -5.011481016197922 to -7.635503608941542
Iteration 3 complete. Error: -7.635503608941542 Total: 2.8436; Orientation: 0.0154; Line Search: 1.8707
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>
Adding measurement 75723fe1 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.550e+04, gradient 4.396e-03, dot -0.288; [3ac6d064-0dfa-41d5-ab36-c94f3de0489a = 1.000/1.000e+00]
Orientation rejected. Popping history element from -7.635503608941542, -5.011481016197922, -3.162996675378981, -2.1888536603985327
LBFGS Accumulation History: 3 points
Removed measurement 75723fe1 to history. Total: 3
th(0)=-7.635503608941542;dx=-1.9227728918870457E-5
New Minimum: -7.635503608941542 > -11.688485975237045
END: th(868668.0670208557)=-11.688485975237045; dx=-2.143609363918163E-6 evalInputDelta=4.052982366295503
Fitness changed from -7.635503608941542 to -11.688485975237045
Iteration 4 complete. Error: -11.688485975237045 Total: 3.2105; Orientation: 0.2901; Line Search: 1.8079
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>
Adding measurement 6bd3bb6 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.984e+04, gradient 4.177e-03, dot -0.192; [3ac6d064-0dfa-41d5-ab36-c94f3de0489a = 1.000/1.000e+00]
Orientation rejected. Popping history element from -11.688485975237045, -5.011481016197922, -3.162996675378981, -2.1888536603985327
LBFGS Accumulation History: 3 points
Removed measurement 6bd3bb6 to history. Total: 3
th(0)=-11.688485975237045;dx=-1.722743239061665E-5
New Minimum: -11.688485975237045 > -14.585868030801588
END: th(1871488.617712673)=-14.585868030801588; dx=-2.887283828017011E-7 evalInputDelta=2.8973820555645435
Fitness changed from -11.688485975237045 to -14.585868030801588
Iteration 5 complete. Error: -14.585868030801588 Total: 3.1768; Orientation: 0.3216; Line Search: 1.9083
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>
Adding measurement 5e0cc49d to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.883e+04, gradient 4.205e-03, dot -0.140; [3ac6d064-0dfa-41d5-ab36-c94f3de0489a = 1.000/1.000e+00]
Orientation rejected. Popping history element from -14.585868030801588, -5.011481016197922, -3.162996675378981, -2.1888536603985327
LBFGS Accumulation History: 3 points
Removed measurement 5e0cc49d to history. Total: 3
th(0)=-14.585868030801588;dx=-1.746514633935907E-5
New Minimum: -14.585868030801588 > -14.944990966725586
WOLF (strong): th(4032000.0000000014)=-14.944990966725586; dx=1.0804081859645636E-6 evalInputDelta=0.35912293592399713
New Minimum: -14.944990966725586 > -20.80633310883004
WOLF (strong): th(2016000.0000000007)=-20.80633310883004; dx=2.5527178736039537E-7 evalInputDelta=6.22046507802845
New Minimum: -20.80633310883004 > -21.560092404716045
END: th(672000.0000000002)=-21.560092404716045; dx=-5.517203620428304E-6 evalInputDelta=6.974224373914456
Fitness changed from -14.585868030801588 to -21.560092404716045
Iteration 6 complete. Error: -21.560092404716045 Total: 5.9245; Orientation: 0.2837; Line Search: 4.6881
Adding measurement 499579b9 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.874e+04, gradient 3.532e-03, dot -0.173; [3ac6d064-0dfa-41d5-ab36-c94f3de0489a = 1.000/1.000e+00]
Orientation rejected. Popping history element from -21.560092404716045, -5.011481016197922, -3.162996675378981, -2.1888536603985327
LBFGS Accumulation History: 3 points
Removed measurement 499579b9 to history. Total: 3
th(0)=-21.560092404716045;dx=-1.2297096441248272E-5
New Minimum: -21.560092404716045 > -26.769178280135858
END: th(1447780.1117014263)=-26.769178280135858; dx=-1.4095974682135698E-6 evalInputDelta=5.209085875419813
Fitness changed from -21.560092404716045 to -26.769178280135858
Iteration 7 complete. Error: -26.769178280135858 Total: 5.4488; Orientation: 0.5978; Line Search: 2.1591
Adding measurement 333b5a6e to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.410e+04, gradient 3.998e-03, dot -0.196; [3ac6d064-0dfa-41d5-ab36-c94f3de0489a = 1.000/1.000e+00]
Orientation rejected. Popping history element from -26.769178280135858, -5.011481016197922, -3.162996675378981, -2.1888536603985327
LBFGS Accumulation History: 3 points
Removed measurement 333b5a6e to history. Total: 3
th(0)=-26.769178280135858;dx=-1.5866707066210744E-5
Armijo: th(3119147.6961877886)=-22.782083673967808; dx=1.4459176594757418E-6 evalInputDelta=-3.98709460616805
New Minimum: -26.769178280135858 > -28.94934007752897
WOLF (strong): th(1559573.8480938943)=-28.94934007752897; dx=1.0120719304124318E-6 evalInputDelta=2.1801617973931116
New Minimum: -28.94934007752897 > -31.054322293919444
END: th(519857.94936463144)=-31.054322293919444; dx=-4.242918922560365E-6 evalInputDelta=4.285144013783587
Fitness changed from -26.769178280135858 to -31.054322293919444
Iteration 8 complete. Error: -31.054322293919444 Total: 4.8138; Orientation: 0.2756; Line Search: 3.5718
Adding measurement 66d2ed64 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.600e+04, gradient 3.188e-03, dot -0.239; [3ac6d064-0dfa-41d5-ab36-c94f3de0489a = 1.000/1.000e+00]
Orientation rejected. Popping history element from -31.054322293919444, -5.011481016197922, -3.162996675378981, -2.1888536603985327
LBFGS Accumulation History: 3 points
Removed measurement 66d2ed64 to history. Total: 3
th(0)=-31.054322293919444;dx=-1.008351860755315E-5
New Minimum: -31.054322293919444 > -33.8066030045593
END: th(1120000.0000000005)=-33.8066030045593; dx=-1.845870111369969E-6 evalInputDelta=2.7522807106398552
Fitness changed from -31.054322293919444 to -33.8066030045593
Iteration 9 complete. Error: -33.8066030045593 Total: 3.3211; Orientation: 0.2857; Line Search: 2.0526
Adding measurement 72f855b9 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 7.870e+05, gradient 3.719e-03, dot -0.253; [3ac6d064-0dfa-41d5-ab36-c94f3de0489a = 1.000/1.000e+00]
Orientation rejected. Popping history element from -33.8066030045593, -5.011481016197922, -3.162996675378981, -2.1888536603985327
LBFGS Accumulation History: 3 points
Removed measurement 72f855b9 to history. Total: 3
th(0)=-33.8066030045593;dx=-1.3690236040360854E-5
Armijo: th(2412966.852835711)=-29.911528034413212; dx=1.4973245426349718E-6 evalInputDelta=-3.895074970146087
New Minimum: -33.8066030045593 > -34.891112162401434
WOLF (strong): th(1206483.4264178555)=-34.891112162401434; dx=1.2767151430047065E-6 evalInputDelta=1.0845091578421346
New Minimum: -34.891112162401434 > -36.66481174993958
END: th(402161.14213928516)=-36.66481174993958; dx=-4.071892171332015E-6 evalInputDelta=2.8582087453802814
Fitness changed from -33.8066030045593 to -36.66481174993958
Iteration 10 complete. Error: -36.66481174993958 Total: 4.9354; Orientation: 0.2856; Line Search: 3.7828
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>
Final threshold in iteration 11: -36.66481174993958 (> -Infinity) after 48.393s (< 5400.000s)
Returns
-36.66481174993958