tensorflow_mri.scale_by_min_max

scale_by_min_max(tensor, output_min=0.0, output_max=1.0, name='scale_by_min_max')[source]

Rescale tensor values to specified range.

Values in the input tensor are linearly scaled so that the new minimum value is equal to output_min and the new maximum value is equal to output_max.

If the input tensor is complex, its magnitude is scaled.

Parameters
  • tensor – A Tensor. Must have type float32, float64, complex64 or complex128.

  • output_min – An optional float. The minimum value in the output tensor. Defaults to 0.0.

  • output_max

    An optional float. The maximum value in the output tensor. Defaults to 1.0.

  • name – An optional string. The name of the op.

Returns

The rescaled tensor.