Code from BasicOptimizer.scala:88 executed in 1997.40 seconds (5.294 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: 12233800506276
Reset training subject: 12285194915961
Adding measurement 1b5d2274 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=3.964675724506378;dx=-4.140492727196212E-7
New Minimum: 3.964675724506378 > 3.9646745324134827
WOLFE (weak): th(2.154434690031884)=3.9646745324134827; dx=-3.8894765162447456E-7 evalInputDelta=1.1920928955078125E-6
New Minimum: 3.9646745324134827 > 3.9646725058555603
WOLFE (weak): th(4.308869380063768)=3.9646725058555603; dx=-3.908603999452223E-7 evalInputDelta=3.2186508178710938E-6
New Minimum: 3.9646725058555603 > 3.9646669179201126
WOLFE (weak): th(12.926608140191302)=3.9646669179201126; dx=-3.9114685895342245E-7 evalInputDelta=8.806586265563965E-6
New Minimum: 3.9646669179201126 > 3.9646396338939667
WOLFE (weak): th(51.70643256076521)=3.9646396338939667; dx=-3.9078654342809905E-7 evalInputDelta=3.6090612411499023E-5
New Minimum: 3.9646396338939667 > 3.9644955545663834
WOLFE (weak): th(258.53216280382605)=3.9644955545663834; dx=-3.9119557124424495E-7 evalInputDelta=1.80169939994812E-4
New Minimum: 3.9644955545663834 > 3.9635967165231705
WOLFE (weak): th(1551.1929768229563)=3.9635967165231705; dx=-3.894902704221804E-7 evalInputDelta=0.0010790079832077026
New Minimum: 3.9635967165231705 > 3.957135260105133
WOLFE (weak): th(10858.350837760694)=3.957135260105133; dx=-3.8768577344250755E-7 evalInputDelta=0.007540464401245117
New Minimum: 3.957135260105133 > 3.904959514737129
WOLFE (weak): th(86866.80670208555)=3.904959514737129; dx=-3.788040851752497E-7 evalInputDelta=0.05971620976924896
New Minimum: 3.904959514737129 > 3.50344280898571
END: th(781801.26031877)=3.50344280898571; dx=-2.7667059368926526E-7 evalInputDelta=0.46123291552066803
Fitness changed from 3.964675724506378 to 3.50344280898571
Iteration 1 complete. Error: 3.50344280898571 Total: 660.1457; Orientation: 0.0496; Line Search: 507.3372
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/288632c2-660a-4c9a-b70c-0255ca41d58a.jpg)
...skipping 3832 bytes...
Fitness changed from 1.5313830971717834 to 1.237004116177559
Iteration 6 complete. Error: 1.237004116177559 Total: 203.8206; Orientation: 1.2460; Line Search: 151.2830
Adding measurement 75ee963 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 4.751e+03, gradient 3.247e-04, dot -0.405; [87f17330-1828-4ecf-8ea9-3016d25bbaac = 1.000/1.000e+00]
Orientation rejected. Popping history element from 1.237004116177559, 2.9293162524700165, 3.50344280898571, 3.964675724506378
LBFGS Accumulation History: 3 points
Removed measurement 75ee963 to history. Total: 3
th(0)=1.237004116177559;dx=-1.0717915365015534E-7
Armijo: th(9772515.753984625)=1.4770521223545074; dx=-1.3263493796409993E-9 evalInputDelta=-0.24004800617694855
New Minimum: 1.237004116177559 > 0.9836936444044113
END: th(4886257.876992312)=0.9836936444044113; dx=-1.8779142628112502E-8 evalInputDelta=0.2533104717731476
Fitness changed from 1.237004116177559 to 0.9836936444044113
Iteration 7 complete. Error: 0.9836936444044113 Total: 205.9153; Orientation: 1.2544; Line Search: 152.6792
Adding measurement 6afba36a to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.048e+03, gradient 2.864e-04, dot -0.408; [87f17330-1828-4ecf-8ea9-3016d25bbaac = 1.000/1.000e+00]
Orientation rejected. Popping history element from 0.9836936444044113, 2.9293162524700165, 3.50344280898571, 3.964675724506378
LBFGS Accumulation History: 3 points
Removed measurement 6afba36a to history. Total: 3
th(0)=0.9836936444044113;dx=-8.094170043986734E-8
Armijo: th(1.0527123474633783E7)=1.2697038799524307; dx=-6.409078988545693E-12 evalInputDelta=-0.2860102355480194
New Minimum: 0.9836936444044113 > 0.7784217894077301
END: th(5263561.737316892)=0.7784217894077301; dx=-1.8826336738413817E-8 evalInputDelta=0.2052718549966812
Fitness changed from 0.9836936444044113 to 0.7784217894077301
Iteration 8 complete. Error: 0.7784217894077301 Total: 203.9957; Orientation: 1.2621; Line Search: 152.3747
Final threshold in iteration 8: 0.7784217894077301 (> -Infinity) after 1997.401s (< 1800.000s)
0.7784217894077301