<jupyter_start><jupyter_text>Sigmoid Function<jupyter_code>def sigmoid(z):
    return 1 / (1 + np.exp(-z))

z = np.linspace(-10, 10, 1000)
a = sigmoid(z)
plt.plot(z, a)
plt.xlabel("Z")
plt.ylabel("g(z)")
plt.title("Sigmoid")
plt.grid(True)
dz = a*(1-a)
plt.plot(z, dz)
plt.xlabel("Z")
plt.ylabel("g'(z)")
plt.title("Derivative of Sigmoid function")
plt.grid(True)<jupyter_output><empty_output><jupyter_text>Tanh<jupyter_code>def tanh(z):
    return (np.exp(z) - np.exp(-z)) / (np.exp(z) + np.exp(-z))

z = np.linspace(-10, 10, 1000)
a = tanh(z)
plt.plot(z, a)
plt.xlabel("Z")
plt.ylabel("g(z)")
plt.title("tanh")
plt.grid(True)
dz = 1 - (a ** 2)
plt.plot(z, dz)
plt.xlabel("Z")
plt.ylabel("g'(z)")
plt.title("Derivative of tanh")
plt.grid(True)<jupyter_output><empty_output><jupyter_text>Relu<jupyter_code>def relu(z):
    return np.maximum(0, z)

z = np.linspace(-10, 10, 1000)
a = relu(z)
plt.plot(z, a)
plt.xlabel("Z")
plt.ylabel("g(z)")
plt.title("relu")
plt.grid(True)
dz = np.where(z <=0, 0, 1)
plt.plot(z, dz)
plt.xlabel("Z")
plt.ylabel("g'(z)")
plt.title("Derivative of relu")
plt.grid(True)<jupyter_output><empty_output><jupyter_text>Leaky Relu<jupyter_code>def weak_relu(z):
    return np.maximum(0.01 * z, z)

z = np.linspace(-10, 10, 1000)
a = weak_relu(z)
plt.plot(z, a)
plt.xlabel("Z")
plt.ylabel("g(z)")
plt.title("Weak relu")
plt.grid(True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22727272727272727, 'fraction_numerical': 0.031746031746031744, 'mean_word_length': 5.700483091787439, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '475759', 'license': 'Apache-2.0', 'n_tokens_mistral': 747, 'n_tokens_neox': 673, 'n_words': 108, 'path': 'Appendix A - Activation Functions.ipynb', 'repo_name': 'nishantm9/machine-learning', 'size': '1386'}