sr: bugfix in direction of gradient, support for batching gradients and priorities amongst updates