Code to perform sparse coding, multinomial log. regression and basic CRF