Update camel-case for new problem specification scheme

This commit is contained in:
Lee Spector 2021-07-13 22:41:25 -04:00
parent e8d6670a2d
commit e4a8e3a247

View File

@ -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)})