anchor.diff:            (let* ((ib (+ i b))
                    (target-ib (aref target ib)))
               (when (/= 0.0 target-ib)
  -              (set sum (+ sum (* (aref d ib)
  -                                 target-ib
  +              (set sum (+ sum (* target-ib
                                    (- softmax-ia
                                       (if (= a b)
                                           1.0
  
positive.code:                                     sum)))
                            (setf (aref softmax i) s)))))))
  
  (define-cuda-kernel (cuda-softmax-xe)
      (void ((group-size int) (x :mat :input) (n int) (softmax :mat :output)))
    (let ((i (* group-size
                (+ (* block-dim-x block-idx-x) thread-idx-x))))
      (when (<= (+ i group-size) n)
        (let ((max (aref x i)))
          ;; It's more stable numerically to subtract the max from
          ;; elements in the group before exponentiating.
          (do ((a 1 (+ a 1)))
              ((>= a group-size))
            (let ((xe (aref x (+ i a))))
              (when (< max xe)
                (set max xe))))
          (let ((sum 0.0))
            (do ((a 0 (+ a 1)))
                ((>= a group-size))
              (let* ((ia (+ i a))
                     (xe (aref x ia))
                     (unnormalized-s (exp (- xe max))))
                (set (aref softmax ia) unnormalized-s)
                (set sum (+ sum unnormalized-s))))
            (do ((a 0 (+ a 1)))
                ((>= a group-size))
              (let* ((ia (+ i a))
                     (s (/ (aref softmax ia) sum)))
                (set (aref softmax ia) s))))))))
  
  (defmacro do-sparse-targets (((group-start target-index target-value)
                                targets group-size)
  
negative.code:             (make-mat (list n (size lump))
                        :max-size (* (max-n-stripes lump) (size lump))))))
  
  (eval-when (:compile-toplevel :load-toplevel :execute)
    (defparameter *n-softmax-threads* 128))
  
  (defmethod forward ((lump ->softmax-xe-loss))
    (let* ((x (nodes (x lump)))
           (group-size (group-size lump))
  