lspector / taggp Goto Github PK
View Code? Open in Web Editor NEWTree-based genetic programming with tagging.
Tree-based genetic programming with tagging.
I thought I'd use this "issue" more as a discussion.
If you take a look at the newly refactored tags.clj and recursion.clj, you'll see that recursion.clj redefines all of eval-with-tagging. I had tried to abstract out all of the consequents of the conditional, so that eval-with-tagging for each condition would be calling
(cond (pred-fn? expression) (eval-pred-fn expression tag-space steps default-value)
(another-pred-fn? expression) (trampoline eval-another-pred-fn expression tag-space steps default-value)
...
where the trampolined expressions replaced the recur call. Unfortunately this lead to stack over flows in the else clause, presumably due to the accumulation of calls on the stack from the un-trampolined call in its loop. I thought this might be a more elegant way to go, so instead of copying and pasting over the entire eval-with-tagging function, we could just modify the constituent eval functions (thereby also limiting the number of newly introduced bugs). However, to make this work, I would need to rethink the recursive calls in eval-with-tagging to handle the evaluation with args (presumably by carrying in it some extra variables to hold the deferred function and a queue of its args).
Anyone have any better thoughts on this matter?
Should recursion elimination be specified as a global? As an argument to evolve? The type is currently hardcoded in eval-with-tagging.
Create a new namespace to store generation data to be called in in core.clj. This will include things like the best individual, average error, etc. New features can then be added in an experimental namespace in the style of recursion.clj without having to alter the entire evolve function.
Default value version needs testing (in refactored branch).
Change taggp to properly handle untagging-based recursion elimination, both with real untagging and with default replacement.
Add system-wide tests in addition to unit test for new features.
Unit tests can be attached to functions in metadata (I'm currently having difficulty pulling this off).
Where to put larger system tests?
Implement random-seed hack thingie so random is truly random.
So far only a random-seed global has been added to the globals namespace.
Argument checking and parsing is currently done in the example files. This should be taken care of in core.clj
Update remaining examples to work with refactored taggp.
Rewrite taggp so that it no longer eats stack frames and dies for deep recursion.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.