Like @dpernes , the issue is with the sum of exponentials, in my case wrt the categorical variable. Applying his trick works. Also, see “get_mixture_coef” here: Mixture Density Networks with TensorFlow | 大トロ 1