separate argmap from -main
This commit is contained in:
parent
960b561e3e
commit
b698faae08
@ -62,6 +62,21 @@
|
|||||||
:total-error #?(:clj (apply +' errors)
|
:total-error #?(:clj (apply +' errors)
|
||||||
:cljs (apply + errors))))))
|
:cljs (apply + errors))))))
|
||||||
|
|
||||||
|
(def integer-argmap
|
||||||
|
{:instructions instructions
|
||||||
|
:error-function error-function
|
||||||
|
:training-data (:train train-and-test-data)
|
||||||
|
:testing-data (:test train-and-test-data)
|
||||||
|
:max-generations 300
|
||||||
|
:population-size 1000
|
||||||
|
:max-initial-plushy-size 5
|
||||||
|
:step-limit 200
|
||||||
|
:parent-selection :lexicase
|
||||||
|
:tournament-size 5
|
||||||
|
:umad-rate 0.1
|
||||||
|
:variation {:umad 1.0 :crossover 0.0}
|
||||||
|
:elitism false})
|
||||||
|
|
||||||
(defn -main
|
(defn -main
|
||||||
"Runs the top-level genetic programming function, giving it a map of
|
"Runs the top-level genetic programming function, giving it a map of
|
||||||
arguments with defaults that can be overridden from the command line
|
arguments with defaults that can be overridden from the command line
|
||||||
@ -69,17 +84,5 @@
|
|||||||
[& args]
|
[& args]
|
||||||
(gp/gp
|
(gp/gp
|
||||||
(merge
|
(merge
|
||||||
{:instructions instructions
|
integer-argmap
|
||||||
:error-function error-function
|
|
||||||
:training-data (:train train-and-test-data)
|
|
||||||
:testing-data (:test train-and-test-data)
|
|
||||||
:max-generations 300
|
|
||||||
:population-size 1000
|
|
||||||
:max-initial-plushy-size 100
|
|
||||||
:step-limit 200
|
|
||||||
:parent-selection :lexicase
|
|
||||||
:tournament-size 5
|
|
||||||
:umad-rate 0.1
|
|
||||||
:variation {:umad 1.0 :crossover 0.0}
|
|
||||||
:elitism false}
|
|
||||||
(apply hash-map (map #(if (string? %) (read-string %) %) args)))))
|
(apply hash-map (map #(if (string? %) (read-string %) %) args)))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user