Unified Field Theory for Deep and Recurrent Neural Networks