anchor.diff:  
     ;; Make a network of 2 layers : 784 inputs for the input layer
     ;;                              10 outputs for the output layer                       
  -  ;;(defparameter *network* (list (make-neuron-layer 784 hidden-neurons)
  -  ;;				(make-neuron-layer hidden-neurons 10)))
  -  (defparameter *network* (list (make-neuron-layer 784 hidden-neurons)))
  -				
  -  (training training-set)
  -  (print (error-rate testing-set))
  +  (let ((network (list (make-neuron-layer 784 hidden-neurons)
  +  		       (make-neuron-layer hidden-neurons 10))))
  +  ;;(let ((network (list(make-neuron-layer 784 hidden-neurons))))
  +    (print "TRAINING")
  +    (time (setq network (training network training-set)))
  +    (print "TESTING")
  +    (time (print (error-rate network testing-set))))
  +
     (close *images*)
     (close *labels*))
   
  
positive.code:          errors))
  
  (defun backtracking-neuron (neuron input-values error)
    (let ((pdaf (pdaf (weighted-sum neuron input-values))))
      (map 'vector
           (lambda (weight input-value) (+ weight
  					 (delta-weight pdaf input-value error)))
  	 neuron
  	 input-values)))
  				   
  (defun compute-error (network-outputs expected-outputs)
    (map 'vector
         #'-
         network-outputs
         expected-outputs))
  
  (defun delta-weight (pdaf input-value error)
    (* -1 *learning-rate* error pdaf input-value))
    
  (defun pdaf (weighted-sum)
    ;; partial derivative of the activation function
  
negative.code: 
  (defun results-to-labels (results)
    ;; the number with the highest output is considered to be the right answer
    ;; TODO: low priority, probably suboptimal alogrithm but only runned once/test
    (position (reduce #'max results) results))
  
  (defun error-rate (network testing-set)
    (- 100 (* (/ (testing network testing-set) testing-set) 100.0)))
  
  (defun training (network n)
    (let ((inputs nil))
      (dotimes (x n)
        (setq inputs (next-image *images*))
        (setq network (backtracking  network
  				   inputs
  				   (network-output network inputs)
  				   (label-to-results (next-label *labels*))))))
    network)
  
  (defun testing (network n)
    (let ((success 0))
      (dotimes (x n)
        (when (equal (results-to-labels (network-output network (next-image *images*)))
  		   (next-label *labels*))
  	(setq success (+ success 1))))
      success))
  