Code from BasicOptimizer.scala:88 executed in 298.24 seconds (8.343 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: 603232954966300
Reset training subject: 603238450330600
Adding measurement 5e3d7381 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=9.537399590015411;dx=-3.0600098270544834E-6
New Minimum: 9.537399590015411 > 9.537388630211353
WOLFE (weak): th(2.154434690031884)=9.537388630211353; dx=-3.063978495731841E-6 evalInputDelta=1.0959804058074951E-5
New Minimum: 9.537388630211353 > 9.537377454340458
WOLFE (weak): th(4.308869380063768)=9.537377454340458; dx=-3.0652667108816273E-6 evalInputDelta=2.2135674953460693E-5
New Minimum: 9.537377454340458 > 9.537334091961384
WOLFE (weak): th(12.926608140191302)=9.537334091961384; dx=-3.061256088946166E-6 evalInputDelta=6.549805402755737E-5
New Minimum: 9.537334091961384 > 9.53713670372963
WOLFE (weak): th(51.70643256076521)=9.53713670372963; dx=-3.062102110620272E-6 evalInputDelta=2.6288628578186035E-4
New Minimum: 9.53713670372963 > 9.536087304353714
WOLFE (weak): th(258.53216280382605)=9.536087304353714; dx=-3.06498220995436E-6 evalInputDelta=0.0013122856616973877
New Minimum: 9.536087304353714 > 9.529534459114075
WOLFE (weak): th(1551.1929768229563)=9.529534459114075; dx=-3.0559931591661577E-6 evalInputDelta=0.00786513090133667
New Minimum: 9.529534459114075 > 9.482564434409142
WOLFE (weak): th(10858.350837760694)=9.482564434409142; dx=-3.0350616848006446E-6 evalInputDelta=0.054835155606269836
New Minimum: 9.482564434409142 > 9.114363729953766
WOLFE (weak): th(86866.80670208555)=9.114363729953766; dx=-2.8481414202286546E-6 evalInputDelta=0.4230358600616455
New Minimum: 9.114363729953766 > 7.089641749858856
END: th(781801.26031877)=7.089641749858856; dx=-1.0683963722849747E-6 evalInputDelta=2.447757840156555
Fitness changed from 9.537399590015411 to 7.089641749858856
Iteration 1 complete. Error: 7.089641749858856 Total: 72.7656; Orientation: 0.0157; Line Search: 56.2735
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/06655ee7-e9fa-4e9c-bafa-7598bb0fdb19.
...skipping 6238 bytes...
easurement 3f8d1c43 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 4.201e+03, gradient 4.287e-04, dot -0.617; [4c4594cf-d83a-4b4f-9823-ffdf4f749d7f = 1.000/1.000e+00]
Orientation rejected. Popping history element from 2.581006497144699, 5.646550953388214, 7.089641749858856, 9.537399590015411
LBFGS Accumulation History: 3 points
Removed measurement 3f8d1c43 to history. Total: 3
th(0)=2.581006497144699;dx=-1.8284914728664953E-7
New Minimum: 2.581006497144699 > 2.5791451930999756
WOLF (strong): th(3780000.000000001)=2.5791451930999756; dx=6.876975859924214E-8 evalInputDelta=0.0018613040447235107
New Minimum: 2.5791451930999756 > 2.378758028149605
WOLF (strong): th(1890000.0000000005)=2.378758028149605; dx=9.364637014645E-11 evalInputDelta=0.2022484689950943
END: th(630000.0000000001)=2.450209155678749; dx=-1.267784231698538E-7 evalInputDelta=0.13079734146595
Fitness changed from 2.581006497144699 to 2.378758028149605
Iteration 9 complete. Error: 2.378758028149605 Total: 35.9935; Orientation: 0.2899; Line Search: 27.7633
Adding measurement 2ff5c930 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.990e+03, gradient 4.504e-04, dot -0.543; [4c4594cf-d83a-4b4f-9823-ffdf4f749d7f = 1.000/1.000e+00]
Orientation rejected. Popping history element from 2.378758028149605, 5.646550953388214, 7.089641749858856, 9.537399590015411
LBFGS Accumulation History: 3 points
Removed measurement 2ff5c930 to history. Total: 3
th(0)=2.378758028149605;dx=-2.0186824671110312E-7
New Minimum: 2.378758028149605 > 2.211778223514557
END: th(1357293.854720087)=2.211778223514557; dx=-4.374372562104131E-9 evalInputDelta=0.1669798046350479
Fitness changed from 2.378758028149605 to 2.211778223514557
Iteration 10 complete. Error: 2.211778223514557 Total: 16.3988; Orientation: 0.1748; Line Search: 10.8736
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/8f8663d0-ac19-4409-a014-e1086615b8f7.jpg)
Final threshold in iteration 11: 2.211778223514557 (> -Infinity) after 298.235s (< 3600.000s)
2.211778223514557