20 July 2010

Various forms of named parameters in Clojure, kind of...

The short of it, from Measuring Measures' Named Parameters in Clojure post is this:

user> (defn a [{b :b c :c}] (- b c))
#'user/a
user> (a {:c 5 :b 11})
6

But that's very repetitive for too many named parameters, so there's this other form too:

user> (defn a [{:keys [b c]}] (- b c))
#'user/a
user> (a {:c 5 :b 11})
6

That's very useful when there's just a lot of arguments to pass around. What if you want to keep all those arguments in a map to continue passing around? There's this option:

user> (defn a [{:keys [b c] :as args}] (- (:b args) c))
#'user/a
user> (a {:c 5 :b 11})
6

These are technically not named parameters at all, but a way to destructure maps passed as an argument to a function.

Caution is in order, however, as you should only destructure in the arg[ument] list if you want to communicate the substructure as part of the caller contract. Otherwise, destructure in a first-line let [Clojure Library Coding Standards], perhaps like so:

user> (defn a [argmap] (let [{:keys [b c]} argmap] (- b c)))
#'user/a
user> (defn a2 [argmap] (let [{b :b c :c} argmap] (- b c)))
#'user/a2
user> (a {:c 5 :b 11})
6
user> (a2 {:c 5 :b 11})
6

15 July 2010

3 Great Talks on Machine Learning

Three great talks on machine learning on YouTube:

1. GoogleTechTalks: Recent Developments in Deep Learning
Geoff Hinton, University of Toronto.



2. citrisuc: TODAY: Innovation in Search and Artificial Intelligence
Peter Norvig, Director of Research, Google.



3. GoogleTechTalks: The Next Generation of Neural Networks
Geoff Hinton, University of Toronto (again).
(Sorry, no embed.)

09 July 2010

Studying for the GRE: Strategies

Despite the ETS saying the GRE General Test is not coach-able, you most certainly could prepare more effectively for it. To do so, let's think about what the GRE really is. It is a glorified high school cumulative exam testing your:
  1. English vocabulary,
  2. comprehension,
  3. writing, and
  4. close-reading analysis skills, and your
  5. math arithmetic,
  6. geometry,
  7. algebra, and
  8. problem solving skills.
Furthermore, it expects that
  1. you are familiar with test taking skills for either the paper or computer based test (whichever you signed up for).
That is all!

That means a test preparation strategy that enhances your skills in those nine areas is sufficient for you to do extraordinarily well on the GRE General. So specifically, what might you decide to do to prepare then?

Here are some specific strategies you could employ [1] to counter the nine areas I listed above: