Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 709e0ae commit 727b174Copy full SHA for 727b174
utils.py
@@ -229,6 +229,13 @@ def sigmoid(x):
229
def step(x):
230
"""Return activation value of x with sign function"""
231
return 1 if x >= 0 else 0
232
+
233
+try: # math.isclose was added in Python 3.5;
234
+ from math import isclose
235
+except ImportError:
236
+ def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
237
+ "Return true if numbers a and b are close to each other."
238
+ return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)
239
240
# ______________________________________________________________________________
241
# Misc Functions
0 commit comments