function bnode = update_ess_softmax(bnode, m)
% UPDATE_ESS_SOFTMAX: Update the Expected Sufficient Statistics of a softmax node.
% bnode = update_ess_softmax(bnode, family_marginal)

% X = cts parent, Y = discrete self
y = m.T;
i = find(y==1);
if length(i)==1 % hence y was observed
  x = m.mu(:,i); % the cts value is placed in a posn compatible with the discrete
else
  x = m.mu(:,1); % the cts value is copied into all fields
end

bnode.num_samples = bnode.num_samples + 1;
bnode.parent_vals(bnode.num_samples,:) = x(:)';
bnode.self_vals(bnode.num_samples,:) = y(:)';

