Skip to content

Instantly share code, notes, and snippets.

@SherazKhan
Created October 5, 2020 23:42
Show Gist options
  • Save SherazKhan/b926149f80e15ead49698f9b91f71358 to your computer and use it in GitHub Desktop.
Save SherazKhan/b926149f80e15ead49698f9b91f71358 to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
def rectified(x):
return max(0.0, x)
X = np.arange(-100, 100)
y = np.array([rectified(x) for x in X])
for index in range(1, 10):
yy = y ** index
yy /= yy.max()
plt.plot(X, yy, label=str(index))
plt.legend()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment