Add files via upload

This commit is contained in:
Silviu Marian Udrescu 2020-06-27 19:10:29 -04:00 committed by GitHub
parent 84aa8e27fa
commit e53ec2e80e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,7 @@ from os import path
from sympy import Symbol, lambdify, N
def get_symbolic_expr_error(data,expr):
try:
N_vars = len(data[0])-1
possible_vars = ["x%s" %i for i in np.arange(0,30,1)]
variables = []
@ -37,4 +38,5 @@ def get_symbolic_expr_error(data,expr):
# use this for the case in which the expression is just one number (i.e. not array)
#return np.sqrt(np.mean((f(*real_variables)-data[:,-1])**2))/np.sqrt(np.mean(data[:,-1]**2))
return np.mean(np.log2(1+abs(f(*real_variables)-data[:,-1])*2**30))
except:
return 1000000