Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
483a583
1
Parent(s):
e2fe9b0
NaN detection
Browse files
eureqa.jl
CHANGED
@@ -346,11 +346,12 @@ function iterate(
|
|
346 |
delta = afterLoss - beforeLoss
|
347 |
probChange = exp(-delta/(T*alpha))
|
348 |
|
349 |
-
if probChange
|
350 |
-
return
|
351 |
end
|
352 |
|
353 |
-
return
|
|
|
354 |
catch error
|
355 |
# Sometimes too many chained exp operators
|
356 |
if isa(error, DomainError)
|
|
|
346 |
delta = afterLoss - beforeLoss
|
347 |
probChange = exp(-delta/(T*alpha))
|
348 |
|
349 |
+
if isnan(afterLoss) || probChange < rand()
|
350 |
+
return prev
|
351 |
end
|
352 |
|
353 |
+
return tree
|
354 |
+
|
355 |
catch error
|
356 |
# Sometimes too many chained exp operators
|
357 |
if isa(error, DomainError)
|