Eliminate :bmx-enrichment, and because of that, argmap preprocessing for gp
This commit is contained in:
parent
2fa6eb5671
commit
85a59cdbe5
@ -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)))))
|
|
||||||
|
@ -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)))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user