Code from BasicOptimizer.scala:88 executed in 53.11 seconds (2.469 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: 1842627864447
Reset training subject: 1844640880688
Adding measurement 20733b62 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=33.73221703059971;dx=-0.00473691525516994
New Minimum: 33.73221703059971 > 33.72199370432645
WOLFE (weak): th(2.154434690031884)=33.72199370432645; dx=-0.004731252034614084 evalInputDelta=0.0102233262732625
New Minimum: 33.72199370432645 > 33.71180493524298
WOLFE (weak): th(4.308869380063768)=33.71180493524298; dx=-0.004728459579887552 evalInputDelta=0.020412095356732607
New Minimum: 33.71180493524298 > 33.67116595245898
WOLFE (weak): th(12.926608140191302)=33.67116595245898; dx=-0.0047065530893705305 evalInputDelta=0.061051078140735626
New Minimum: 33.67116595245898 > 33.489712352864444
WOLFE (weak): th(51.70643256076521)=33.489712352864444; dx=-0.004650027472000865 evalInputDelta=0.24250467773526907
New Minimum: 33.489712352864444 > 32.56319021014497
WOLFE (weak): th(258.53216280382605)=32.56319021014497; dx=-0.0043841172218722045 evalInputDelta=1.1690268204547465
New Minimum: 32.56319021014497 > 28.290544635616243
END: th(1551.1929768229563)=28.290544635616243; dx=-0.0024647955007757183 evalInputDelta=5.44167239498347
Fitness changed from 33.73221703059971 to 28.290544635616243
Iteration 1 complete. Error: 28.290544635616243 Total: 13.3550; Orientation: 0.0038; Line Search: 8.8458
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/8629289f-6f73-48d1-9344-4127a47787e6.jpg)
Adding measurement 36a4d236 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=28.290544635616243;dx=-0.002008939439537824
New Minimum: 28.290544635616243 > 24.036082718521357
END: th(3341.943960201201)=24.036082718521357; dx=-8.103117219007531E-4 evalInputDelta=4.254461917094886
Fitness changed from 28.290544635616243 to 24.036082718521357
Iteration 2 complete. Error: 24.036082718521357 Total: 3.7646; Orientation: 0.0036; Line Search: 2.5157
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/6b
...skipping 4637 bytes...
0.446322053670883 Total: 3.9428; Orientation: 0.0774; Line Search: 2.6071
Adding measurement 19fb9936 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.868e+02, gradient 4.936e-03, dot -0.290; [b1a644b7-cb77-410e-8474-1fed4640f423 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 10.446322053670883, 24.036082718521357, 28.290544635616243, 33.73221703059971
LBFGS Accumulation History: 3 points
Removed measurement 19fb9936 to history. Total: 3
th(0)=10.446322053670883;dx=-2.4361689397007226E-5
New Minimum: 10.446322053670883 > 7.61671694368124
WOLF (strong): th(720000.0000000003)=7.61671694368124; dx=8.061311671601741E-7 evalInputDelta=2.829605109989643
END: th(360000.0000000002)=7.6719172820448875; dx=-1.4580875732898074E-6 evalInputDelta=2.7744047716259956
Fitness changed from 10.446322053670883 to 7.61671694368124
Iteration 9 complete. Error: 7.61671694368124 Total: 5.1829; Orientation: 0.0761; Line Search: 3.8566
Adding measurement 3e248b0e to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.874e+02, gradient 3.241e-03, dot -0.171; [b1a644b7-cb77-410e-8474-1fed4640f423 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 7.61671694368124, 24.036082718521357, 28.290544635616243, 33.73221703059971
LBFGS Accumulation History: 3 points
Removed measurement 3e248b0e to history. Total: 3
th(0)=7.61671694368124;dx=-1.0506171323769449E-5
New Minimum: 7.61671694368124 > 5.211407549679279
WOLF (strong): th(775596.4884114786)=5.211407549679279; dx=1.4750702449484666E-8 evalInputDelta=2.4053093940019608
END: th(387798.2442057393)=5.490847297012806; dx=-1.8517269808680983E-6 evalInputDelta=2.125869646668434
Fitness changed from 7.61671694368124 to 5.211407549679279
Iteration 10 complete. Error: 5.211407549679279 Total: 5.0941; Orientation: 0.0747; Line Search: 3.7439
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/ce6a3e63-26db-4398-afa9-473da9ebbaf5.jpg)
Final threshold in iteration 11: 5.211407549679279 (> -Infinity) after 53.106s (< 3600.000s)
5.211407549679279