Update camel-case for new problem specification scheme
This commit is contained in:
parent
e8d6670a2d
commit
e4a8e3a247
@ -6,7 +6,8 @@
|
|||||||
[propeller.push.utils.helpers :refer [get-stack-instructions]]
|
[propeller.push.utils.helpers :refer [get-stack-instructions]]
|
||||||
[propeller.push.state :as state]
|
[propeller.push.state :as state]
|
||||||
[propeller.tools.math :as math]
|
[propeller.tools.math :as math]
|
||||||
[propeller.tools.metrics :as metrics]))
|
[propeller.tools.metrics :as metrics]
|
||||||
|
[psb2.core :as psb2]))
|
||||||
|
|
||||||
; =========== PROBLEM DESCRIPTION =====================================
|
; =========== PROBLEM DESCRIPTION =====================================
|
||||||
; CAMEL CASE from PSB2
|
; CAMEL CASE from PSB2
|
||||||
@ -18,6 +19,8 @@
|
|||||||
; Source: https://arxiv.org/pdf/2106.06086.pdf
|
; Source: https://arxiv.org/pdf/2106.06086.pdf
|
||||||
; =======================================================================
|
; =======================================================================
|
||||||
|
|
||||||
|
(def train-and-test-data (psb2/fetch-examples "data" "camel-case" 200 2000))
|
||||||
|
|
||||||
; Visible character ERC
|
; Visible character ERC
|
||||||
(defn random-char
|
(defn random-char
|
||||||
[]
|
[]
|
||||||
@ -63,11 +66,8 @@
|
|||||||
|
|
||||||
|
|
||||||
(defn error-function
|
(defn error-function
|
||||||
([argmap individual]
|
([argmap data individual]
|
||||||
(error-function argmap individual :train))
|
|
||||||
([argmap individual subset]
|
|
||||||
(let [program (genome/plushy->push (:plushy individual) argmap)
|
(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)
|
inputs (map (fn [i] (get i :input1)) data)
|
||||||
correct-outputs (map (fn [i] (get i :output1)) data)
|
correct-outputs (map (fn [i] (get i :output1)) data)
|
||||||
outputs (map (fn [input]
|
outputs (map (fn [input]
|
||||||
@ -95,4 +95,8 @@
|
|||||||
:total-error #?(:clj (apply +' errors)
|
:total-error #?(:clj (apply +' errors)
|
||||||
:cljs (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)})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user