Code from BasicOptimizer.scala:88 executed in 115.86 seconds (2.283 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: 2205291802176
Reset training subject: 2207627933340
Adding measurement 414389b9 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=10.338780462741852;dx=-9.98097561134698E-7
New Minimum: 10.338780462741852 > 10.33877782523632
WOLFE (weak): th(2.154434690031884)=10.33877782523632; dx=-9.797165000295998E-7 evalInputDelta=2.637505531311035E-6
New Minimum: 10.33877782523632 > 10.338774740695953
WOLFE (weak): th(4.308869380063768)=10.338774740695953; dx=-9.85735688868219E-7 evalInputDelta=5.7220458984375E-6
New Minimum: 10.338774740695953 > 10.338762953877449
WOLFE (weak): th(12.926608140191302)=10.338762953877449; dx=-9.853701856258045E-7 evalInputDelta=1.7508864402770996E-5
New Minimum: 10.338762953877449 > 10.338710874319077
WOLFE (weak): th(51.70643256076521)=10.338710874319077; dx=-9.85285392654126E-7 evalInputDelta=6.958842277526855E-5
New Minimum: 10.338710874319077 > 10.338433757424355
WOLFE (weak): th(258.53216280382605)=10.338433757424355; dx=-9.855394245002979E-7 evalInputDelta=3.467053174972534E-4
New Minimum: 10.338433757424355 > 10.336701512336731
WOLFE (weak): th(1551.1929768229563)=10.336701512336731; dx=-9.82291082125387E-7 evalInputDelta=0.0020789504051208496
New Minimum: 10.336701512336731 > 10.324235260486603
WOLFE (weak): th(10858.350837760694)=10.324235260486603; dx=-9.843538119441094E-7 evalInputDelta=0.014545202255249023
New Minimum: 10.324235260486603 > 10.222886130213737
WOLFE (weak): th(86866.80670208555)=10.222886130213737; dx=-9.752905408060662E-7 evalInputDelta=0.11589433252811432
New Minimum: 10.222886130213737 > 9.345171213150024
END: th(781801.26031877)=9.345171213150024; dx=-8.647820805072512E-7 evalInputDelta=0.9936092495918274
Fitness changed from 10.338780462741852 to 9.345171213150024
Iteration 1 complete. Error: 9.345171213150024 Total: 32.9365; Orientation: 0.0097; Line Search: 25.8397
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/48b55011-1de3-4f8e-9d22-fd71c4d889d3.jpg)
Adding
...skipping 5642 bytes...
e8d986 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.228e+03, gradient 2.785e-04, dot -0.330; [2de537f4-1589-4c73-8fa2-c09d48a1c5a2 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -0.1511070728302002, 7.713096931576729, 9.345171213150024, 10.338780462741852
LBFGS Accumulation History: 3 points
Removed measurement 4be8d986 to history. Total: 3
th(0)=-0.1511070728302002;dx=-7.69832184106525E-8
Armijo: th(3.0240000000000004E7)=0.8224454373121262; dx=4.4584244599211564E-8 evalInputDelta=-0.9735525101423264
New Minimum: -0.1511070728302002 > -0.15128199756145477
WOLF (strong): th(1.5120000000000002E7)=-0.15128199756145477; dx=3.739941756903459E-8 evalInputDelta=1.7492473125457764E-4
New Minimum: -0.15128199756145477 > -0.407027006149292
END: th(5040000.000000001)=-0.407027006149292; dx=-1.568762429142402E-8 evalInputDelta=0.2559199333190918
Fitness changed from -0.1511070728302002 to -0.407027006149292
Iteration 9 complete. Error: -0.407027006149292 Total: 12.7246; Orientation: 0.2631; Line Search: 9.8711
Adding measurement 617a5c06 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 4.159e+03, gradient 1.695e-04, dot -0.494; [2de537f4-1589-4c73-8fa2-c09d48a1c5a2 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -0.407027006149292, 7.713096931576729, 9.345171213150024, 10.338780462741852
LBFGS Accumulation History: 3 points
Removed measurement 617a5c06 to history. Total: 3
th(0)=-0.407027006149292;dx=-2.863568718146077E-8
New Minimum: -0.407027006149292 > -0.6336880177259445
END: th(1.0858350837760696E7)=-0.6336880177259445; dx=-1.0523232234705738E-8 evalInputDelta=0.22666101157665253
Fitness changed from -0.407027006149292 to -0.6336880177259445
Iteration 10 complete. Error: -0.6336880177259445 Total: 7.7154; Orientation: 0.2155; Line Search: 4.9138
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/3304334b-41f9-4efb-beb0-871917fa546b.jpg)
Final threshold in iteration 11: -0.6336880177259445 (> -Infinity) after 115.857s (< 3600.000s)
-0.6336880177259445