
function pot = init_var_fam(bnode, bnet)

ps = bnode.parents;
fam = [ps bnode.self];
ns = bnet.node_sizes;
ns(intersect(bnet.observed_nodes, bnet.cts_nodes)) = 0;
ns(intersect(bnet.observed_nodes, bnet.discrete_nodes)) = 1;
v = bnet.values(bnode.self);
if bnet.pot_type == 'g'
  pot  = mk_gpot(fam, ns(fam), 'c');
  assert(ismember(bnode.self, bnet.observed_nodes));
  pot.T(v) = CPT(v);
else
  pot  = mk_cgpot(fam, ns(fam), 'c');
  v = bnet.values(bnode.self);
end
vs = 1:bs(bnode.self);
cps = intersect(ps, bnet.cts_nodes);
w = bnode.glim.w1;
b = bnode.glim.b1;
x = bnet.values(cps);
a = w*x + b;
p = 1/(1+exp(-a));
CPT = [1-p  p];

