Wrap _multinomial_loss_grad in lambda function for passing into lbfgs.