News for hackers. Stuff that matters.
Re:Neat Algorithms - Harmony Search by TrevorBurnham on Saturday May 07, 2011 @10:48PM (#2525114)
Beautiful CoffeeScript code for metaheuristic optimization. The visualizations are done in Protovis. A common misconception is that Protovis has its own language, since Protovis code is usually in

  <script type="text/javascript+protovis">
tags, which lets you write code like

  function(x) x*x
This is actually JavaScript 1.8 (see https://developer.mozilla.org/en/New_in_JavaScript_1.8); Firefox can handle it directly, but Protovis down-compiles it to standard JavaScript for the benefit of other browsers.

That design decision made a lot of sense before CoffeeScript existed, since standard JavaScript becomes extremely unwieldy in a Protovis context. I expect to see a lot more Protovis code done in CoffeeScript in the future.

[deleted]
Re:Neat Algorithms - Harmony Search by TrevorBurnham on Saturday May 07, 2011 @11:14PM (#2525149)
Happens to everyone.
Re:Neat Algorithms - Harmony Search by wickedchicken on Sunday May 08, 2011 @12:55AM (#2525287)
This is very detailed and chock full of great visualizations, but I still can't figure out how harmony search is fundamentally different than your run-of-the-mill genetic algorithm. What am I missing?
Re:Neat Algorithms - Harmony Search by nephics on Sunday May 08, 2011 @03:50AM (#2525459)
It's not different. Both are random search algorithms packaged in a (somewhat complex) human abstraction. The convergence properties are the same as for other search algorithms using meta heuristics, including the classic simulated annealing algorithm.
Re:Neat Algorithms - Harmony Search by extension on Sunday May 08, 2011 @10:23AM (#2525908)
It looks to me like a GA that can mix and match chromosomes from a set of fit candidates instead of just mutating them individually. In other words, sex.
Re:Neat Algorithms - Harmony Search by gabi38 on Sunday May 08, 2011 @03:50AM (#2525460)
That it has a cool name..
Re:Neat Algorithms - Harmony Search by tel on Sunday May 08, 2011 @11:25AM (#2526047)
The metaphor with jazz music isn't terribly illuminating.

The short of the algorithm is that it generates a set of random vectors and evaluates the objective for each one. It then stochastically chooses between perturbed components from elements in that set and new random components to build a test vector. If that vector performs better than the worst one in the set, it replaces the worst one.

I'm pretty sure that process doesn't look very similar to jazz improvisation. It's also not nearly as complicated as it's made out to be. I also am a little frustrated that neither of his problems were good fits for an algorithm like this and so I dunno if I can walk away calling this a neat algorithm.

I am super inspired to play with protovis though.

Re:Neat Algorithms - Harmony Search by janzer on Sunday May 08, 2011 @05:37AM (#2525570)
While it doesn't have the demo or Coffeescript code, I found the wikipedia page much easier to comprehend what the algorithm actually does. http://en.wikipedia.org/wiki/Harmony_search