Loading TOC...

cntk.clip

cntk.clip(
   $operand as cntk.variable,
   $min as cntk.variable,
   $max as cntk.variable,
   $name as String
) as cntk.function

Summary

Computes a tensor with all of its values clipped to fall between min_value and max_value, i.e. min(max(x, min_value), max_value). The output tensor has the same shape as x.

Parameters
$operand Tensor to be clipped.
$min A scalar or a tensor which represents the minimum value to clip element values to.
$max A scalar or a tensor which represents the maximum value to clip element values to.
$name The name of the function instance in the network.

Example

  var inputVariable1 = cntk.inputVariable(cntk.shape([3]), "float",
    fn.false(), fn.false(), "feature")
  var inputVariable2 = cntk.inputVariable(cntk.shape([3]), "float",
    fn.false(), fn.false(), "feature")
  var inputVariable3 = cntk.inputVariable(cntk.shape([3]), "float",
    fn.false(), fn.false(), "feature")
  cntk.clip(inputVariable1, inputVariable2, inputVariable3)
  => cntk.function(Composite Clip (Input(Name(feature), Shape([3]), Dynamic
  Axes([Sequence Axis(Default Dynamic Axis), Batch Axis(Default Batch Axis)])),
  Input(Name(feature), Shape([3]), Dynamic Axes([Sequence Axis(Default Dynamic
  Axis), Batch Axis(Default Batch Axis)])), Input(Name(feature), Shape([3]),
  Dynamic Axes([Sequence Axis(Default Dynamic Axis), Batch Axis(Default Batch
  Axis)]))))

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.