diff --git a/src/propeller/problems/PSB2/camel_case.cljc b/src/propeller/problems/PSB2/camel_case.cljc index 542b62e..6fa9904 100644 --- a/src/propeller/problems/PSB2/camel_case.cljc +++ b/src/propeller/problems/PSB2/camel_case.cljc @@ -6,7 +6,8 @@ [propeller.push.utils.helpers :refer [get-stack-instructions]] [propeller.push.state :as state] [propeller.tools.math :as math] - [propeller.tools.metrics :as metrics])) + [propeller.tools.metrics :as metrics] + [psb2.core :as psb2])) ; =========== PROBLEM DESCRIPTION ===================================== ; CAMEL CASE from PSB2 @@ -18,6 +19,8 @@ ; Source: https://arxiv.org/pdf/2106.06086.pdf ; ======================================================================= +(def train-and-test-data (psb2/fetch-examples "data" "camel-case" 200 2000)) + ; Visible character ERC (defn random-char [] @@ -63,11 +66,8 @@ (defn error-function - ([argmap individual] - (error-function argmap individual :train)) - ([argmap individual subset] + ([argmap data individual] (let [program (genome/plushy->push (:plushy individual) argmap) - data (get (get argmap :train-and-test-data) subset) inputs (map (fn [i] (get i :input1)) data) correct-outputs (map (fn [i] (get i :output1)) data) outputs (map (fn [input] @@ -95,4 +95,8 @@ :total-error #?(:clj (apply +' errors) :cljs (apply + errors)))))) - +(def arglist + {:instructions instructions + :error-function error-function + :training-data (:train train-and-test-data) + :testing-data (:test train-and-test-data)})