curated by Aluminium
In the 1940s, scientists like Warren McCulloch and Walter Pitts proposed a simple mathematical model of a biological neuron. The idea? A single neuron could take inputs, weigh their importance, and produce an output.
By the 1980s, researchers realized that stacking these "artificial neurons" into layers could solve complex problems. This led to the concept of universal approximation.

Let’s take an example of the cosine graph and how the network will work on it.

This are the outputs of inputs give to a cosine function.

When we draw a line thru them we get a graph.
As humans, if we are given a point x and are told to plot that in this graph, from our knowledge base we will use cosine function(as we can guess that this is the cosine graph from the shape) to get y.
But a neural network doesn’t know that it is a cosine function, so what will it do?
It starts with random guess, and compare it with the original output but it will not look like cosine graph. So it will go back and make some tweaks and it will compare it again and slowly it’s predictions will slowly start to look like the original one.
So in laymen terms one can say that-The network isn’t calculating cos(x)—it’s discovering relationships between x and y through brute-force adjustments (weight updates).
For better understanding we will use numpy to write the neural network and it’s functions.
$$ y = cos(x) $$
Firstly, we need to create “ground truth” datatset using cosine function
x = np.linspace(-10, 10, 200)
y = np.cos(x)
