Compare commits
No commits in common. "b166bacfb556a692fc37e44ffb18a9ec780a7fef" and "960b561e3e1aae4f6d7cf5b4f73109ea1fbd26e5" have entirely different histories.
b166bacfb5
...
960b561e3e
@ -62,21 +62,6 @@
|
|||||||
: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
|
||||||
@ -84,5 +69,17 @@
|
|||||||
[& args]
|
[& args]
|
||||||
(gp/gp
|
(gp/gp
|
||||||
(merge
|
(merge
|
||||||
integer-argmap
|
{:instructions instructions
|
||||||
(apply hash-map (map #(if (string? %) (read-string %) %) args)))))
|
: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)))))
|
||||||
|
@ -16,10 +16,7 @@
|
|||||||
[propeller.variation :as variation]
|
[propeller.variation :as variation]
|
||||||
[propeller.push.instructions :as instructions]
|
[propeller.push.instructions :as instructions]
|
||||||
[propeller.push.interpreter :as interpreter]
|
[propeller.push.interpreter :as interpreter]
|
||||||
[propeller.push.state :as state]
|
[propeller.push.state :as state]))
|
||||||
[propeller.problems.regression.integer-regression :as regression]
|
|
||||||
[propeller.downsample :as downsample]
|
|
||||||
))
|
|
||||||
|
|
||||||
;; Interpreting a simple Push program:
|
;; Interpreting a simple Push program:
|
||||||
|
|
||||||
@ -34,10 +31,9 @@
|
|||||||
;; A program with a conditional:
|
;; A program with a conditional:
|
||||||
|
|
||||||
#_(interpreter/interpret-program
|
#_(interpreter/interpret-program
|
||||||
'(3 3 :integer_eq :exec_if (1 "yes") (2 "no"))
|
'(3 3 :integer_eq :exec_if (1 "yes") (2 "no"))
|
||||||
;;(assoc state/empty-state :keep-history true)
|
state/empty-state
|
||||||
state/empty-state
|
1000)
|
||||||
1000)
|
|
||||||
|
|
||||||
;; A program using an input instruction:
|
;; A program using an input instruction:
|
||||||
|
|
||||||
@ -70,14 +66,14 @@
|
|||||||
;; items defined for the problem. Depending on your IDE and setup, you may
|
;; items defined for the problem. Depending on your IDE and setup, you may
|
||||||
;; also have to open the problem's file and evaluate its contents.
|
;; also have to open the problem's file and evaluate its contents.
|
||||||
|
|
||||||
;;#_(require '[propeller.problems.simple-regression :as regression])
|
#_(require '[propeller.problems.simple-regression :as regression])
|
||||||
|
|
||||||
#_(gp/gp {:instructions regression/instructions
|
#_(gp/gp {:instructions regression/instructions
|
||||||
:error-function regression/error-function
|
:error-function regression/error-function
|
||||||
:training-data (:train regression/train-and-test-data)
|
:training-data (:train regression/train-and-test-data)
|
||||||
:testing-data (:test regression/train-and-test-data)
|
:testing-data (:test regression/train-and-test-data)
|
||||||
:max-generations 5
|
:max-generations 500
|
||||||
:population-size 50
|
:population-size 500
|
||||||
:max-initial-plushy-size 100
|
:max-initial-plushy-size 100
|
||||||
:step-limit 200
|
:step-limit 200
|
||||||
:parent-selection :tournament
|
:parent-selection :tournament
|
||||||
@ -115,5 +111,3 @@
|
|||||||
#_(require '[propeller.problems.simple-regression :as regression])
|
#_(require '[propeller.problems.simple-regression :as regression])
|
||||||
#_(regression/-main :population-size 100 :variation {:umad 1.0})
|
#_(regression/-main :population-size 100 :variation {:umad 1.0})
|
||||||
|
|
||||||
;; Analyze how downsample indicies are assigned
|
|
||||||
#_(downsample/assign-indices-to-data (:train regression/train-and-test-data) regression/integer-argmap)
|
|
Loading…
x
Reference in New Issue
Block a user