Shallow Neural Net for predicting numbers other then 1 or 0?
Well, the main problem is that the existing code and the desired codes solve different problems.

The existing code solves a classification problem, when you predict one of certain classes. And you want to solve a regression problem, so that neural net will predict an arbitrary number.

Sigmoid function is necessary when you predict classes, you need to remove it for regression. Or in other words you need not Logistic Regression, but Linear Regression.
Here is a great article with explanations on this: http://peterroelants.github.io/posts/neural_network_implementation_part01/

I have written an example of implementation: https://gist.github.com/Erlemar/6a5cfcca423ef3b5f6e890c6bef6d5ed