something about the changes I made (abs -> np.abs) made my stuff succeed more often
This commit is contained in:
+3
-3
@@ -71,12 +71,12 @@ def exact_func_3D(X):
|
||||
def improved_answer(answer, exact, verbose=False):
|
||||
if not answer['error']:
|
||||
return True
|
||||
smblog.debug('exact: %s' % exact)
|
||||
smblog.debug('qlin: %s' % answer['qlin'])
|
||||
smblog.debug('error: %s' % answer['error'])
|
||||
smblog.debug('qlin: %s' % answer['qlin'])
|
||||
smblog.debug('final: %s' % answer['final'])
|
||||
smblog.debug('exact: %s' % exact)
|
||||
|
||||
if abs(answer['final'] - exact) <= abs(answer['qlin'] - exact):
|
||||
if np.abs(answer['final'] - exact) <= np.abs(answer['qlin'] - exact):
|
||||
smblog.debug(":) improved result")
|
||||
return True
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user