Loading TOC...

cntk.combine

cntk.combine(
   $operands as cntk.variable[],
   [$name as String]
) as cntk.function

Summary

Create a new Function instance which just combines the outputs of the specified list of ‘operands’ Functions such that the ‘Outputs’ of the new ‘Function’ are union of the ‘Outputs’ of each of the specified ‘operands’ Functions. E.g., when creating a classification model, typically the CrossEntropy loss Function and the ClassificationError Function comprise the two roots of the computation graph which can be combined to create a single Function with 2 outputs; viz. CrossEntropy loss and ClassificationError output.

Parameters
$operands List of functions or their variables to combine.
$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")
  cntk.combine([cntk.negate(inputVariable1), cntk.negate(inputVariable2)], "C")
  => cntk.function(Composite Combine (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.