Code from BasicOptimizer.scala:88 executed in 141.83 seconds (1.532 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: 24199346630286
Reset training subject: 24202607777319
Adding measurement 507021cc to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=21.881408705958165;dx=-1.551076183885182E-5
New Minimum: 21.881408705958165 > 21.88134461408481
WOLFE (weak): th(2.154434690031884)=21.88134461408481; dx=-1.591891441086462E-5 evalInputDelta=6.409187335520983E-5
New Minimum: 21.88134461408481 > 21.88128020451404
WOLFE (weak): th(4.308869380063768)=21.88128020451404; dx=-1.5993266820822253E-5 evalInputDelta=1.2850144412368536E-4
New Minimum: 21.88128020451404 > 21.88102088624146
WOLFE (weak): th(12.926608140191302)=21.88102088624146; dx=-1.6216869501507506E-5 evalInputDelta=3.87819716706872E-4
New Minimum: 21.88102088624146 > 21.879857570515014
WOLFE (weak): th(51.70643256076521)=21.879857570515014; dx=-1.6139578681441798E-5 evalInputDelta=0.0015511354431509972
New Minimum: 21.879857570515014 > 21.874217070406303
WOLFE (weak): th(258.53216280382605)=21.874217070406303; dx=-1.5584097905270884E-5 evalInputDelta=0.007191635551862419
New Minimum: 21.874217070406303 > 21.839077287120745
WOLFE (weak): th(1551.1929768229563)=21.839077287120745; dx=-1.4066569790759579E-5 evalInputDelta=0.04233141883742064
New Minimum: 21.839077287120745 > 21.56819291273132
WOLFE (weak): th(10858.350837760694)=21.56819291273132; dx=-1.4485132681835475E-5 evalInputDelta=0.31321579322684556
New Minimum: 21.56819291273132 > 20.140269048744813
END: th(86866.80670208555)=20.140269048744813; dx=-7.28327273487983E-6 evalInputDelta=1.7411396572133526
Fitness changed from 21.881408705958165 to 20.140269048744813
Iteration 1 complete. Error: 20.140269048744813 Total: 38.0172; Orientation: 0.0029; Line Search: 28.2227
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/985110c0-2c2d-42c3-8843-adfaec42e0db.jpg)
Adding measurement 6e60c797 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=20.140269048744813;dx=-9.197280055954644E-6
New Minimum: 20.140269048744813 >
...skipping 5293 bytes...
. Total: 3
Rejected: LBFGS Orientation magnitude: 4.220e+02, gradient 5.115e-04, dot -0.172; [c02f6b06-b000-4902-8327-f3bed1cf9b45 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 5.444170739501715, 18.09280953160487, 20.140269048744813, 21.881408705958165
LBFGS Accumulation History: 3 points
Removed measurement 5e05072c to history. Total: 3
th(0)=5.444170739501715;dx=-2.3256291656864572E-7
Armijo: th(1.0080000000000004E7)=7.066626396030188; dx=6.613783670416211E-8 evalInputDelta=-1.622455656528473
New Minimum: 5.444170739501715 > 4.828558824956417
END: th(5040000.000000002)=4.828558824956417; dx=-3.4867818886225215E-9 evalInputDelta=0.6156119145452976
Fitness changed from 5.444170739501715 to 4.828558824956417
Iteration 9 complete. Error: 4.828558824956417 Total: 12.9847; Orientation: 0.1744; Line Search: 9.6288
Adding measurement 195ca0cc to history. Total: 3
Rejected: LBFGS Orientation magnitude: 4.761e+01, gradient 4.976e-04, dot -0.716; [c02f6b06-b000-4902-8327-f3bed1cf9b45 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 4.828558824956417, 18.09280953160487, 20.140269048744813, 21.881408705958165
LBFGS Accumulation History: 3 points
Removed measurement 195ca0cc to history. Total: 3
th(0)=4.828558824956417;dx=-2.188726613368459E-7
Armijo: th(1.0858350837760698E7)=8.795066706836224; dx=8.467691468952377E-8 evalInputDelta=-3.9665078818798065
Armijo: th(5429175.418880349)=5.573751479387283; dx=6.201716066177549E-8 evalInputDelta=-0.7451926544308662
New Minimum: 4.828558824956417 > 4.2100120931863785
END: th(1809725.139626783)=4.2100120931863785; dx=-8.770485811948709E-8 evalInputDelta=0.6185467317700386
Fitness changed from 4.828558824956417 to 4.2100120931863785
Iteration 10 complete. Error: 4.2100120931863785 Total: 15.8388; Orientation: 0.0636; Line Search: 12.6246
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/9aabecac-4982-498a-b4cd-b46be3f8cb7c.jpg)
Final threshold in iteration 11: 4.2100120931863785 (> -Infinity) after 141.824s (< 1800.000s)
4.2100120931863785