(defn gradient [x] (mmult (trans A) (diag (to-list (exp ( mmult A x ) ) ) ) ) )