Added predict and accuracy functions for SGD.