Code from BasicOptimizer.scala:88 executed in 379.49 seconds (3.816 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: 5813210346996
Reset training subject: 5816087674345
Adding measurement 741d47d0 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=1.568332850933075;dx=-1.4273981094774325E-7
New Minimum: 1.568332850933075 > 1.5683322548866272
WOLFE (weak): th(2.154434690031884)=1.5683322548866272; dx=-1.4182484492970575E-7 evalInputDelta=5.960464477539062E-7
New Minimum: 1.5683322548866272 > 1.5683316886425018
WOLFE (weak): th(4.308869380063768)=1.5683316886425018; dx=-1.4193253442187408E-7 evalInputDelta=1.1622905731201172E-6
New Minimum: 1.5683316886425018 > 1.5683295726776123
WOLFE (weak): th(12.926608140191302)=1.5683295726776123; dx=-1.4194059173258634E-7 evalInputDelta=3.2782554626464844E-6
New Minimum: 1.5683295726776123 > 1.5683199316263199
WOLFE (weak): th(51.70643256076521)=1.5683199316263199; dx=-1.4194515168915187E-7 evalInputDelta=1.2919306755065918E-5
New Minimum: 1.5683199316263199 > 1.568268045783043
WOLFE (weak): th(258.53216280382605)=1.568268045783043; dx=-1.4191937106597813E-7 evalInputDelta=6.480515003204346E-5
New Minimum: 1.568268045783043 > 1.567944124341011
WOLFE (weak): th(1551.1929768229563)=1.567944124341011; dx=-1.4193148493024344E-7 evalInputDelta=3.887265920639038E-4
New Minimum: 1.567944124341011 > 1.565613493323326
WOLFE (weak): th(10858.350837760694)=1.565613493323326; dx=-1.4186371110877225E-7 evalInputDelta=0.0027193576097488403
New Minimum: 1.565613493323326 > 1.5466369986534119
WOLFE (weak): th(86866.80670208555)=1.5466369986534119; dx=-1.4097894706005625E-7 evalInputDelta=0.021695852279663086
New Minimum: 1.5466369986534119 > 1.3792169988155365
WOLFE (weak): th(781801.26031877)=1.3792169988155365; dx=-1.321610661207027E-7 evalInputDelta=0.18911585211753845
New Minimum: 1.3792169988155365 > 0.3393724709749222
END: th(7818012.6031877)=0.3393724709749222; dx=-5.885319071102088E-8 evalInputDelta=1.2289603799581528
Fitness changed from 1.568332850933075 to 0.3393724709749222
Iteration 1 complete. Error: 0.33937247
...skipping 25544 bytes...
tal: 3
Rejected: LBFGS Orientation magnitude: 2.484e+03, gradient 2.797e-05, dot -0.610; [78414951-ea94-4045-86b3-7616a8622e0e = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.7574785649776459, -0.5291895270347595, 0.3393724709749222, 1.568332850933075
LBFGS Accumulation History: 3 points
Removed measurement 6c401d2d to history. Total: 3
th(0)=-1.7574785649776459;dx=-7.805436103572023E-10
New Minimum: -1.7574785649776459 > -1.7597679793834686
END: th(9793089.866442868)=-1.7597679793834686; dx=-6.200573373447935E-11 evalInputDelta=0.002289414405822754
Fitness changed from -1.7574785649776459 to -1.7597679793834686
Iteration 29 complete. Error: -1.7597679793834686 Total: 9.3310; Orientation: 0.3554; Line Search: 5.9190
Adding measurement 288ee46a to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.520e+03, gradient 3.744e-05, dot -0.495; [78414951-ea94-4045-86b3-7616a8622e0e = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.7597679793834686, -0.5291895270347595, 0.3393724709749222, 1.568332850933075
LBFGS Accumulation History: 3 points
Removed measurement 288ee46a to history. Total: 3
th(0)=-1.7597679793834686;dx=-1.3987653105998103E-9
Armijo: th(2.1098572530864224E7)=-1.7457509934902191; dx=4.854530556633867E-10 evalInputDelta=-0.014016985893249512
New Minimum: -1.7597679793834686 > -1.7609543353319168
WOLF (strong): th(1.0549286265432112E7)=-1.7609543353319168; dx=5.277966088720131E-10 evalInputDelta=0.0011863559484481812
New Minimum: -1.7609543353319168 > -1.7659866735339165
END: th(3516428.7551440373)=-1.7659866735339165; dx=-6.540765547382936E-10 evalInputDelta=0.0062186941504478455
Fitness changed from -1.7597679793834686 to -1.7659866735339165
Iteration 30 complete. Error: -1.7659866735339165 Total: 14.7901; Orientation: 0.3292; Line Search: 11.5519
<a id="p-21"></a>Iteration 30
<a id="p-20"></a>![Iteration 30](etc/69c7e374-c8e4-4eb2-a3b8-af0f858cd205.jpg)
Final threshold in iteration 31: -1.7659866735339165 (> -Infinity) after 379.490s (< 3600.000s)
-1.7659866735339165