Inferring nonlinear computation in multilayered neural circuits