From Deep Learning to Rational Machines