def UpdateLayerParams(self, layer, step=0):
    """Update parameters associated with this layer."""
    layer.gradient.add_mult(layer.suff_stats, -1.0 / layer.batchsize)
    if layer.tied_to:
      layer.tied_to.gradient.add(layer.gradient)
      layer.gradient.assign(0)
      layer = layer.tied_to
    layer.num_grads_received += 1
    if layer.num_grads_received == layer.num_shares:
      layer.Update('bias', step, no_reg=True)  # By default, do not regularize bias.
Update parameters associated with this layer.
deepnet/dbm.py