Growing axons: greedy learning of neural networks with application to function approximation