Skip to content

Commit 05bb528

Browse files
authored
Update Gep.jl
1 parent c0ec791 commit 05bb528

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Gep.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,6 @@ function runGep(epochs::Int,
335335
fits_representation[index] = population[index].fitness
336336
end
337337

338-
best_r = compute_fitness(population[1], operators, x_data, y_data,
339-
get_loss_function("r2_score"), zero(T); validate=true)
340338
val_loss = compute_fitness(population[1], operators, x_data_test, y_data_test, loss_fun, typemax(T); validate=true)
341339
record!(recorder, epoch, fits_representation[1], val_loss, fits_representation)
342340

@@ -348,7 +346,7 @@ function runGep(epochs::Int,
348346
])
349347

350348

351-
if isclose(best_r, one(T))
349+
if isclose(fits_representation[1], zero(T))
352350
break
353351
end
354352

@@ -371,4 +369,4 @@ function runGep(epochs::Int,
371369
close_recorder!(recorder)
372370
return best, recorder.history
373371
end
374-
end
372+
end

0 commit comments

Comments
 (0)