$$$\frac{\partial L(w,b)}{\partial w}=- \sum_{x_i \in M}y_ix_i\\\\ \frac{\partial L(w,b)}{\partial b}=- \sum_{x_i \in M}y_i$$$

$w_{new} \leftarrow w_{old} - \rho \frac{\partial L(w,b)}{\partial w}=w_{old} + \rho \sum_{x_i \in M}y_ix_i\\\\ b_{new} \leftarrow b_{old} - \rho \frac{\partial L(w,b)}{\partial b}=b_{old} + \rho \sum_{x_i \in M}y_i$

$w_{new} \leftarrow w_{old} + \rho y_ix_i\\\\ b_{new} \leftarrow b_{old} + \rho y_i$

Batch gradient descent performs redundant computations for large datasets, as it recomputes gradients for similar examples before each parameter update. SGD does away with this redundancy by performing one update at a time. It is therefore usually much faster and can also be used to learn online.

Though the sigma that it gives you the correct direction but you can show that stochastic gradient descent all most of the time it gives you a good direction. You know it may happen that using only one point you go wrong for in one iteration, but over all you go to the right direction generally and it’s faster.