Simple ReLU plot
I am trying to plot this simple ReLU function max(0,x).
But the line is struck at y=0. Can somebody help ?
Here is my code:
plot(max(0,x), -2, 2)
I am trying to plot this simple ReLU function max(0,x).
But the line is struck at y=0. Can somebody help ?
Here is my code:
plot(max(0,x), -2, 2)
You can try
f(x) = max_symbolic(x,0);
plot(f(x), -2, 2)
This worked. Thank you very much. I went and read the max_symbolic documentation, I could not understand why max does not work, but the max_symbolic resolved my problem. Is there a simpler explanation for why python max does not work in the plotting ?
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2024-03-15 06:10:57 +0100
Seen: 199 times
Last updated: Mar 15
sage: max_symbolic?
thanks. max_symbolic works.