Skip to content

Commit

Permalink
fix video
Browse files Browse the repository at this point in the history
  • Loading branch information
KindXiaoming committed Oct 15, 2024
1 parent c2f6677 commit 551eec5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ molecule
expressiveness
figures
molecule
applications
5 changes: 5 additions & 0 deletions kan/MultKAN.py
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,10 @@ def closure():

if _ == steps-1 and old_save_act:
self.save_act = True

if save_fig and _ % save_fig_freq == 0:
save_act = self.save_act
self.save_act = True

train_id = np.random.choice(dataset['train_input'].shape[0], batch_size, replace=False)
test_id = np.random.choice(dataset['test_input'].shape[0], batch_size_test, replace=False)
Expand Down Expand Up @@ -1579,6 +1583,7 @@ def closure():
self.plot(folder=img_folder, in_vars=in_vars, out_vars=out_vars, title="Step {}".format(_), beta=beta)
plt.savefig(img_folder + '/' + str(_) + '.jpg', bbox_inches='tight', dpi=200)
plt.close()
self.save_act = save_act

self.log_history('fit')
# revert back to original state
Expand Down

0 comments on commit 551eec5

Please sign in to comment.