Code from BasicOptimizer.scala:88 executed in 67.00 seconds (3.833 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: 1183810026453
Reset training subject: 1185450959129
Adding measurement 7e0fbecb to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=24.8374389288947;dx=-1.3853729470222498E-6
New Minimum: 24.8374389288947 > 24.837432271800935
WOLFE (weak): th(2.154434690031884)=24.837432271800935; dx=-1.3738604502168938E-6 evalInputDelta=6.6570937633514404E-6
New Minimum: 24.837432271800935 > 24.83742553042248
WOLFE (weak): th(4.308869380063768)=24.83742553042248; dx=-1.3961396883992452E-6 evalInputDelta=1.3398472219705582E-5
New Minimum: 24.83742553042248 > 24.837399151176214
WOLFE (weak): th(12.926608140191302)=24.837399151176214; dx=-1.3731020438499412E-6 evalInputDelta=3.97777184844017E-5
New Minimum: 24.837399151176214 > 24.837279507424682
WOLFE (weak): th(51.70643256076521)=24.837279507424682; dx=-1.4014709054012245E-6 evalInputDelta=1.5942147001624107E-4
New Minimum: 24.837279507424682 > 24.83664231747389
WOLFE (weak): th(258.53216280382605)=24.83664231747389; dx=-1.396084267006771E-6 evalInputDelta=7.966114208102226E-4
New Minimum: 24.83664231747389 > 24.8326543928124
WOLFE (weak): th(1551.1929768229563)=24.8326543928124; dx=-1.3998518091563622E-6 evalInputDelta=0.0047845360822975636
New Minimum: 24.8326543928124 > 24.803615181706846
WOLFE (weak): th(10858.350837760694)=24.803615181706846; dx=-1.4121512250209736E-6 evalInputDelta=0.03382374718785286
New Minimum: 24.803615181706846 > 24.550610384903848
WOLFE (weak): th(86866.80670208555)=24.550610384903848; dx=-1.4665715726113734E-6 evalInputDelta=0.28682854399085045
New Minimum: 24.550610384903848 > 22.316879438236356
END: th(781801.26031877)=22.316879438236356; dx=-1.0271909570919986E-6 evalInputDelta=2.520559490658343
Fitness changed from 24.8374389288947 to 22.316879438236356
Iteration 1 complete. Error: 22.316879438236356 Total: 19.3635; Orientation: 0.0366; Line Search: 14.9558
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/d4e5be80-1b97-421d-95f1-c304970076bb.jpg)
Addi
...skipping 5878 bytes...
3
Rejected: LBFGS Orientation magnitude: 8.228e+03, gradient 7.057e-04, dot -0.075; [6a65ea1f-ea8c-417d-9710-3c564f270072 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 1.4676234126091003, 16.42116315662861, 22.316879438236356, 24.8374389288947
LBFGS Accumulation History: 3 points
Removed measurement 7b95cf07 to history. Total: 3
th(0)=1.4676234126091003;dx=-4.689202865198506E-7
Armijo: th(1.5120000000000004E7)=5.049025118350983; dx=7.007424576777529E-8 evalInputDelta=-3.5814017057418823
Armijo: th(7560000.000000002)=3.459246426820755; dx=1.3329274584702067E-7 evalInputDelta=-1.9916230142116547
Armijo: th(2520000.0000000005)=1.4832713901996613; dx=8.089295520544965E-8 evalInputDelta=-0.015647977590560913
New Minimum: 1.4676234126091003 > 1.2326342910528183
END: th(630000.0000000001)=1.2326342910528183; dx=-1.544543872424362E-7 evalInputDelta=0.23498912155628204
Fitness changed from 1.4676234126091003 to 1.2326342910528183
Iteration 9 complete. Error: 1.2326342910528183 Total: 8.7845; Orientation: 0.0576; Line Search: 7.3914
Adding measurement 2e8f38d7 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.248e+03, gradient 4.135e-04, dot -0.093; [6a65ea1f-ea8c-417d-9710-3c564f270072 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 1.2326342910528183, 16.42116315662861, 22.316879438236356, 24.8374389288947
LBFGS Accumulation History: 3 points
Removed measurement 2e8f38d7 to history. Total: 3
th(0)=1.2326342910528183;dx=-1.6535983228496125E-7
New Minimum: 1.2326342910528183 > 1.0154879838228226
END: th(1357293.854720087)=1.0154879838228226; dx=-8.504008969596954E-8 evalInputDelta=0.21714630722999573
Fitness changed from 1.2326342910528183 to 1.0154879838228226
Iteration 10 complete. Error: 1.0154879838228226 Total: 3.8307; Orientation: 0.0942; Line Search: 2.4958
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/b89ee7d7-e9b2-4646-8d27-d9c3faaa3ef3.jpg)
Final threshold in iteration 11: 1.0154879838228226 (> -Infinity) after 66.981s (< 1800.000s)
1.0154879838228226