Last active
May 9, 2017 08:34
-
-
Save sfujiwara/7492206da4859c673f4bb5724d8a3865 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 numpy as np | |
import matplotlib.pyplot as plt | |
# Parameters used frequently | |
plt.rcParams['axes.labelsize'] = 24 | |
plt.rcParams['lines.linewidth'] = 4 | |
plt.rcParams['lines.markersize'] = 10 | |
plt.rcParams['lines.markeredgewidth'] = 3 | |
plt.rcParams['legend.fontsize'] = 18 | |
plt.rcParams['legend.shadow'] = False | |
plt.rcParams['xtick.labelsize'] = 14 | |
plt.rcParams['ytick.labelsize'] = 14 | |
x = np.linspace(-3, 3, 100) | |
plt.plot(x, 1/(1+np.exp(-x)), label="Sigmoid") | |
plt.plot(x, np.tanh(x), label="Tanh") | |
plt.plot(x, np.maximum(np.zeros(len(x)), x), label="ReLU") | |
plt.plot(x, (x>0), label="Step") | |
plt.legend(loc="left") | |
plt.grid() | |
plt.ylim(-1.5, 1.5) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment