function CPT = cond_dist_softmax(bnode, bnet)
% COND_SOFTMAX Compute Pr(self | observed parents) for a softmax node.
% CPT = cond_softmax(bnode, bnet)

%assert(subset(bnode.parents, bnet.observed_nodes));

dps = intersect(bnode.parents, bnet.discrete_nodes);
cps = intersect(bnode.parents, bnet.cts_nodes);
if isempty(dps)
  i = 1;
else
  error('softmax cannot have discrete parents');
  i = subv2ind(bnet.node_sizes(dps), bnet.values(dps));
end
x = bnet.values(cps);
W = bnode.glim.w1;
b = bnode.glim.b1;
%W = bnode.glim.w1(:,:,i);
%b = bnode.glim.b1(:,i);
CPT = normalise(exp(x*W + b));




