Added encoder training functions for finding the final state after EM. Also added the UKF code