NN unable to fit Y = sign-of-tan(X)

Interesting. Did you try graphing the results in the same way that they showed for the standard data?

Here’s another thread about experimenting with this exercise (using the ReLU activation in that case), which shows the kind of graphing I mean. A picture is (sometimes) worth the proverbial thousand words in terms of seeing what is happening.