Skip to content

Commit

Permalink
Started transition to making PSB2 work with down-sampled lexicase. Mi…
Browse files Browse the repository at this point in the history
…ddle Character done.
  • Loading branch information
thelmuth committed Feb 6, 2021
1 parent 4c03664 commit e2d8bc1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/clojush/args.clj
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 335,7 @@
;; The parent selection method. Options include :tournament, :lexicase, :epsilon-lexicase,
;; :elitegroup-lexicase, :uniform, :leaky-lexicase, :random-threshold-lexicase,
;; :random-toggle-lexicase, :randomly-truncated-lexicase, :truncated-lexicase,
;; :novelty-search, :downsampled-lexcase
;; :novelty-search, :downsampled-lexicase

:epsilon-lexicase-version :semi-dynamic
;; The version of epsilon-lexicase selection to use.
Expand Down
1 change: 1 addition & 0 deletions src/clojush/problems/software/benchmarks_v2/basement.clj
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 207,7 @@
(def argmap
{:error-function (make-error-function-from-cases (first train-and-test-cases)
(second train-and-test-cases))
:training-cases (first train-and-test-cases)
:atom-generators atom-generators
:max-points 2000
:max-genome-size-in-initial-program 250
Expand Down
11 changes: 7 additions & 4 deletions src/clojush/problems/software/benchmarks_v2/middle_character.clj
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 93,7 @@
(for [[input1 correct-output] (case data-cases
:train train-cases
:test test-cases
[])]
data-cases)]
(let [final-state (run-push (:program individual)
(->> (make-push-state)
(push-item input1 :input)))
Expand All @@ -107,9 107,11 @@
(levenshtein-distance correct-output result)
1000) ; penalty for no return value
)))]
(if (= data-cases :train)
(assoc individual :behaviors @behavior :errors errors)
(assoc individual :test-errors errors))))))
(if (= data-cases :test)
(assoc individual :test-errors errors)
(assoc individual
:behaviors (reverse @behavior)
:errors errors))))))

(defn get-train-and-test
"Returns the train and test cases."
Expand Down Expand Up @@ -156,6 158,7 @@
(def argmap
{:error-function (make-error-function-from-cases (first train-and-test-cases)
(second train-and-test-cases))
:training-cases (first train-and-test-cases)
:atom-generators atom-generators
:max-points 2000
:max-genome-size-in-initial-program 250
Expand Down
2 changes: 1 addition & 1 deletion src/clojush/pushgp/report.clj
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 355,7 @@
visualize calculate-mod-metrics]
:as argmap}]
(r/generation-data! [:population]
(map #(dissoc % :program) population))
(map #(dissoc % :program) population))

(println)
(println ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;")
Expand Down

0 comments on commit e2d8bc1

Please sign in to comment.