anchor.diff:                                      :omit-label-p omit-label-p
                                       :sample-visible-p sample-visible-p)))))
   
  +(defun make-training-sampler (&key omit-label-p)
  +  (make-sampler (subseq *training-images* 0 1000)
  +                :max-n 1000
  +                :omit-label-p omit-label-p))
  +
  +(defun make-test-sampler (&key omit-label-p)
  +  (make-sampler *test-images*
  +                :max-n (length *test-images*)
  +                :omit-label-p omit-label-p))
  +
   (defun clamp-array (image array start)
     (declare (type flt-vector array)
              (optimize (speed 3)))
  
positive.code:                  *list-of-percents-format*
                   (list (mapcar #'->percent errors)))))))
  
  (defmethod log-test-error ((trainer mnist-logging-trainer) learner)
    (let ((*print-level* nil))
      (when (zerop (n-inputs trainer))
        (describe learner))
      (describe trainer)))
  
  (defmethod log-test-error ((trainer mnist-rbm-trainer) (rbm mnist-rbm))
    (call-next-method)
    (map nil #'xxx (clouds rbm))
    (log-dbn-mean-field-classification-accuracy
     rbm
     (make-sampler (subseq *training-images* 0 10000)
                   :max-n 10000
                   :omit-label-p nil)
     "TRAINING RECONSTRUCTION")
    (log-msg "DBN TEST RMSE: ~{~,5F~^, ~} (~D)~%"
             (map 'list
                  #'get-error
                  (dbn-mean-field-errors* (make-sampler *test-images*
                                                        :max-n
                                                        (length *test-images*))
                                          (dbn rbm) :rbm rbm))
             (n-inputs trainer))
    (log-dbn-mean-field-classification-accuracy
     rbm
     (make-sampler *test-images* :max-n (length *test-images*) :omit-label-p t)
     "TEST"))
  
  (defmethod negative-phase :around (batch trainer (rbm mnist-rbm))
    (call-next-method)
  
negative.code:                         counters-and-measurers)
    (map 'list #'car counters-and-measurers))
  
  (defun log-dbm-classification-accuracy (dbm sampler name)
    (let ((counters-and-measurers
           (make-bm-reconstruction-misclassification-counters-and-measurers dbm)))
      (when counters-and-measurers
        (let ((errors (map 'list
                           #'get-error
                           (mnist-dbm-mean-field-errors sampler
                                                        dbm
                                                        :counters-and-measurers
                                                        counters-and-measurers))))
          (log-msg "DBM ~A CLASSIFICATION ACCURACY: ~?~%"
                   name
                   *list-of-percents-format*
                   (list (mapcar #'->percent errors)))))))
  
  (defmethod log-test-error ((trainer mnist-dbm-trainer) (dbm mnist-dbm))
    (call-next-method)
    (map nil #'xxx (clouds dbm))
  