You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I cannot add the above mentioned functions functions. If I add function such as
pset.add_function(operator.pow,2)
then the following things return;
:1: RuntimeWarning: overflow encountered in double_scalars
Traceback (most recent call last):
File "G:/My Drive/Afifa Tamanna/PhD/AI/GEP/Diffn_Analysis_GEP_model/Analysis/testviscosity.py", line 198, in
pop, log = gep.gep_simple(pop, toolbox, n_generations=n_gen, n_elites=1,
File "C:\Program Files (x86)\Python38-32\lib\site-packages\geppy\algorithms\basic.py", line 100, in gep_simple
for ind, fit in zip(invalid_individuals, fitnesses):
File "<array_function internals>", line 5, in lstsq
File "C:\Users\atam0001\AppData\Roaming\Python\Python38\site-packages\numpy\linalg\linalg.py", line 2259, in lstsq
x, resids, rank, s = gufunc(a, b, rcond, signature=signature, extobj=extobj)
File "C:\Users\atam0001\AppData\Roaming\Python\Python38\site-packages\numpy\linalg\linalg.py", line 109, in _raise_linalgerror_lstsq
raise LinAlgError("SVD did not converge in Linear Least Squares")
numpy.linalg.LinAlgError: SVD did not converge in Linear Least Squares
Please assist me in solving the issue. Many Thanks.
The text was updated successfully, but these errors were encountered:
The main reason is that many functions you mentioned are some kind of dangerous. That is, it is easy to generate unreasonably large (such as pow(13, 50)) and even nan or errors (like sqrt(-1.2)).
Just like we usually define a protected version for div, you should also do that for these functions. A common way is to
limit the output value range, e.g., min(y, 1e6) (you should adjust the threshold accordingly)
if an exception or nan is generated, then output a default value like 0.0
Since evolution is always random, you cannot assume reasonable inputs or outputs for a given function. Instead, protect it.
See this example for protected_div.
Hi, I cannot add the above mentioned functions functions. If I add function such as
pset.add_function(operator.pow,2)
then the following things return;
:1: RuntimeWarning: overflow encountered in double_scalars
Traceback (most recent call last):
File "G:/My Drive/Afifa Tamanna/PhD/AI/GEP/Diffn_Analysis_GEP_model/Analysis/testviscosity.py", line 198, in
pop, log = gep.gep_simple(pop, toolbox, n_generations=n_gen, n_elites=1,
File "C:\Program Files (x86)\Python38-32\lib\site-packages\geppy\algorithms\basic.py", line 100, in gep_simple
for ind, fit in zip(invalid_individuals, fitnesses):
File "<array_function internals>", line 5, in lstsq
File "C:\Users\atam0001\AppData\Roaming\Python\Python38\site-packages\numpy\linalg\linalg.py", line 2259, in lstsq
x, resids, rank, s = gufunc(a, b, rcond, signature=signature, extobj=extobj)
File "C:\Users\atam0001\AppData\Roaming\Python\Python38\site-packages\numpy\linalg\linalg.py", line 109, in _raise_linalgerror_lstsq
raise LinAlgError("SVD did not converge in Linear Least Squares")
numpy.linalg.LinAlgError: SVD did not converge in Linear Least Squares
Please assist me in solving the issue. Many Thanks.
The text was updated successfully, but these errors were encountered: