Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
fix typo: a_arange -> a_range, b_arange -> b_range
  • Loading branch information
KindXiaoming authored May 19, 2024
1 parent fe1b3ca commit 13c73b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kan/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ def fit_params(x, y, fun, a_range=(-10,10), b_range=(-10,10), grid_number=101, i
if _ == 0 and verbose==True:
print('Best value at boundary.')
if a_id == 0:
a_arange = [a_[0], a_[1]]
a_range = [a_[0], a_[1]]
if a_id == grid_number - 1:
a_arange = [a_[-2], a_[-1]]
a_range = [a_[-2], a_[-1]]
if b_id == 0:
b_arange = [b_[0], b_[1]]
b_range = [b_[0], b_[1]]
if b_id == grid_number - 1:
b_arange = [b_[-2], b_[-1]]
b_range = [b_[-2], b_[-1]]

else:
a_range = [a_[a_id-1], a_[a_id+1]]
Expand Down Expand Up @@ -255,4 +255,4 @@ def add_symbolic(name, fun):
'''
exec(f"globals()['{name}'] = sympy.Function('{name}')")
SYMBOLIC_LIB[name] = (fun, globals()[name])


0 comments on commit 13c73b8

Please sign in to comment.