Eliminate :bmx-enrichment, and because of that, argmap preprocessing for gp

This commit is contained in:
Lee Spector 2023-12-06 14:56:02 -05:00
parent 2fa6eb5671
commit 85a59cdbe5
2 changed files with 3 additions and 18 deletions

View File

@ -49,8 +49,8 @@
(prn {:run-completed true}) (prn {:run-completed true})
nil) nil)
(defn gp-loop (defn gp
"Main GP loop." "Main GP function"
[{:keys [population-size max-generations error-function instructions max-initial-plushy-size [{: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?] solution-error-threshold ds-parent-rate ds-parent-gens dont-end ids-type downsample?]
:or {solution-error-threshold 0.0 :or {solution-error-threshold 0.0
@ -174,17 +174,3 @@
indexed-training-data) indexed-training-data)
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)))))

View File

@ -311,6 +311,5 @@
:bmx 0 :bmx 0
:bmx-umad 1} :bmx-umad 1}
:single-thread-mode false :single-thread-mode false
:bmx-exchange-rate 0.1 :bmx-exchange-rate 0.1}
:bmx-enrichment 10}
(apply hash-map (map #(if (string? %) (read-string %) %) args))))) (apply hash-map (map #(if (string? %) (read-string %) %) args)))))