Fredholm integral equations for function approximation and the training of neural networks