Added check to train.lua at HMMs