Ah ok - so I may be using it wrong. I am not calling the function itself - I was simply trying to bind local variables in a loop.
I have placed the code into gists for easier reading! https://gist.github.com/anonymous/5841405#file-core-clj https://gist.github.com/anonymous/5841420#file-vec-clj Is there another way to mimic procedural type looping? On Saturday, June 22, 2013 2:39:01 AM UTC-4, Cedric Greevey wrote: > > An algorithm like that generating StackOverflowErrors suggests it's > recursing deeply, which suggests you're not using recur *enough*. If the > function calls itself, try to see if you can get that call into tail > position and change it to "recur". > > > On Fri, Jun 21, 2013 at 4:06 PM, P Martin <prof.pm...@gmail.com<javascript:> > > wrote: > >> Hi, >> >> I am new to clojure and I am trying to reimplement some optimization code >> that uses gradient descent. I have attached the source to this post. My >> experience with gradient descent is in Matlab, which is procedural. >> >> When I run my function gradient-descent I supply step sizes and error >> values of 0.01, it runs correctly and gives me good results. However, if I >> decrease the error value below 0.001 it produces a stack overflow error. I >> get the same error if my step value goes down to 0.001. >> >> Is my looping mechanism correct and I am just having numerical >> limitations? Am I abusing loop/recur? Any suggestions/critiques would be >> great! >> >> Thanks, >> Patrick >> >> -- >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clo...@googlegroups.com<javascript:> >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+u...@googlegroups.com <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+u...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.