Influence of topology on the performance of a neural network