anchor.diff:            (setf (aref nodes i)
                   (flt (* stddev (gaussian-random-1)))))))))
   
  -(defvar *bpn/3*)
  -
  -(defparameter *mnist-3-bpn-filename*
  -  (merge-pathnames "mnist-3.bpn" *mnist-save-dir*))
  -
  -(defun train-mnist/3 (&key quick-run-p)
  -  (setq *bpn/3* (build-rectified-mnist-bpn))
  -  (init-bpn-weights *bpn/3* :stddev 0.01)
  -  (train-mnist-bpn-gd *bpn/3* (training-images) (test-images)
  -                      :n-softmax-epochs 0
  -                      :n-epochs (if quick-run-p 2 3000)
  -                      :learning-rate (flt 1)
  -                      :learning-rate-decay (flt 0.998)
  -                      :l2-upper-bound (sqrt (flt 15)))
  -  (unless quick-run-p
  -    (save-weights *mnist-3-bpn-filename* *bpn/3*)))
  +(defun train-mnist/3 (&key (training *training*) (test *test*) quick-run-p
  +                      bpn-var bpn-filename)
  +  (let ((bpn nil))
  +    (setq* (bpn bpn-var) (build-rectified-mnist-bpn))
  +    (init-bpn-weights bpn :stddev 0.01)
  +    (train-mnist-bpn-gd bpn training test
  +                        :n-softmax-epochs 0
  +                        :n-epochs (if quick-run-p 2 3000)
  +                        :learning-rate (flt 1)
  +                        :learning-rate-decay (flt 0.998)
  +                        :l2-upper-bound (sqrt (flt 15)))
  +    (unless quick-run-p
  +      (save-weights bpn-filename bpn))))
    
   
  
positive.code: (defclass mnist-rbm (rbm) ())
  
  (defmethod set-input (samples (rbm mnist-rbm))
    (let ((inputs (find 'inputs (visible-chunks rbm)
                        :key #'name)))
      (when inputs
        (clamp-images samples (nodes inputs)))))
  
  
negative.code:   (unless (boundp '*test-images*)
      (setq *test-images* (load-test)))
    *test-images*)
  
  
  (defvar *training*)
  (defvar *test*)
  
  
  
  