start of simplification
This commit is contained in:
parent
d1d36eb3aa
commit
bac7751a83
@ -68,6 +68,7 @@ library
|
||||
, HushGP.GP.PushData
|
||||
, HushGP.GP.Selection
|
||||
, HushGP.GP.Individual
|
||||
, HushGP.GP.Simplification
|
||||
, HushGP.Problems.IntegerRegression
|
||||
, HushGP.Tools.Metrics
|
||||
|
||||
|
19
src/HushGP/GP/Simplification.hs
Normal file
19
src/HushGP/GP/Simplification.hs
Normal file
@ -0,0 +1,19 @@
|
||||
module HushGP.GP.Simplification where
|
||||
|
||||
import Control.Monad
|
||||
import HushGP.State
|
||||
import HushGP.GP.PushArgs
|
||||
|
||||
-- | Simplifies a Plushy by randomly deleting instructions and seeing how it impacts
|
||||
-- performance. Removes genes that have zero to negative performance impact.
|
||||
autoSimplifyPlushy :: PushArgs -> [Gene] -> IO [Gene]
|
||||
autoSimplifyPlushy pushArgs@PushArgs{simplificationVerbose = simpVerbose, errorFunction = eFunc, trainingData = tData} plushy = do
|
||||
when simpVerbose (print ("simplification start plushy length: " <> show (length plushy)))
|
||||
autoSimplifyPlushy' pushArgs (eFunc pushArgs tData plushy) 0 plushy
|
||||
|
||||
autoSimplifyPlushy' :: PushArgs -> [Double] -> Int -> [Gene] -> IO [Gene]
|
||||
autoSimplifyPlushy' pushArgs@PushArgs{simplificationSteps = simpSteps} initialErrors step plushy
|
||||
| step < simpSteps = do
|
||||
newPlushy <- undefined
|
||||
undefined
|
||||
| otherwise = undefined
|
Loading…
x
Reference in New Issue
Block a user