Skip to content

Commit

Permalink
🎨imporved codes
Browse files Browse the repository at this point in the history
  • Loading branch information
jswanglp committed Jun 26, 2019
1 parent 4fba7a9 commit f22fc76
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions codes/WNN_POLYWOG3.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,16 @@ def load(self):
ax.set_ylabel(r'$\psi (x)$', rotation='horizontal', fontsize=14)
ax.yaxis.set_label_coords(-.05,1.02)

# # Derivative function
# y_d = net.phi_der(x, t=1, s=0)
# ax_d = fig.add_subplot(122)
# ax_d.plot(x, y_d, label='derivative')
# ax_d.legend(loc='upper right', fontsize=12)
# ax_d.set_title('Derivative of morlet wavelet', fontsize=14)
# ax_d.set_xlabel('x', fontsize=14)
# ax_d.set_ylabel("${\psi}'(x)$", rotation='horizontal', fontsize=14)
# ax_d.yaxis.set_label_coords(-.05,1.02)

net.SGD(training_data, epochs=200, mini_batch_size=32, lr=.1, step=20)

# >> Epoch 1, mse_loss: 0.3483, accury on the training set :48.18%
Expand Down Expand Up @@ -263,6 +273,16 @@ def load(self):
ax.set_ylabel(r'$\psi (x)$', rotation='horizontal', fontsize=14)
ax.yaxis.set_label_coords(-.05,1.02)

# # Derivative function
# y_d = net.polywog3_der(x, t=1, s=0)
# ax_d = fig.add_subplot(122)
# ax_d.plot(x, y_d, label='derivative')
# ax_d.legend(loc='upper right', fontsize=12)
# ax_d.set_title('Derivative of POLYWOG3 wavelet', fontsize=14)
# ax_d.set_xlabel('x', fontsize=14)
# ax_d.set_ylabel("${\psi}'(x)$", rotation='horizontal', fontsize=14)
# ax_d.yaxis.set_label_coords(-.05,1.02)

net.SGD(training_data, epochs=200, mini_batch_size=32, lr=.1, step=20)

# >> Epoch 1, mse_loss: 0.2867, accury on the training set :63.04%
Expand Down

0 comments on commit f22fc76

Please sign in to comment.