Hi,
you can use destructuring to provide defaults. And you can easily curry in
options when passing things through.
(defn general-descend
[xy ys &
{:keys [gradient-fn cost-fn yield-fn alpha iterations thetas]
:or {cost-fn cost
yield-fn println
alpha 0.01
iterations 1000
thetas (matrix 0 (second (dim xs)) 1)}}]
...)
(defn special-descend
[xs ys & options]
(apply general-descend xs ys :cost-fn cost options))
Kind regards
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en