Code from BasicOptimizer.scala:88 executed in 366.89 seconds (3.247 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: 1502062271270
Reset training subject: 1510127843955
Adding measurement 5c0a0549 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=9.70497752726078;dx=-2.559218396806023E-7
New Minimum: 9.70497752726078 > 9.704977259039879
WOLFE (weak): th(2.154434690031884)=9.704977259039879; dx=-2.558961964191904E-7 evalInputDelta=2.682209014892578E-7
New Minimum: 9.704977259039879 > 9.704976052045822
WOLFE (weak): th(4.308869380063768)=9.704976052045822; dx=-2.5427096920714506E-7 evalInputDelta=1.475214958190918E-6
New Minimum: 9.704976052045822 > 9.704972468316555
WOLFE (weak): th(12.926608140191302)=9.704972468316555; dx=-2.556221698542854E-7 evalInputDelta=5.058944225311279E-6
New Minimum: 9.704972468316555 > 9.704958640038967
WOLFE (weak): th(51.70643256076521)=9.704958640038967; dx=-2.5553987280852697E-7 evalInputDelta=1.8887221813201904E-5
New Minimum: 9.704958640038967 > 9.704883262515068
WOLFE (weak): th(258.53216280382605)=9.704883262515068; dx=-2.5589205921075943E-7 evalInputDelta=9.426474571228027E-5
New Minimum: 9.704883262515068 > 9.704411581158638
WOLFE (weak): th(1551.1929768229563)=9.704411581158638; dx=-2.5561748618510163E-7 evalInputDelta=5.65946102142334E-4
New Minimum: 9.704411581158638 > 9.701018452644348
WOLFE (weak): th(10858.350837760694)=9.701018452644348; dx=-2.553070729534416E-7 evalInputDelta=0.00395907461643219
New Minimum: 9.701018452644348 > 9.673430249094963
WOLFE (weak): th(86866.80670208555)=9.673430249094963; dx=-2.526554785098032E-7 evalInputDelta=0.03154727816581726
New Minimum: 9.673430249094963 > 9.426967099308968
WOLFE (weak): th(781801.26031877)=9.426967099308968; dx=-2.3515619760401532E-7 evalInputDelta=0.27801042795181274
New Minimum: 9.426967099308968 > 7.833095476031303
END: th(7818012.6031877)=7.833095476031303; dx=-9.295749709422509E-8 evalInputDelta=1.871882051229477
Fitness changed from 9.70497752726078 to 7.833095476031303
Iteration 1 complete. Error: 7.833095476031303 Total: 108.2052; Orientatio
...skipping 5865 bytes...
2bffadb0 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.445e+03, gradient 1.563e-04, dot -0.168; [d9e555be-eae8-44ae-90a3-bb0558d5f053 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 0.8636231422424316, 6.160143613815308, 7.833095476031303, 9.70497752726078
LBFGS Accumulation History: 3 points
Removed measurement 2bffadb0 to history. Total: 3
th(0)=0.8636231422424316;dx=-2.4186501384861404E-8
Armijo: th(1.5120000000000006E8)=1.4647706747055054; dx=2.838645024451706E-9 evalInputDelta=-0.6011475324630737
New Minimum: 0.8636231422424316 > 0.6633711457252502
WOLF (strong): th(7.560000000000003E7)=0.6633711457252502; dx=2.1199278614806013E-9 evalInputDelta=0.2002519965171814
New Minimum: 0.6633711457252502 > 0.43660393357276917
END: th(2.520000000000001E7)=0.43660393357276917; dx=-6.424565832925884E-9 evalInputDelta=0.4270192086696625
Fitness changed from 0.8636231422424316 to 0.43660393357276917
Iteration 9 complete. Error: 0.43660393357276917 Total: 38.6800; Orientation: 0.4178; Line Search: 31.5222
Adding measurement 7e147551 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 9.057e+03, gradient 1.859e-04, dot -0.167; [d9e555be-eae8-44ae-90a3-bb0558d5f053 = 1.000/1.000e+00]
Orientation rejected. Popping history element from 0.43660393357276917, 6.160143613815308, 7.833095476031303, 9.70497752726078
LBFGS Accumulation History: 3 points
Removed measurement 7e147551 to history. Total: 3
th(0)=0.43660393357276917;dx=-3.4170357304734124E-8
New Minimum: 0.43660393357276917 > 0.21483179926872253
END: th(5.4291754188803494E7)=0.21483179926872253; dx=-2.601754338159033E-9 evalInputDelta=0.22177213430404663
Fitness changed from 0.43660393357276917 to 0.21483179926872253
Iteration 10 complete. Error: 0.21483179926872253 Total: 23.2351; Orientation: 0.4107; Line Search: 14.6415
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/33958e87-b1a3-4e51-9119-db9f1520f6e4.jpg)
Final threshold in iteration 11: 0.21483179926872253 (> -Infinity) after 366.887s (< 1800.000s)
0.21483179926872253