Loading TOC...


   $model as cntk:function
) as cntk:variable*


Returns the output variables of a CNTK model, as a sequence of cntk:variable

$model The model whose outputs were to be extracted.


  xquery version "1.0-ml";

  let $input-variable1 := cntk:input-variable(cntk:shape((3)), "float", fn:false(), fn:false(), "feature")
  let $input-variable2 := cntk:input-variable(cntk:shape((3)), "float", fn:false(), fn:false(), "feature")
  let $model := cntk:top-k-on-axis($input-variable2, 1, cntk:axis(0), ";xS@dE")

  let $input-values := (
    cntk:value(cntk:shape((3)), json:to-array((1 to 3)), cntk:cpu(), "float"), 
    cntk:value(cntk:shape((3)), json:to-array((2 to 4)), cntk:cpu(), "float"))
  let $pair1 := json:to-array(($input-variable1, $input-values[1]))
  let $pair2 := json:to-array(($input-variable2, $input-values[2]))
  let $input-pairs := json:to-array(($pair1, $pair2))
  (:let $output-variable := cntk:output-variable(cntk:shape((2)), "float", (), fn:true()):)
  let $output-variables := cntk:function-outputs($model)
  let $output-value := cntk:evaluate($model, $input-pairs, $output-variables[1], cntk:cpu())
  return (fn:replace(xdmp:quote($output-value), "0x[a-z|A-Z|0-9]*", "Value"), cntk:value-to-array($output-variables[1], $output-value))
  => cntk:value(Shape([1 x 1 x 1]), Device Kind Name(CPU))

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