Learning by solving differential equations