anchor.diff:    ((net :reader net :initarg :net :initform (error ":net required") :type t-net)
      (layer :reader layer :initarg :layer :initform (error ":layer required")
             :type integer)
  +   (layer-type :accessor layer-type :initarg :layer-type :initform nil)
      (biased :reader biased :initarg :biased :initform nil :type boolean)
      (id :accessor id :type integer)
      (input :accessor input :initform 0.0 :type real)
  
positive.code:     net))
  
  (defmethod output-layer-error ((net t-net) (outputs vector))
    (let ((e-total (loop for neuron across (neuron-array (output-layer net))
                      for neuron-index from 0 below (length outputs)
                      for target-output = (aref outputs neuron-index)
                      summing
                        (* 1/2 (expt (- target-output (output neuron)) 2)))))
      (loop for neuron across (neuron-array (output-layer net))
         do (setf (err neuron) e-total))
      e-total))
  
  (defmethod learn-vector ((inputs vector) (outputs vector) (net t-net))
    (feed net inputs)
  
negative.code: 
  (defmethod transfer ((neuron t-neuron))
    (setf (output neuron)
          (if (eq (layer-type neuron) :input)
              (input neuron)
              (setf (output neuron) (/ 1.0 (1+ (exp (- (input neuron))))))))
              ;;(funcall (transfer-function neuron) neuron)))
    (setf (input neuron) (if (biased neuron) 1.0 0.0))
    neuron)
  
  