TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Genetic Programming in Clojure

83 pointsby sulamiover 6 years ago

7 comments

SeanLukeover 6 years ago
This isn&#x27;t genetic programming at all.<p>What&#x27;s being described here is a kind of sample-based stochastic optimization which, if I were pressed, is most similar to an algorithm known as a &quot;(mu, lambda) evolution strategy&quot;. This is in the general subarea of evolutionary computation. Another algorithm in this area, for example, is the Genetic Algorithm.<p>Genetic Programming (GP) is the application of stochastic optimization techniques to a specific problem: the discovery and optimization of small computer programs or procedures. Because GP is famously associated with candidate solutions in the form of tree structures, it&#x27;s also applied to non-program optimization as long as the problem involves trees. That&#x27;s the rough boundary for the community.<p>The most famous example of a genetic programming system in Clojure is Lee Spector&#x27;s Clojush (<a href="https:&#x2F;&#x2F;github.com&#x2F;lspector&#x2F;Clojush" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lspector&#x2F;Clojush</a>).
评论 #18481514 未加载
评论 #18481868 未加载
评论 #18481441 未加载
_n9tfover 6 years ago
Terminology quibble: My understanding is that &quot;genetic programming&quot; refers not to all evolutionary algorithms, but specifically to those where the code itself (rather than &quot;a few key parameters&quot;) is evolved. This doesn&#x27;t seem to use or implement &#x27;eval&#x27; anywhere which I think immediately disqualifies it from meeting that definition.
评论 #18480439 未加载
davelnewtonover 6 years ago
This brings back memories... One of the greatest heads-down hacking I did was back in the day, running some variant of Common Lisp, working myself through Koza&#x27;s _Genetic Programming_ book. The designs arrived at were literally non-human. The story of the FPGA tone recognition circuit (spoiler: lot-specific design) was delightful.
评论 #18480372 未加载
lambdadmitryover 6 years ago
The trouble with genetic algorithms is that they are hardly worth it. It&#x27;s just one of metaheuristics [1], and despite being &quot;biology-inspired&quot; and good-sounding, it does perform worse than simpler alternatives like tabu search [2] or, even better, LAHC [3]. One of the reasons for that is that for local search the speed of neighborhood exploration is paramount, so theoretical advantages of GA get swamped by slower neighborhood iteration. In addition, LAHC or global annealing are <i>way</i> simpler to implement, they are literally just a few lines of code.<p>[1]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Metaheuristic" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Metaheuristic</a><p>[2]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Tabu_search" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Tabu_search</a><p>[3]: <a href="https:&#x2F;&#x2F;link.springer.com&#x2F;chapter&#x2F;10.1007&#x2F;978-3-642-41019-2_13" rel="nofollow">https:&#x2F;&#x2F;link.springer.com&#x2F;chapter&#x2F;10.1007&#x2F;978-3-642-41019-2_...</a>
评论 #18481851 未加载
评论 #18481411 未加载
bedersover 6 years ago
To be fair, the author uses a very simple program: a number that evaluates to itself to show the general approach for a genetic algorithm.<p>It shows quite nicely the advantages of dynamic typing and abstractions together with very readable data manipulation code. A great showcase for Clojure&#x27;s capabilities.<p>Looking forward to the next part where the author wants to mutate s-expressions.<p>(I&#x27;m aware that all of this has been done before sometime in the 90s with Prolog and CommonLisp mostly)
评论 #18482495 未加载
yogthosover 6 years ago
I&#x27;d also recommend taking a look at the following libraries<p><a href="https:&#x2F;&#x2F;github.com&#x2F;lspector&#x2F;Clojush" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lspector&#x2F;Clojush</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;emilyagras&#x2F;clojenetics" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;emilyagras&#x2F;clojenetics</a>
rhn_mk1over 6 years ago
I&#x27;ve always wanted to try genetic algorithms in practice, but whenever I came across a problem that could be solved this way, I was stuck on point 1.<p>How to parametrize my problem? Be it mathematical operations, source code or gates, how to separate it in pieces that can be mutated efficiently?
评论 #18486249 未加载