From Statistical Physics to Algorithms in Deep Neural Systems