large margin embedding codes