Evolution of circuits for machine learning