Nahuel Passano commited on
Commit
f84d6e8
·
1 Parent(s): 414dc1f

fix: math module

Browse files
Files changed (1) hide show
  1. utils.py +3 -3
utils.py CHANGED
@@ -1,5 +1,5 @@
1
  import numpy as np
2
-
3
 
4
  def layer_wise_dot_product(*matrices: np.ndarray) -> np.ndarray:
5
  """
@@ -36,7 +36,7 @@ def bessel(z):
36
  bessel_sum = 0
37
  for k in range(25):
38
  bessel_i = ((-1) ** k * (z / 2) ** (2 * k + 1)) / (
39
- np.math.factorial(k) * np.math.factorial(k + 1)
40
  )
41
  bessel_sum = bessel_sum + bessel_i
42
  return bessel_sum
@@ -49,7 +49,7 @@ def struve(z):
49
  struve_sum = 0
50
  for k in range(25):
51
  struve_i = (((-1) ** k * (z / 2) ** (2 * k + 2))) / (
52
- np.math.factorial(int(k + 1 / 2)) * np.math.factorial(int(k + 3 / 2))
53
  )
54
  struve_sum = struve_sum + struve_i
55
  return struve_sum
 
1
  import numpy as np
2
+ import math
3
 
4
  def layer_wise_dot_product(*matrices: np.ndarray) -> np.ndarray:
5
  """
 
36
  bessel_sum = 0
37
  for k in range(25):
38
  bessel_i = ((-1) ** k * (z / 2) ** (2 * k + 1)) / (
39
+ math.factorial(k) * math.factorial(k + 1)
40
  )
41
  bessel_sum = bessel_sum + bessel_i
42
  return bessel_sum
 
49
  struve_sum = 0
50
  for k in range(25):
51
  struve_i = (((-1) ** k * (z / 2) ** (2 * k + 2))) / (
52
+ math.factorial(int(k + 1 / 2)) * math.factorial(int(k + 3 / 2))
53
  )
54
  struve_sum = struve_sum + struve_i
55
  return struve_sum