Remove extraneous argmap argument; experiment with valiant

This commit is contained in:
Lee Spector 2020-12-08 12:12:23 -05:00
parent bb916c2ad3
commit d49f9e4bf0
6 changed files with 48 additions and 11 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
src/.DS_Store vendored

Binary file not shown.

Binary file not shown.

View File

@ -25,11 +25,12 @@
(def instructions
(vec (concat (for [i (range num-inputs)] (keyword (str "in" i)))
(take num-inputs
(cycle [:boolean_and
:boolean_or
:boolean_not
:exec_if
'close])))))
(cycle [:boolean_xor
;:boolean_or
;:boolean_not
;:exec_if
;'close
])))))
(defn error-function
([argmap individual]

View File

@ -156,19 +156,55 @@
; :diploid true})
;(gp/gp {:instructions propeller.problems.valiant/instructions
; :error-function propeller.problems.valiant/error-function
; :max-generations 500
; :population-size 50
; :max-initial-plushy-size 1000
; :step-limit 2000
; :parent-selection :tournament
; :tournament-size 10
; :umad-rate 0.01
; :diploid-flip-rate 0.01
; :variation {:umad 0.9
; :diploid-flip 0.1
; }
; :elitism false
; :diploid true})
;(gp/gp {:instructions propeller.problems.valiant/instructions
; :error-function propeller.problems.valiant/error-function
; :max-generations 500
; :population-size 100
; :max-initial-plushy-size 1000
; :step-limit 2000
; :parent-selection :tournament
; :tournament-size 10
; :umad-rate 0.01
; :diploid-flip-rate 0.01
; :variation {:umad 0.9
; :diploid-flip 0.1
; }
; :elitism false
; :diploid true})
;;; below is when I switched to just xor
(gp/gp {:instructions propeller.problems.valiant/instructions
:error-function propeller.problems.valiant/error-function
:max-generations 500
:population-size 500
:max-initial-plushy-size 1000
:max-initial-plushy-size 50
:step-limit 2000
:parent-selection :lexicase
:tournament-size 5
:umad-rate 0.001
:diploid-flip-rate 0.001
:tournament-size 2
:umad-rate 0.01
:diploid-flip-rate 0.01
:variation {:umad 0.5
:diploid-flip 0.5
:crossover 0.25
:diploid-flip 0.25
}
:elitism false
:diploid true})

View File

@ -18,7 +18,7 @@
(defn diploid-crossover
"Crosses over two individuals using uniform crossover. Pads shorter one."
[plushy-a plushy-b argmap]
[plushy-a plushy-b]
(let [plushy-a (partition 2 plushy-a)
plushy-b (partition 2 plushy-b)
shorter (min-key count plushy-a plushy-b)