method for training all svms