Ah I see, I didn't realize I could apply the general-descend algorithm to 
both atoms and arrays to get a flattened list. Thanks!

On Friday, June 15, 2012 12:05:36 AM UTC-7, Meikel Brandmeyer (kotarak) 
wrote:
>
> 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 clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to