Inference from Stationary Time Sequences via Learned Factor Graphs