faster rms
This commit is contained in:
parent
151b61a80f
commit
9a0d0a3e10
@ -10,11 +10,15 @@ def rms(errors):
|
|||||||
"""
|
"""
|
||||||
root mean square calculation
|
root mean square calculation
|
||||||
"""
|
"""
|
||||||
r = 0.0
|
|
||||||
for i in errors:
|
# slow pure python way for reference:
|
||||||
r += np.power(i, 2)
|
# r = 0.0
|
||||||
r = np.sqrt(r / len(errors))
|
# for i in errors:
|
||||||
return r
|
# r += np.power(i, 2)
|
||||||
|
# r = np.sqrt(r / len(errors))
|
||||||
|
# return r
|
||||||
|
|
||||||
|
return np.sqrt((errors**2).mean())
|
||||||
|
|
||||||
def baker_exact_2D(X):
|
def baker_exact_2D(X):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user