def CollectSufficientStatistics(self, neg=False):
    """Collect sufficient statistics for this layer."""
    h = self.hyperparams
    self.state.div_by_row(self.NN)
    if not neg:
      self.state.sum(axis=1, target=self.suff_stats)
    else:
      self.suff_stats.add_sums(self.state, axis=1, mult=-1.0)
    self.state.mult_by_row(self.NN)
Collect sufficient statistics for this layer.
deepnet/replicated_softmax_layer.py