Code from BasicOptimizer.scala:88 executed in 785.26 seconds (6.618 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

Logging:

    Reset training subject: 18423621408868
    Reset training subject: 18438966586256
    Adding measurement 38693ed to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=0.9939088672399521;dx=-5.6646231518192053E-8
    Armijo: th(2.154434690031884)=0.9939088672399521; dx=-5.664625254289987E-8 evalInputDelta=0.0
    Armijo: th(1.077217345015942)=0.9939089566469193; dx=-5.664624823168601E-8 evalInputDelta=-8.940696716308594E-8
    Armijo: th(0.3590724483386473)=0.993909016251564; dx=-5.6646258577501636E-8 evalInputDelta=-1.4901161193847656E-7
    Armijo: th(0.08976811208466183)=0.9939089566469193; dx=-5.664624723559618E-8 evalInputDelta=-8.940696716308594E-8
    Armijo: th(0.017953622416932366)=0.9939090013504028; dx=-5.6646255952023814E-8 evalInputDelta=-1.341104507446289E-7
    Armijo: th(0.002992270402822061)=0.993909016251564; dx=-5.664624199601427E-8 evalInputDelta=-1.4901161193847656E-7
    Armijo: th(4.2746720040315154E-4)=0.9939090460538864; dx=-5.664623652272002E-8 evalInputDelta=-1.7881393432617188E-7
    Armijo: th(5.343340005039394E-5)=0.9939089268445969; dx=-5.664623154611636E-8 evalInputDelta=-5.9604644775390625E-8
    WOLFE (weak): th(5.9370444500437714E-6)=0.9939088672399521; dx=-5.664623153867204E-8 evalInputDelta=0.0
    WOLFE (weak): th(2.9685222250218857E-5)=0.9939088672399521; dx=-5.6646231452169455E-8 evalInputDelta=0.0
    WOLFE (weak): th(4.15593111503064E-5)=0.9939088672399521; dx=-5.664623144721992E-8 evalInputDelta=0.0
    WOLFE (weak): th(4.749635560035017E-5)=0.9939088672399521; dx=-5.66462315201251E-8 evalInputDelta=0.0
    WOLFE (weak): th(5.0464877825372054E-5)=0.9939088672399521; dx=-5.664623147751851E-8 evalInputDelta=0.0
    WOLFE (weak): th(5.1949138937882995E-5)=0.9939088672399521; dx=-5.6646231481622054E-8 evalInputDelta=0.0
    Armijo: th(5.269126949413847E-5)=0.9939089268445969; dx=-5.6646231562886634E-8 evalInputDelta=-5.9604644775390625E-8
    Armijo: th(5.2320204216010734E-5)=0.9939089268445969; dx=-5.66462315490978E-8 evalInputDelta=-5.9604644775390625E-8
    WOLFE (weak): th(5.2134671576946864

...skipping 2108 bytes...

    : th(5.154421240522127E-5)=0.9939088672399521; dx=-5.664623139839639E-8 evalInputDelta=0.0
    Armijo: th(5.388713115091315E-5)=0.9939089268445969; dx=-5.664623146746241E-8 evalInputDelta=-5.9604644775390625E-8
    Armijo: th(5.2715671778067214E-5)=0.9939089268445969; dx=-5.664623149441246E-8 evalInputDelta=-5.9604644775390625E-8
    WOLFE (weak): th(5.212994209164424E-5)=0.9939088672399521; dx=-5.664623140589741E-8 evalInputDelta=0.0
    Armijo: th(5.242280693485573E-5)=0.9939089268445969; dx=-5.664623151821268E-8 evalInputDelta=-5.9604644775390625E-8
    Armijo: th(5.227637451324999E-5)=0.9939089268445969; dx=-5.664623149928174E-8 evalInputDelta=-5.9604644775390625E-8
    Armijo: th(5.2203158302447114E-5)=0.9939089268445969; dx=-5.664623150619788E-8 evalInputDelta=-5.9604644775390625E-8
    WOLFE (weak): th(5.216655019704568E-5)=0.9939088672399521; dx=-5.664623140374408E-8 evalInputDelta=0.0
    WOLFE (weak): th(5.2184854249746394E-5)=0.9939088672399521; dx=-5.66462314901546E-8 evalInputDelta=0.0
    WOLFE (weak): th(5.219400627609676E-5)=0.9939088672399521; dx=-5.664623144569858E-8 evalInputDelta=0.0
    WOLFE (weak): th(5.219858228927194E-5)=0.9939088672399521; dx=-5.664623140034109E-8 evalInputDelta=0.0
    Armijo: th(5.220087029585953E-5)=0.9939089268445969; dx=-5.6646231523526673E-8 evalInputDelta=-5.9604644775390625E-8
    Armijo: th(5.2199726292565734E-5)=0.9939089268445969; dx=-5.664623153218947E-8 evalInputDelta=-5.9604644775390625E-8
    WOLFE (weak): th(5.219915429091883E-5)=0.9939088672399521; dx=-5.664623139972773E-8 evalInputDelta=0.0
    Armijo: th(5.219944029174228E-5)=0.9939089268445969; dx=-5.664623154484892E-8 evalInputDelta=-5.9604644775390625E-8
    mu ~= nu (5.219915429091883E-5): th(0.0)=0.9939088672399521
    Fitness changed from 0.9939088672399521 to 0.9939088672399521
    Static Iteration Total: 340.9082; Orientation: 0.0667; Line Search: 314.4309
    Iteration 2 failed. Error: 0.9939088672399521
    Previous Error: 0.0 -> 0.9939088672399521
    Optimization terminated 2
    Final threshold in iteration 2: 0.9939088672399521 (> -Infinity) after 785.261s (< 3600.000s)
    

Returns:

    0.9939088672399521