 (defrecord Logistic [output input-gradient]
   cp/PModule
     (calc [this input]
-      (let [output (:output this)
-            output-exists? (boolean output)
-            output (if output-exists? output (m/mutable input))
-            this (if output-exists? this (assoc this :output output))]
+      (let []
         (m/assign! output input)
         (m/logistic! output)
         this))

        this))
    
    (input-gradient [this]
      (:input-gradient this)))

;; a function that implements a linear transformation (weights + bias)
;; has mutable parameters and accumlators for gradient

    
  cp/PNeuralTraining
    (forward [this input]
      (cp/calc this input))
    
    (backward [this input output-gradient]
      (let []
