Skip to content

Commit

Permalink
do version 0.9.0 Pt.2
Browse files Browse the repository at this point in the history
  • Loading branch information
thierrymoudiki committed Aug 10, 2023
1 parent 243e660 commit 94d11fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions teller/utils/numerical_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def numerical_gradient(f, X, normalize=False, h=None, n_jobs=None, verbose=1):

X[:, ix] = value_x # restore (!)

grad[:, ix] = (fx_plus - fx_minus) / double_h
grad[:, ix] = (np.asarray(fx_plus) - np.asarray(fx_minus)) / double_h

pbar.update(ix)

Expand Down Expand Up @@ -75,7 +75,7 @@ def numerical_gradient(f, X, normalize=False, h=None, n_jobs=None, verbose=1):

X[:, ix] = value_x # restore (!)

grad[:, ix] = (fx_plus - fx_minus) / (2 * h)
grad[:, ix] = (np.asarray(fx_plus) - np.asarray(fx_minus)) / (2 * h)

if verbose == 1:
pbar.update(ix)
Expand Down Expand Up @@ -107,7 +107,7 @@ def gradient_column(ix):

X[:, ix] = value_x # restore (!)

grad[:, ix] = (fx_plus - fx_minus) / (2 * h)
grad[:, ix] = (np.asarray(fx_plus) - np.asarray(fx_minus)) / (2 * h)

if verbose == 1:
print("\n")
Expand Down

0 comments on commit 94d11fe

Please sign in to comment.