anchor.diff:  ;;;; Maxout BPN (see TRAIN-MNIST/4)
   ;;;;
   ;;;; I couldn't quite reproduce the 99.06% claimed in the paper.
  +;;;;
  +;;;;
  +;;;; Max-channel BPN (see TRAIN-MNIST/5)
  +;;;;
  +;;;; 99.16%
   
   (in-package :mgl-example-mnist)
   
  
positive.code:                            (n-epochs 200) l2-upper-bound
                             class-weights learning-rate learning-rate-decay
                             set-dropout-p
                             rescale-on-dropout-p)
    (when class-weights
      (setf (class-weights (find-lump 'predictions bpn)) class-weights))
    (setf (max-n-stripes bpn) 100)
    (flet ((make-trainer (lump &key softmaxp)
             (declare (ignore lump))
             (let ((trainer (make-instance
                             'mnist-bpn-gd-segment-trainer
                             :n-inputs-in-epoch (length training)
  
negative.code:     (predictions (tack-cross-entropy-softmax-error-on
                    mgl-bp::*bpn-being-built* (list f3)))))
  
  ;;; Return a matrix of the same shape as MAT that's zero everywhere,
  ;;; except in at most N randomly chosen positions in each column where
  ;;; it's one.
  (defun make-sparse-column-mask (mat n)
    (let ((mask (make-mat (mat-dimensions mat) :ctype (mat-ctype mat))))
      (destructuring-bind (n-rows n-columns) (mat-dimensions mat)
        (with-facets ((mask* (mask 'backing-array :direction :io)))
          (loop for column below n-columns do
            (loop repeat n
                  do (setf (aref mask* (+ (* (random n-rows) n-columns)
                                          column))
                           (flt 1))))))
      mask))
  
  (defun init-bpn-weights (bpn &key stddev)
    (loop for lump across (lumps bpn) do
      (when (typep lump '->weight)
  