...Now these 'letter' things are confusing at first. Personally I don't know why exactly the manufacturers seem to think we need so many different ones, and a lot of them seem to do the same thing. Tozier seems to think that this is normal and that for "advanced" applications there may even be what he calls "diacriticals". He says he's seen them online somewhere, but I am skeptical and think he was probably looking at porn or something. Even more confusingly, certain letters are clearly overloaded badly in terms of their responsibilities:
A
for example, seems in some places to be what the manuals refer to as "soft", and other times "hard". But there's no notational difference indicated at all!We'll have to watch out for that (foreshadowing!).
Given a list as long and complicated as the twenty-something letters here, we decide to start at the beginning. Before we get to it, though, we probably should put the pointy thing into the wall thing so the computer goes. Several minutes pass as we watch
{ | |
:program | |
'[:booleans-pop \ 899300736 \ :exec-equal? :code-return-pop | |
#push.type.definitions.interval.Interval{:min 133/162, :max 331.08203125, | |
:min-open? true, :max-open? true} :intervals-generalize :char-as-set \0 | |
:vector-print 802246192M false #{#push.type.definitions.complex.Complex{ | |
:re 830429155, :im 143.53515625} :exec-as-set 938418139M :char->set | |
:tagspace-rerunall :string-indexofchar :ref-swap :scalar≤?} :complexes-nth | |
:boolean->set (:booleans-replacefirst [false] ["Tã{ Ú«" "¢(F%06"] |
() | |
() | |
() | |
(899300736) | |
(899300736) | |
(899300736) | |
(899300736) | |
(899300736) | |
(899300736) | |
(899300736) |
(ns push.design-spikes.clojush-running | |
(:use midje.sweet) | |
(:use clojure.pprint) | |
(:require [push.core :as push] | |
[push.interpreter.core :as i] | |
[push.util.legacy :as legacy])) | |
(def weirdo | |
'(in3 in3 in2 integer_shove integer_add in1 integer_mult in3 in3 integer_mult exec_do*count (exec_s in3 exec_dup (in2 integer_mult in1) integer_mult exec_do*count (in3 exec_dup (in2 integer_mult in1) integer_pop exec_y integer_add))) | |
) |
(defn rewrite-step | |
[n cutoff replacements] | |
(let [replaced-string | |
(reduce | |
(fn [result digit] (str result (str (nth replacements (- (int digit) 48))))) | |
"" (str n))] | |
(read-string (subs replaced-string 0 (min cutoff (count replaced-string)))))) | |
(def temp-table | |
(take 10 (repeatedly #(rand-int 1000)))) |
- build a relatively large dataset (1000+ training cases)
- wire up postgres store
- answers
- id (key)
- program (index)
- genome (index)
- instance-count
- scores
- timestamp
- 100 random answers -> datastore
tl;dr: it's a sketch
Generated a large number of random 20-gene genomes (bb8 representation), translated those into Push programs, ran them with 21 different input combinations (input :a
was an integer and :b
a :float
) for 300 steps, then collected the :integer
stack. The result was a 21-element "feature vector", in which each entry was an entire :integer
stack after running the program with the assigned input values.
As these were collected, they were stored using the feature vector (of :integer
stacks) as the key.
The list above is the count of each feature vector's occurrence, followed by the vector itself. The genomes were also stored, but are not recorded here.
This is a random "BB8" genome with :item
fields set to the numbers 1 through 18, plus 8 additional sub-trees. Each row of the trace below it shows the translated program derived from a point mutation of the prior line's genome, where the mutation was a random change of the :from
field of a randomly selected gene. The :put
and :item
genes have not been changed.
;;... | |
;; (:import [org.apfloat Apfloat ApfloatMath]) | |
(def precision 100) | |
;;... | |
(defn pretty-much-equal? | |
"takes two Apfloat items, subtracts one from the other, and returns `true` if the absolute difference is less a threshold set to half the current precision" |
caught exception: Value out of range for long: 1.4582948234106589E85 running | |
[342.44921875 227.47265625 "ࣲ࣊ݺaQᇧႂȾོቪÆભ୦՜ຨࢮ" \Ј 867977268 :code-pop "1ݢî" (:input!3 false :integer-divide true (("ᄴʗ" :input!3 :input!3 :string-yankdup 468875600) 680044766 :boolean-pop (30827267 217.14453125 true :char-notequal? 396804191) :string-fromfloat)) 223961527 :input!5 true 199.7734375 "ȑ˽܄ࠣჩцݺባ฿྅ӝိݫૄہ" "ठۏષྛ෧ࡨ" 16209681 :char-rotate (922763113 :char>? \' 230282795 :input!1) :input!3 "ńခ၄" (\μ \ᆱ (false :boolean-stackdepth :exec-y (\ 689117054 :input!2 :input!9 :exec-rotate) :boolean-frominteger) true :integer-inc) \ڽ 162.69921875 (:float-min 343.58203125 :integer-notequal? 212610666 :code-size) false "ף౫Ⴒ࿅లጕϗఈນੈ" :input!7 :string-fromchar "ቲؼ,৽ؗNਰድᄚચፑ" true false "ኑȵಫ൦Риލčັਰ०ሄቒ൸ೝቭତ" :boolean-pop :code-do*count (:string-rotate 338.91015625 "ጱ݁Ǿሃ߾ݮභ້ीמփΝႝଐ٩ݫȀᅣשອ" true :boolean-shove) false 266.0234375 247.34765625 243110307 ("ʊ" \ൂ \ኺ :integer-swap false) :input!6 362347294 (136932036 :input!8 "ӃIჱ" 314.6 |