Predicting Periodicity with Temporal Difference Learning