Clamp the current training frame index to be in a valid range. A valid range would be between 0 and the number of frames in the training data. So if the training data contains 100 frames, so index 0..99, and we set the TrainingFrameNumber member to 500, this method will turn that into 99.