Generalized Byzantine-tolerant SGD