Large Deviations of an Ergodic Synchronous Neural Network with Learning