Loading TOC...

cntk:unpooling

cntk:unpooling(
   $operand as cntk:variable,
   $poolingInput as cntk:variable,
   $unpooling-type as xs:string,
   $unpooling-window-shape as cntk:shape,
   [$strides as cntk:shape],
   [$auto-padding as xs:boolean*],
   [$name as xs:string]
) as cntk:function

Summary

Unpools the operand using information from pooling_input. Unpooling mirrors the operations performed by pooling and depends on the values provided to the corresponding pooling operation. The output should have the same shape as pooling_input. Pooling the result of an unpooling operation should give back the original input.

Parameters
$operand Unpooling input
$poolingInput Input to the corresponding pooling operation.
$unpooling-type Only MAX_UNPOOLING is supported now.
$unpooling-window-shape Dimensions of the unpooling window strides (default 1) – strides.
$strides Strides.
$auto-padding Automatic padding flags for each input dimension.
$name The name of the Function instance in the network.

Example

  xquery version "1.0-ml";

  let $input-variable1 := cntk:input-variable(cntk:shape((2,2)), "float")
  let $input-variable2 := cntk:input-variable(cntk:shape((3,3)), "float")
  let $model := cntk:unpooling($input-variable1, $input-variable2, "Max", cntk:shape((2,2)))

  let $input-value1 := cntk:batch(cntk:shape((2,2)),
    json:to-array(json:to-array((3, 5, 2, 6, 4, 2, 8, 3))),
    cntk:cpu(), "float")
  let $pair1 := json:to-array(($input-variable1, $input-value1))

  let $input-value2 := cntk:batch(cntk:shape((3,3)),
    json:to-array(json:to-array((1 to 18))),
    cntk:cpu(), "float")
  let $pair2 := json:to-array(($input-variable2, $input-value2))

  let $input-pairs := json:to-array(($pair1, $pair2))
  let $output-variable := cntk:function-output($model)
  let $output-value := cntk:evaluate($model, $input-pairs, $output-variable, cntk:cpu())
  return (
  "Value Shape : ", xdmp:quote(cntk:value-shape($output-value)), "
", 
  "Variable Owner : ", fn:replace(xdmp:quote(cntk:variable-owner($output-variable)), "Input\d*", "Input"), "
", 
  "Result : ", cntk:value-to-array($output-variable, $output-value))

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