added a function to measure improvement
This commit is contained in:
parent
487c132d12
commit
7685b130b7
@ -49,7 +49,7 @@ def friendly_exact_3D(X):
|
||||
x,y,z = X
|
||||
return 1 + x*x + y*y + z*z
|
||||
|
||||
def improved_answer(answer, exact, verbose=False):
|
||||
def improved_answer(answer, exact):
|
||||
if not answer['error']:
|
||||
return True
|
||||
|
||||
@ -64,3 +64,7 @@ def improved_answer(answer, exact, verbose=False):
|
||||
else:
|
||||
log.debug(":( damaged result")
|
||||
return False
|
||||
|
||||
|
||||
def percent_improvement(answer, exact):
|
||||
return np.abs(answer['qlin'] - exact) / exact
|
||||
|
Loading…
Reference in New Issue
Block a user