Created
April 26, 2020 13:05
-
-
Save Mehdi-Amine/d0889b465d4a32b8e4f474fc74b10ad7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
#%matplotlib widget # Uncomment if working with widgets on a jupyter nb | |
def plot_sgd(params): | |
fig = plt.figure() | |
ax = fig.add_subplot(111, projection='3d') | |
ax.plot(params[:, 0], params[:, 1], params[:, 2]) | |
ax.set_xlabel('Bias') | |
ax.set_ylabel('Weight 1') | |
ax.set_zlabel('Weight 2') | |
plt.show() | |
params = np.array(perceptron.parameters_as_they_change) | |
plot_sgd(params) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment