From 85a59cdbe5549f9f65f72a3994a061133eadd216 Mon Sep 17 00:00:00 2001 From: Lee Spector Date: Wed, 6 Dec 2023 14:56:02 -0500 Subject: [PATCH] Eliminate :bmx-enrichment, and because of that, argmap preprocessing for gp --- src/propeller/gp.cljc | 18 ++---------------- src/propeller/problems/boolean/mul3.cljc | 3 +-- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/propeller/gp.cljc b/src/propeller/gp.cljc index d133088..18576d7 100644 --- a/src/propeller/gp.cljc +++ b/src/propeller/gp.cljc @@ -49,8 +49,8 @@ (prn {:run-completed true}) nil) -(defn gp-loop - "Main GP loop." +(defn gp + "Main GP function" [{:keys [population-size max-generations error-function instructions max-initial-plushy-size solution-error-threshold ds-parent-rate ds-parent-gens dont-end ids-type downsample?] :or {solution-error-threshold 0.0 @@ -174,17 +174,3 @@ indexed-training-data) indexed-training-data)))))) -(defn gp - "Top-level gp function. Calls gp-loop with possibly-adjusted arguments." - [argmap] - (let [adjust-for-bmx - (fn [args] - (let [prob-bmx (:bmx (:variation args)) - prob-bmx-umad (:bmx-umad (:variation args)) - n (:bmx-enrichment args)] - (if (or (and prob-bmx (> prob-bmx 0)) - (and prob-bmx-umad (> prob-bmx-umad 0))) - (update args :instructions concat (repeat (or n 1) :gap)) - args)))] - (gp-loop (-> argmap - (adjust-for-bmx))))) diff --git a/src/propeller/problems/boolean/mul3.cljc b/src/propeller/problems/boolean/mul3.cljc index cea9110..b1f30df 100644 --- a/src/propeller/problems/boolean/mul3.cljc +++ b/src/propeller/problems/boolean/mul3.cljc @@ -311,6 +311,5 @@ :bmx 0 :bmx-umad 1} :single-thread-mode false - :bmx-exchange-rate 0.1 - :bmx-enrichment 10} + :bmx-exchange-rate 0.1} (apply hash-map (map #(if (string? %) (read-string %) %) args)))))