autosimplification implementation complete
This commit is contained in:
parent
f369d23ad5
commit
af22f9793b
1
.gitignore
vendored
1
.gitignore
vendored
@ -33,3 +33,4 @@ node_modules/
|
||||
# https://github.com/thelmuth/program-synthesis-benchmark-datasets
|
||||
/data
|
||||
**/.DS_Store
|
||||
.shadow-cljs/classpath.edn
|
||||
|
@ -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)
|
||||
|
@ -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))
|
||||
|
||||
|
9
src/propeller/problems/simple_regression.cljc
Executable file → Normal file
9
src/propeller/problems/simple_regression.cljc
Executable file → Normal file
@ -75,9 +75,16 @@
|
||||
: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}
|
||||
: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)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user