Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
44b1333
1
Parent(s):
386f4f2
Eternal best model actually hurts learning
Browse files
eureqa.jl
CHANGED
@@ -470,8 +470,6 @@ function run(
|
|
470 |
)::Population
|
471 |
|
472 |
allT = LinRange(1.0f0, 0.0f0, ncycles)
|
473 |
-
bestScore = Inf32
|
474 |
-
bestTree = Node(1f0)
|
475 |
for iT in 1:size(allT)[1]
|
476 |
if annealing
|
477 |
pop = regEvolCycle(pop, allT[iT], annealing=true)
|
@@ -479,14 +477,6 @@ function run(
|
|
479 |
pop = regEvolCycle(pop, 1.0f0, annealing=true)
|
480 |
end
|
481 |
|
482 |
-
# Save current best
|
483 |
-
bestCurScoreIdx = argmin([pop.members[member].score for member=1:pop.n])
|
484 |
-
bestCurScore = pop.members[bestCurScoreIdx].score
|
485 |
-
if bestCurScore < bestScore
|
486 |
-
bestScore = bestCurScore
|
487 |
-
bestTree = copyNode(pop.members[bestCurScoreIdx].tree)
|
488 |
-
end
|
489 |
-
|
490 |
if verbosity > 0 && (iT % verbosity == 0)
|
491 |
bestPops = bestSubPop(pop)
|
492 |
bestCurScoreIdx = argmin([bestPops.members[member].score for member=1:bestPops.n])
|
@@ -495,10 +485,6 @@ function run(
|
|
495 |
end
|
496 |
end
|
497 |
|
498 |
-
# TODO - make this the oldest member instead of 1
|
499 |
-
pop.members[1].tree = bestTree
|
500 |
-
pop.members[1].score = bestScore
|
501 |
-
|
502 |
return pop
|
503 |
end
|
504 |
|
|
|
470 |
)::Population
|
471 |
|
472 |
allT = LinRange(1.0f0, 0.0f0, ncycles)
|
|
|
|
|
473 |
for iT in 1:size(allT)[1]
|
474 |
if annealing
|
475 |
pop = regEvolCycle(pop, allT[iT], annealing=true)
|
|
|
477 |
pop = regEvolCycle(pop, 1.0f0, annealing=true)
|
478 |
end
|
479 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
480 |
if verbosity > 0 && (iT % verbosity == 0)
|
481 |
bestPops = bestSubPop(pop)
|
482 |
bestCurScoreIdx = argmin([bestPops.members[member].score for member=1:bestPops.n])
|
|
|
485 |
end
|
486 |
end
|
487 |
|
|
|
|
|
|
|
|
|
488 |
return pop
|
489 |
end
|
490 |
|