Framework to evolve optimal neural networks