Deep Learning, Python, Data Science, Programming, Neural Networks.
matplotlib.pyplot as plt # Generate input values z = np.linspace(-10, 10, 100) # Tanh Function tanh_output = (np.exp(z) - np.exp(-z)) / (np.exp(z) + np.exp(-z)) plt.plot(z, tanh_output) plt.title('Tanh Function') plt.xlabel('z') plt.ylabel('tanh(z)') plt.grid(True) plt.savefig('tanh_function.png')