Archive for November, 2010

Visual demos of Psh in Processing

Thursday, November 18th, 2010

Tom Helmuth has produced two nice demos of Psh being used in the the Processing programming environment:

  • PshApplet: A symbolic regression demonstration
  • PushBrush: An arts-oriented, visual demonstration

Clojush lawnmower, tweaked ant

Sunday, November 7th, 2010

I’ve added an example problem to Clojush for Koza’s lawnmower problem (from his GP II book, 1994). Koza used this problem to demonstrate the utility of ADFs, and it should be a good benchmark for modularity mechanisms more generally. From my first quick tests it looks like tags help quite a bit here. Of course it’s possible that other Push mechanisms will as well. From a Clojush hacking perspective this example might also be helpful insofar as it shows how to add a new type/stack without messing with the code in clojush.clj — I did this because Koza’s formulation of the lawnmower problem is based on 2-element integer vectors. Also in this update I’ve tweaked the parameters on the ant examples, after noticing that bloat is a real problem for these and that the simplification operator helps.

Available as usual from: https://github.com/lspector/Clojush

20101106: - Tweaked parameters in ant examples; among other things,
            increased simplification since bloat was an issue. Also
            added some evolved solutions in comments.
20101107: - Added Koza's lawnmower problem example; this demonstrates how
            to add a new type/stack on a problem-specific basis, without
            altering clojush.clj.

First evolved tag use

Thursday, November 4th, 2010

The following solution to the tg8 regression example is the first thing I’ve evolved (and then hand simplified) that makes use of stackless tagging. It uses a single tag, associated with the code “(in integer_mult)” — this is a subroutine that multiplies whatever is on top of the integer stack by the input.

(tag_exec_837 (in integer_mult)
  6 (integer_mult tagged_778) (in -10)
  (integer_mult integer_add in integer_sub -2 in in
    integer_sub 10 integer_add tagged_20 in tagged_237
    integer_sub integer_sub integer_sub -3 integer_add
    in integer_div tagged_767 tagged_601 tagged_20 6
    tagged_237 integer_sub in integer_add tagged_20 in
    integer_add in integer_add in integer_add in
    integer_mult 1 integer_add 4 integer_add))

Stackless tagging (+ fixes/enhancements) in Clojush

Thursday, November 4th, 2010

Several changes have been made to Clojush, the most significant of which is the implementation of stackless tagging (motivated here and here, with the implemented details described below).

20101102: - Switched to new clojure.core/frequencies from depricated
            seq-utils/frequencies (h/t Kyle Harrington), and similarly
            for flatten.
          - Added :include-randoms keyword argument for registered-for-type.
            Defaults to true, but if specified as false then instructions
            ending with "_rand" will be excluded.
          - Raised invalid output penalty in tg8 (it was lower than reasonable
            errors for that problem).
20101103: - Converted evalpush-limit and evalpush-time-limit into vars
            (global-evalupush-limit and global-evalpush-time-limit) bound
            to atoms that are reset by calls to pushgp (keyword arguments
            :evalpush-limit and :evalpush-time-limit).
          - Changed pushgp parameters in the tg8.clj example.
20101104: - Implemented stackless tagging (see http://push.i3ci.hampshire.edu/
            2010/10/28/stackless-tagging/). Tag instructions take one of
            the following forms:
              tag_<type>_<number>
                create tage/value association, with the value taken from the
                stack of the given type and the number serving as the tag
              untag_<number>
                remove the association for the closest-matching tag
              tagged_<number>
                push the value associated with the closest-matching tag onto
                the exec stack (or no-op if no associations).
            Here "closest-matching" means the tag with lowest number that
            is greater than or equal to the number of the tag being matched,
            or the lowest-numbered tag if none meet this criterion. Tag
            instructions are not implemented in the same way as other
            instructions; they are detected and handled specially by the
            interpreter (see execute-instruction). Tag instructions
            can be included in pushgp runs by using the new ephemeral
            random constant functions tag-instruction-erc,
            untag-instruction-erc, and tagged-instruction-erc, each of
            which takes a limit (for the numerical part) as an
            argument.
          - Added examples using tags: tagged_ant, tagged_regression, and
            tagged_tg8.