diff --git a/.gitignore b/.gitignore index df3fb06..0fc1327 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ node_modules/ # https://github.com/thelmuth/program-synthesis-benchmark-datasets /data **/.DS_Store +.shadow-cljs/classpath.edn diff --git a/src/propeller/gp.cljc b/src/propeller/gp.cljc index 7c87229..3c89f00 100644 --- a/src/propeller/gp.cljc +++ b/src/propeller/gp.cljc @@ -61,7 +61,7 @@ (prn {:total-test-error (:total-error (error-function argmap (:testing-data argmap) best-individual))}) (if (:simplification? argmap) - (let [simplified-plushy (simplification/auto-simplify-plushy argmap (:plushy best-individual) (:simplification-steps argmap) error-function (:training-data argmap) (:simplification-k argmap) (:simplification-k-prob argmap) (:simplification-verbose? argmap))] + (let [simplified-plushy (simplification/auto-simplify-plushy argmap (:plushy best-individual) (:simplification-steps argmap) error-function (:training-data argmap) (:simplification-k argmap) (:simplification-verbose? argmap))] (prn {:total-test-error-simplified (:total-error (error-function argmap (:testing-data argmap) (hash-map :plushy simplified-plushy)))})))) ;; (>= generation max-generations) diff --git a/src/propeller/problems/PSB2/fuel_cost.cljc b/src/propeller/problems/PSB2/fuel_cost.cljc index 9d45455..9462ebe 100644 --- a/src/propeller/problems/PSB2/fuel_cost.cljc +++ b/src/propeller/problems/PSB2/fuel_cost.cljc @@ -1,6 +1,7 @@ (ns propeller.problems.PSB2.fuel-cost (:require [psb2.core :as psb2] [propeller.genome :as genome] + [propeller.simplification :as simplification] [propeller.push.interpreter :as interpreter] [propeller.utils :as utils] [propeller.push.instructions :refer [get-stack-instructions]] @@ -81,3 +82,16 @@ :elitism false} (apply hash-map (map #(if (string? %) (read-string %) %) args)))) (#?(:clj shutdown-agents))) + + +(defn fuel-cost-autosimplify + [plushy] + (simplification/auto-simplify-plushy {: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 250 + :step-limit 2000} plushy 5000 error-function (:train train-and-test-data) 5 true)) + diff --git a/src/propeller/problems/simple_regression.cljc b/src/propeller/problems/simple_regression.cljc old mode 100755 new mode 100644 index d0f153e..dd0a063 --- a/src/propeller/problems/simple_regression.cljc +++ b/src/propeller/problems/simple_regression.cljc @@ -66,18 +66,25 @@ [& args] (gp/gp (merge - {:instructions instructions - :error-function error-function - :training-data (:train train-and-test-data) - :testing-data (:test train-and-test-data) - :max-generations 500 - :population-size 500 - :max-initial-plushy-size 100 - :step-limit 200 - :parent-selection :lexicase - :tournament-size 5 - :umad-rate 0.1 - :variation {:umad 0.5 :crossover 0.5} - :elitism false} - (apply hash-map (map #(if (string? %) (read-string %) %) args)))) + {:instructions instructions + :error-function error-function + :training-data (:train train-and-test-data) + :testing-data (:test train-and-test-data) + :max-generations 500 + :population-size 500 + :max-initial-plushy-size 100 + :step-limit 200 + :parent-selection :lexicase + :case-queue? false + :case-step 1 + :downsample-size 10 + :tournament-size 5 + :umad-rate 0.1 + :variation {:umad 0.5 :crossover 0.5} + :elitism false + :simplification? true + :simplification-steps 100 + :simplification-k 5 + :simplification-verbose? true} + (apply hash-map (map #(if (string? %) (read-string %) %) args)))) (#?(:clj shutdown-agents)))