GP skeleton almost done

This commit is contained in:
Rowan Torbitzky-Lane 2025-02-25 18:48:05 -06:00
parent 2f6675e9f5
commit 5012cb2ce1

View File

@ -7,6 +7,8 @@ import Data.List (sort, uncons)
import HushGP.GP.PushArgs import HushGP.GP.PushArgs
import HushGP.Genome import HushGP.Genome
import HushGP.State import HushGP.State
import HushGP.GP.Variation
import HushGP.GP.Downsample
-- import Debug.Trace (trace, traceStack) -- import Debug.Trace (trace, traceStack)
@ -58,7 +60,8 @@ gpLoop' pushArgs generation evaluations population indexedTrainingData = do
print "Incomplete Run, saving the best so far." print "Incomplete Run, saving the best so far."
| otherwise = gpLoop' pushArgs (succ generation) | otherwise = gpLoop' pushArgs (succ generation)
(evaluations + (populationSize pushArgs * length (fst $ trainingData pushArgs)) + (if generation `mod` downsampleParentsGens pushArgs == 0 then length parentReps * (length (fst indexedTrainingData) - length (fst $ trainingData pushArgs)) else 0) + (if bestIndPassesDownsample then length (fst indexedTrainingData) - length (fst $ trainingData pushArgs) else 0)) (evaluations + (populationSize pushArgs * length (fst $ trainingData pushArgs)) + (if generation `mod` downsampleParentsGens pushArgs == 0 then length parentReps * (length (fst indexedTrainingData) - length (fst $ trainingData pushArgs)) else 0) + (if bestIndPassesDownsample then length (fst indexedTrainingData) - length (fst $ trainingData pushArgs) else 0))
(if elitism then bestInd : ) (if elitism pushArgs then bestInd : replicate (populationSize epsilonPushArgs - 1) (newIndividual epsilonPushArgs evaledPop) else replicate (populationSize epsilonPushArgs) (newIndividual epsilonPushArgs evaledPop))
(if enableDownsampling pushArgs then if (generation `mod` downsampleParentsGens pushArgs) == 0 then updateCaseDistances repEvaluatedPop indexedTrainingData indexedTrainingData (informedDownsamplingType pushArgs) (solutionErrorThreshold pushArgs / fromIntegral @Int @Double (length $ fst indexedTrainingData)) else indexedTrainingData else indexedTrainingData)
nextAction nextAction
where where
-- \| This will have downsampling added to it later. -- \| This will have downsampling added to it later.