Subgradient and stochastic subgradient learning algorithms.

WIP: The results do not look good yet.