Approximating the Sine Function with the Universal Approximator: An Experimental Study with Visualisations
摘要
This paper presents an experiment aimed at visualising the contribution of individual neurons in an artificial neural network (ANN) in approximating a nonlinear function. To achieve this, we selected a simple one-dimensional nonlinear function, specifically y = sin (x), the sine function over the interval [− 3.15, 3.15]. We utilised the universal function approximator architecture with ReLU as the hidden layer’s activation. Ten different neural networks, each with a unit increase in the hidden layer’s neuron count from one to ten, were trained for ten epochs on a dataset of 100,000 samples, collected in batches of size 32. The NNVisualiser framework was used to visualise the transformations performed by each neuron in the network. Results showed that more than 13% of neurons were inactive (‘dead neurons’) after training, with this proportion reaching up to 40% in some instances. Active neurons contributed by fitting regression lines to subsets of the superset, the training data, where the degree of offset varied based on the number of neurons in the layer. The observed reduction in training mean squared error as the number of neurons increases supports the Universal Approximation Theorem.