Code from BasicOptimizer.scala:88 executed in 128.79 seconds (3.040 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: 4467964016305
Reset training subject: 4471404666664
Adding measurement 6da6f474 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=24.251613075262867;dx=-1.9210813461531517E-5
New Minimum: 24.251613075262867 > 24.251582056749612
WOLFE (weak): th(2.154434690031884)=24.251582056749612; dx=-1.8753806196317856E-5 evalInputDelta=3.10185132548213E-5
New Minimum: 24.251582056749612 > 24.251551444351207
END: th(4.308869380063768)=24.251551444351207; dx=-1.718244452672581E-5 evalInputDelta=6.163091165944934E-5
Fitness changed from 24.251613075262867 to 24.251551444351207
Iteration 1 complete. Error: 24.251551444351207 Total: 19.4793; Orientation: 0.0387; Line Search: 9.5719
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/3f648f77-67e3-4145-88c1-1b5f902b9945.jpg)
Adding measurement 1052c0e8 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=24.251551444351207;dx=-1.7602102880451363E-5
New Minimum: 24.251551444351207 > 24.25140565726906
WOLFE (weak): th(9.283177667225559)=24.25140565726906; dx=-1.8717133205944942E-5 evalInputDelta=1.457870821468532E-4
New Minimum: 24.25140565726906 > 24.251257819938473
WOLFE (weak): th(18.566355334451117)=24.251257819938473; dx=-1.885330654152441E-5 evalInputDelta=2.936244127340615E-4
New Minimum: 24.251257819938473 > 24.250669567089062
WOLFE (weak): th(55.69906600335335)=24.250669567089062; dx=-1.8183623603435768E-5 evalInputDelta=8.818772621452808E-4
New Minimum: 24.250669567089062 > 24.24803146382328
WOLFE (weak): th(222.7962640134134)=24.24803146382328; dx=-1.7099226001451027E-5 evalInputDelta=0.0035199805279262364
New Minimum: 24.24803146382328 > 24.213865936617367
END: th(1113.981320067067)=24.213865936617367; dx=-1.213237085376864E-5 evalInputDelta=0.037685507733840495
Fitness changed from 24.251551444351207 to 24.213865936617367
Iteration 2 complete. Error: 24.213865936617367 Total: 23.7439; Orientation: 0.0069; Line Search: 19.1890
<a id="p-5"></a>Iteration 2
<a id="p-4">
...skipping 4766 bytes...
3742908649147
END: th(668388.7920402404)=15.813742908649147; dx=-1.091239246747389E-6 evalInputDelta=2.940604179399088
Fitness changed from 18.754347088048235 to 15.813742908649147
Iteration 8 complete. Error: 15.813742908649147 Total: 10.6555; Orientation: 0.2190; Line Search: 7.3215
Adding measurement 6b389307 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.552e+03, gradient 1.875e-03, dot -0.354; [a5e13120-53d5-413d-8793-348ff3ebb08d = 1.000/1.000e+00]
Orientation rejected. Popping history element from 15.813742908649147, 24.213865936617367, 24.251551444351207, 24.251613075262867
LBFGS Accumulation History: 3 points
Removed measurement 6b389307 to history. Total: 3
th(0)=15.813742908649147;dx=-3.0749889567798263E-6
New Minimum: 15.813742908649147 > 11.861936714500189
END: th(1440000.0000000005)=11.861936714500189; dx=-5.25296906975293E-7 evalInputDelta=3.9518061941489577
Fitness changed from 15.813742908649147 to 11.861936714500189
Iteration 9 complete. Error: 11.861936714500189 Total: 9.5617; Orientation: 0.0613; Line Search: 6.3293
Adding measurement 3180f4b1 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.791e+03, gradient 1.195e-03, dot -0.308; [a5e13120-53d5-413d-8793-348ff3ebb08d = 1.000/1.000e+00]
Orientation rejected. Popping history element from 11.861936714500189, 24.213865936617367, 24.251551444351207, 24.251613075262867
LBFGS Accumulation History: 3 points
Removed measurement 3180f4b1 to history. Total: 3
th(0)=11.861936714500189;dx=-1.253271264650879E-6
New Minimum: 11.861936714500189 > 10.32394902035594
END: th(3102385.953645914)=10.32394902035594; dx=-1.2602984470175254E-7 evalInputDelta=1.537987694144249
Fitness changed from 11.861936714500189 to 10.32394902035594
Iteration 10 complete. Error: 10.32394902035594 Total: 9.6307; Orientation: 0.0713; Line Search: 6.2616
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/d77fbd5c-956a-43d1-ba54-7ace809b88e9.jpg)
Final threshold in iteration 11: 10.32394902035594 (> -Infinity) after 128.770s (< 1800.000s)
10.32394902035594