Compare commits
3 Commits
53c490b3b3
...
2d9840c51b
Author | SHA1 | Date | |
---|---|---|---|
2d9840c51b | |||
5012cb2ce1 | |||
2f6675e9f5 |
@ -63,6 +63,7 @@ library
|
|||||||
, HushGP.GP
|
, HushGP.GP
|
||||||
, HushGP.GP.PushArgs
|
, HushGP.GP.PushArgs
|
||||||
, HushGP.GP.Variation
|
, HushGP.GP.Variation
|
||||||
|
, HushGP.GP.Downsample
|
||||||
, HushGP.Problems.IntegerRegression
|
, HushGP.Problems.IntegerRegression
|
||||||
|
|
||||||
|
|
||||||
|
@ -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 && ((generation `mod` downsampleParentsGens pushArgs) == 0) then updateCaseDistances repEvaluatedPop indexedTrainingData indexedTrainingData (informedDownsamplingType pushArgs) (solutionErrorThreshold pushArgs / fromIntegral @Int @Double (length $ fst indexedTrainingData)) else indexedTrainingData)
|
||||||
nextAction
|
nextAction
|
||||||
where
|
where
|
||||||
-- \| This will have downsampling added to it later.
|
-- \| This will have downsampling added to it later.
|
||||||
|
7
src/HushGP/GP/Downsample.hs
Normal file
7
src/HushGP/GP/Downsample.hs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
module HushGP.GP.Downsample where
|
||||||
|
|
||||||
|
import HushGP.State
|
||||||
|
import HushGP.Genome
|
||||||
|
|
||||||
|
updateCaseDistances :: [Individual] -> ([[Gene]], [Gene]) -> ([[Gene]], [Gene]) -> String -> Double -> ([[Gene]], [Gene])
|
||||||
|
updateCaseDistances evaledPop downsampleData trainingData informedDownsamplingType solutionThreshold = undefined
|
Loading…
x
Reference in New Issue
Block a user