Sparse solution in training artificial neural networks