- Added training error calculation to SDM training

- preparing to move SDM training to separate class