Create an array of categorical variable and get the logp

Replace last line with: cat.distribution.logp(x).eval()