Code from BasicOptimizer.scala:88 executed in 96.96 seconds (4.225 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: 1029211673678
Reset training subject: 1029980589924
Adding measurement 5c58b752 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=11.150422852486372;dx=-6.798022280470237E-6
New Minimum: 11.150422852486372 > 11.15040535479784
WOLFE (weak): th(2.154434690031884)=11.15040535479784; dx=-6.8022608205144385E-6 evalInputDelta=1.749768853187561E-5
New Minimum: 11.15040535479784 > 11.150387275964022
WOLFE (weak): th(4.308869380063768)=11.150387275964022; dx=-6.80293469947518E-6 evalInputDelta=3.557652235031128E-5
New Minimum: 11.150387275964022 > 11.150314696133137
WOLFE (weak): th(12.926608140191302)=11.150314696133137; dx=-6.810818493739806E-6 evalInputDelta=1.0815635323524475E-4
New Minimum: 11.150314696133137 > 11.149990435689688
WOLFE (weak): th(51.70643256076521)=11.149990435689688; dx=-6.796573643846897E-6 evalInputDelta=4.3241679668426514E-4
New Minimum: 11.149990435689688 > 11.148258246481419
WOLFE (weak): th(258.53216280382605)=11.148258246481419; dx=-6.803968337169932E-6 evalInputDelta=0.0021646060049533844
New Minimum: 11.148258246481419 > 11.13742595165968
WOLFE (weak): th(1551.1929768229563)=11.13742595165968; dx=-6.8108465491042006E-6 evalInputDelta=0.012996900826692581
New Minimum: 11.13742595165968 > 11.059065517038107
WOLFE (weak): th(10858.350837760694)=11.059065517038107; dx=-6.8518486425067004E-6 evalInputDelta=0.09135733544826508
New Minimum: 11.059065517038107 > 10.407411150634289
WOLFE (weak): th(86866.80670208555)=10.407411150634289; dx=-6.852428865434317E-6 evalInputDelta=0.7430117018520832
New Minimum: 10.407411150634289 > 5.540735371410847
END: th(781801.26031877)=5.540735371410847; dx=-4.1431484492957E-6 evalInputDelta=5.609687481075525
Fitness changed from 11.150422852486372 to 5.540735371410847
Iteration 1 complete. Error: 5.540735371410847 Total: 9.6786; Orientation: 0.0036; Line Search: 7.4878
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/94bc215d-4fe1-471a-ae41-b3a3b292c423.jpg)
Adding m
...skipping 24533 bytes...
m -1.8414594791829586 to -1.8530476093292236
Iteration 28 complete. Error: -1.8530476093292236 Total: 2.4328; Orientation: 0.0748; Line Search: 1.5897
Adding measurement 6ca7a79e to history. Total: 3
Rejected: LBFGS Orientation magnitude: 7.548e+02, gradient 1.043e-04, dot -0.539; [4800eca3-bcde-483e-bb81-61f39482b99f = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.8530476093292236, 1.462542563676834, 5.540735371410847, 11.150422852486372
LBFGS Accumulation History: 3 points
Removed measurement 6ca7a79e to history. Total: 3
th(0)=-1.8530476093292236;dx=-1.0786648959098031E-8
New Minimum: -1.8530476093292236 > -1.8748817555606365
END: th(3305167.829924468)=-1.8748817555606365; dx=-8.956184961526975E-9 evalInputDelta=0.021834146231412888
Fitness changed from -1.8530476093292236 to -1.8748817555606365
Iteration 29 complete. Error: -1.8748817555606365 Total: 2.1953; Orientation: 0.1337; Line Search: 1.3129
Adding measurement 4b1fc31c to history. Total: 3
Rejected: LBFGS Orientation magnitude: 8.107e+02, gradient 1.086e-04, dot -0.510; [4800eca3-bcde-483e-bb81-61f39482b99f = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.8748817555606365, 1.462542563676834, 5.540735371410847, 11.150422852486372
LBFGS Accumulation History: 3 points
Removed measurement 4b1fc31c to history. Total: 3
th(0)=-1.8748817555606365;dx=-1.1526972427777952E-8
Armijo: th(7120768.229166675)=-1.8599726557731628; dx=4.77234555279133E-9 evalInputDelta=-0.014909099787473679
New Minimum: -1.8748817555606365 > -1.8873365223407745
END: th(3560384.1145833377)=-1.8873365223407745; dx=-3.140659909013779E-9 evalInputDelta=0.012454766780138016
Fitness changed from -1.8748817555606365 to -1.8873365223407745
Iteration 30 complete. Error: -1.8873365223407745 Total: 2.8483; Orientation: 0.0761; Line Search: 2.0985
<a id="p-21"></a>Iteration 30
<a id="p-20"></a>![Iteration 30](etc/ea4913dc-f337-4f48-a86d-857ffd63afd5.jpg)
Final threshold in iteration 31: -1.8873365223407745 (> -Infinity) after 96.957s (< 3600.000s)
-1.8873365223407745