tfmri.math.project_onto_box

project_onto_box(x, lower_bound=- 1.0, upper_bound=1.0, name=None)[source]

Projects an input vector onto the box.

Parameters
  • x – A tf.Tensor of shape [..., n].

  • lower_bound

    A scalar tf.Tensor of type x.dtype.real_dtype. The lower bound of the box. Defaults to -1.0.

  • upper_bound

    A scalar tf.Tensor of type x.dtype.real_dtype. The upper bound of the box. Defaults to 1.0.

  • name – A str. The name of this operation.

Returns

A tf.Tensor of shape [..., n] and dtype equal to x.dtype.