MAP loss
The MAP loss defines a loss function that is minimized by the mode of the posterior, i.e. optimizing the MAP loss allows us to estimate the mode of the posterior directly using SGD.
$$\L(\theta)_{MAP} = - \sum_j^J logp(\mathbf{x}^{(j)};\theta) + log p(\theta)$$
The MAP is the argmax over a posterior distribution of model parameters $\theta$. When taking the argmax of the log posterior, then we get $argmax log p(\theta|x) = argmax log( p(x|\theta)p(\theta))$, which then gives $argmax log(p(x|\theta))+log(p(\theta))$.
You either maximize that using stochastic gradient descent, or minimize the negative formulation of the MAP loss (as I did above).