function CPT = cond_dist_logistic(bnode, bnet)
% COND_LOGISTIC Compute Pr(self | observed parents) for a logistic node.
% CPT = cond_logistic(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('logistic 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;
a = x*W + b;
p = 1/(1+exp(-a));
CPT = [1-p  p];
%CPT = normalise(exp(a));




