bartorch.soft_thresh

Contents

bartorch.soft_thresh#

bartorch.soft_thresh(lamda, input, *, joint_axes=())#

Soft thresholding, x * max(1 - lamda / |x|, 0).

Parameters:
  • lamda (float) – Threshold, in the units of input’s magnitude.

  • input (torch.Tensor)

  • joint_axes (int or tuple of int) – Axes over which |x| is the Euclidean norm, so that each fibre along them is shrunk as one vector (-j); empty for element-wise.

Returns:

The shape of input.

Return type:

torch.Tensor