blob: c90ef916c477bac64561fe6127313e9322b74eb5 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta content="Contrib Symbol API" property="og:title">
<meta content="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/og-logo.png" property="og:image">
<meta content="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/og-logo.png" property="og:image:secure_url">
<meta content="Contrib Symbol API" property="og:description"/>
<title>Contrib Symbol API — mxnet documentation</title>
<link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="../../../_static/basic.css" rel="stylesheet" type="text/css">
<link href="../../../_static/pygments.css" rel="stylesheet" type="text/css">
<link href="../../../_static/mxnet.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="../../../_static/underscore.js" type="text/javascript"></script>
<script src="../../../_static/searchtools_custom.js" type="text/javascript"></script>
<script src="../../../_static/doctools.js" type="text/javascript"></script>
<script src="../../../_static/selectlang.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
<script type="text/javascript"> jQuery(function() { Search.loadIndex("/searchindex.js"); Search.init();}); </script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new
Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-96378503-1', 'auto');
ga('send', 'pageview');
</script>
<!-- -->
<!-- <script type="text/javascript" src="../../../_static/jquery.js"></script> -->
<!-- -->
<!-- <script type="text/javascript" src="../../../_static/underscore.js"></script> -->
<!-- -->
<!-- <script type="text/javascript" src="../../../_static/doctools.js"></script> -->
<!-- -->
<!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> -->
<!-- -->
<link href="../../../genindex.html" rel="index" title="Index">
<link href="../../../search.html" rel="search" title="Search"/>
<link href="../index.html" rel="up" title="MXNet - Python API"/>
<link href="rnn.html" rel="next" title="RNN Cell Symbol API"/>
<link href="sparse.html" rel="prev" title="Sparse Symbol API"/>
<link href="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-icon.png" rel="icon" type="image/png"/>
</link></link></link></meta></meta></meta></head>
<body background="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-background-compressed.jpeg" role="document">
<div class="content-block"><div class="navbar navbar-fixed-top">
<div class="container" id="navContainer">
<div class="innder" id="header-inner">
<h1 id="logo-wrap">
<a href="../../../" id="logo"><img src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet_logo.png"/></a>
</h1>
<nav class="nav-bar" id="main-nav">
<a class="main-nav-link" href="../../../install/index.html">Install</a>
<span id="dropdown-menu-position-anchor">
<a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Gluon <span class="caret"></span></a>
<ul class="dropdown-menu navbar-menu" id="package-dropdown-menu">
<li><a class="main-nav-link" href="../../../gluon/index.html">About</a></li>
<li><a class="main-nav-link" href="http://gluon.mxnet.io">Tutorials</a></li>
</ul>
</span>
<span id="dropdown-menu-position-anchor">
<a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">API <span class="caret"></span></a>
<ul class="dropdown-menu navbar-menu" id="package-dropdown-menu">
<li><a class="main-nav-link" href="../../../api/python/index.html">Python</a></li>
<li><a class="main-nav-link" href="../../../api/c++/index.html">C++</a></li>
<li><a class="main-nav-link" href="../../../api/clojure/index.html">Clojure</a></li>
<li><a class="main-nav-link" href="../../../api/julia/index.html">Julia</a></li>
<li><a class="main-nav-link" href="../../../api/perl/index.html">Perl</a></li>
<li><a class="main-nav-link" href="../../../api/r/index.html">R</a></li>
<li><a class="main-nav-link" href="../../../api/scala/index.html">Scala</a></li>
</ul>
</span>
<span id="dropdown-menu-position-anchor-docs">
<a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Docs <span class="caret"></span></a>
<ul class="dropdown-menu navbar-menu" id="package-dropdown-menu-docs">
<li><a class="main-nav-link" href="../../../faq/index.html">FAQ</a></li>
<li><a class="main-nav-link" href="../../../tutorials/index.html">Tutorials</a>
<li><a class="main-nav-link" href="https://github.com/apache/incubator-mxnet/tree/master/example">Examples</a></li>
<li><a class="main-nav-link" href="../../../architecture/index.html">Architecture</a></li>
<li><a class="main-nav-link" href="../../../api/python/gluon/model_zoo.html">Model Zoo</a></li>
<li><a class="main-nav-link" href="../../../api/python/contrib/onnx.html">ONNX</a></li>
</li></ul>
</span>
<span id="dropdown-menu-position-anchor-community">
<a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Community <span class="caret"></span></a>
<ul class="dropdown-menu navbar-menu" id="package-dropdown-menu-community">
<li><a class="main-nav-link" href="http://discuss.mxnet.io">Forum</a></li>
<li><a class="main-nav-link" href="https://github.com/apache/incubator-mxnet">Github</a></li>
<li><a class="main-nav-link" href="../../../community/contribute.html">Contribute</a></li>
<li><a class="main-nav-link" href="../../../community/ecosystem.html">Ecosystem</a></li>
<li><a class="main-nav-link" href="../../../community/powered_by.html">Powered By</a></li>
</ul>
</span>
<span id="dropdown-menu-position-anchor-version" style="position: relative"><a href="#" class="main-nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">Versions(master)<span class="caret"></span></a><ul id="package-dropdown-menu" class="dropdown-menu"><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/>master</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/versions/1.2.1/index.html>1.2.1</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/versions/1.1.0/index.html>1.1.0</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/versions/1.0.0/index.html>1.0.0</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/versions/0.12.1/index.html>0.12.1</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/versions/0.11.0/index.html>0.11.0</a></li></ul></span></nav>
<script> function getRootPath(){ return "../../../" } </script>
<div class="burgerIcon dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"></a>
<ul class="dropdown-menu" id="burgerMenu">
<li><a href="../../../install/index.html">Install</a></li>
<li><a class="main-nav-link" href="../../../tutorials/index.html">Tutorials</a></li>
<li class="dropdown-submenu dropdown">
<a aria-haspopup="true" class="dropdown-toggle burger-link" data-toggle="dropdown" href="#" role="button" tabindex="-1">Community</a>
<ul class="dropdown-menu">
<li><a href="http://discuss.mxnet.io" tabindex="-1">Forum</a></li>
<li><a href="https://github.com/apache/incubator-mxnet" tabindex="-1">Github</a></li>
<li><a href="../../../community/contribute.html" tabindex="-1">Contribute</a></li>
<li><a href="../../../community/ecosystem.html" tabindex="-1">Ecosystem</a></li>
<li><a href="../../../community/powered_by.html" tabindex="-1">Powered By</a></li>
</ul>
</li>
<li class="dropdown-submenu">
<a aria-haspopup="true" class="dropdown-toggle burger-link" data-toggle="dropdown" href="#" role="button" tabindex="-1">API</a>
<ul class="dropdown-menu">
<li><a href="../../../api/python/index.html" tabindex="-1">Python</a>
</li>
<li><a href="../../../api/c++/index.html" tabindex="-1">C++</a>
</li>
<li><a href="../../../api/clojure/index.html" tabindex="-1">Clojure</a>
</li>
<li><a href="../../../api/julia/index.html" tabindex="-1">Julia</a>
</li>
<li><a href="../../../api/perl/index.html" tabindex="-1">Perl</a>
</li>
<li><a href="../../../api/r/index.html" tabindex="-1">R</a>
</li>
<li><a href="../../../api/scala/index.html" tabindex="-1">Scala</a>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a aria-expanded="true" aria-haspopup="true" class="dropdown-toggle burger-link" data-toggle="dropdown" href="#" tabindex="-1">Docs</a>
<ul class="dropdown-menu">
<li><a href="../../../tutorials/index.html" tabindex="-1">Tutorials</a></li>
<li><a href="../../../faq/index.html" tabindex="-1">FAQ</a></li>
<li><a href="../../../architecture/index.html" tabindex="-1">Architecture</a></li>
<li><a href="https://github.com/apache/incubator-mxnet/tree/master/example" tabindex="-1">Examples</a></li>
<li><a href="../../../api/python/gluon/model_zoo.html" tabindex="-1">Gluon Model Zoo</a></li>
</ul>
</li>
<li><a class="main-nav-link" href="https://github.com/dmlc/mxnet">Github</a></li>
<li id="dropdown-menu-position-anchor-version-mobile" class="dropdown-submenu" style="position: relative"><a href="#" tabindex="-1">Versions(master)</a><ul class="dropdown-menu"><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/>master</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/versions/1.2.1/index.html>1.2.1</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/versions/1.1.0/index.html>1.1.0</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/versions/1.0.0/index.html>1.0.0</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/versions/0.12.1/index.html>0.12.1</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/versions/0.11.0/index.html>0.11.0</a></li></ul></li></ul>
</div>
<div class="plusIcon dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"><span aria-hidden="true" class="glyphicon glyphicon-plus"></span></a>
<ul class="dropdown-menu dropdown-menu-right" id="plusMenu"></ul>
</div>
<div id="search-input-wrap">
<form action="../../../search.html" autocomplete="off" class="" method="get" role="search">
<div class="form-group inner-addon left-addon">
<i class="glyphicon glyphicon-search"></i>
<input class="form-control" name="q" placeholder="Search" type="text"/>
</div>
<input name="check_keywords" type="hidden" value="yes">
<input name="area" type="hidden" value="default"/>
</input></form>
<div id="search-preview"></div>
</div>
<div id="searchIcon">
<span aria-hidden="true" class="glyphicon glyphicon-search"></span>
</div>
<!-- <div id="lang-select-wrap"> -->
<!-- <label id="lang-select-label"> -->
<!-- <\!-- <i class="fa fa-globe"></i> -\-> -->
<!-- <span></span> -->
<!-- </label> -->
<!-- <select id="lang-select"> -->
<!-- <option value="en">Eng</option> -->
<!-- <option value="zh">中文</option> -->
<!-- </select> -->
<!-- </div> -->
<!-- <a id="mobile-nav-toggle">
<span class="mobile-nav-toggle-bar"></span>
<span class="mobile-nav-toggle-bar"></span>
<span class="mobile-nav-toggle-bar"></span>
</a> -->
</div>
</div>
</div>
<script type="text/javascript">
$('body').css('background', 'white');
</script>
<div class="container">
<div class="row">
<div aria-label="main navigation" class="sphinxsidebar leftsidebar" role="navigation">
<div class="sphinxsidebarwrapper">
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python Documents</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../index.html#ndarray-api">NDArray API</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#symbol-api">Symbol API</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="symbol.html">Symbol API</a></li>
<li class="toctree-l3"><a class="reference internal" href="random.html">Random Distribution Generator Symbol API</a></li>
<li class="toctree-l3"><a class="reference internal" href="linalg.html">Linear Algebra Symbol API</a></li>
<li class="toctree-l3"><a class="reference internal" href="sparse.html">Sparse Symbol API</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Contrib Symbol API</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#overview">Overview</a></li>
<li class="toctree-l4"><a class="reference internal" href="#contrib">Contrib</a></li>
<li class="toctree-l4"><a class="reference internal" href="#api-reference">API Reference</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="rnn.html">RNN Cell Symbol API</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../index.html#module-api">Module API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../index.html#autograd-api">Autograd API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../index.html#gluon-api">Gluon API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../index.html#io-api">IO API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../index.html#image-api">Image API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../index.html#optimization-api">Optimization API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../index.html#callback-api">Callback API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../index.html#metric-api">Metric API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../index.html#profiler-api">Profiler API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../index.html#run-time-compilation-api">Run-Time Compilation API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../index.html#contrib-package">Contrib Package</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../r/index.html">R Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../julia/index.html">Julia Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../c++/index.html">C++ Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../scala/index.html">Scala Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../perl/index.html">Perl Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../faq/index.html">HowTo Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/index.html">System Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../tutorials/index.html">Tutorials</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../community/contribute.html">Community</a></li>
</ul>
</div>
</div>
<div class="content">
<div class="page-tracker"></div>
<div class="section" id="contrib-symbol-api">
<span id="contrib-symbol-api"></span><h1>Contrib Symbol API<a class="headerlink" href="#contrib-symbol-api" title="Permalink to this headline"></a></h1>
<div class="section" id="overview">
<span id="overview"></span><h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline"></a></h2>
<p>This document lists the contrib routines of the symbolic expression package:</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%"/>
<col width="90%"/>
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#module-mxnet.symbol.contrib" title="mxnet.symbol.contrib"><code class="xref py py-obj docutils literal"><span class="pre">mxnet.symbol.contrib</span></code></a></td>
<td>Contrib Symbol API of MXNet.</td>
</tr>
</tbody>
</table>
<p>The <code class="docutils literal"><span class="pre">Contrib</span> <span class="pre">Symbol</span></code> API, defined in the <code class="docutils literal"><span class="pre">symbol.contrib</span></code> package, provides
many useful experimental APIs for new features.
This is a place for the community to try out the new features,
so that feature contributors can receive feedback.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This package contains experimental APIs and may change in the near future.</p>
</div>
<p>In the rest of this document, we list routines provided by the <code class="docutils literal"><span class="pre">symbol.contrib</span></code> package.</p>
</div>
<div class="section" id="contrib">
<span id="contrib"></span><h2>Contrib<a class="headerlink" href="#contrib" title="Permalink to this headline"></a></h2>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%"/>
<col width="90%"/>
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#mxnet.symbol.contrib.AdaptiveAvgPooling2D" title="mxnet.symbol.contrib.AdaptiveAvgPooling2D"><code class="xref py py-obj docutils literal"><span class="pre">AdaptiveAvgPooling2D</span></code></a></td>
<td>Applies a 2D adaptive average pooling over a 4D input with the shape of (NCHW).</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#mxnet.symbol.contrib.BilinearResize2D" title="mxnet.symbol.contrib.BilinearResize2D"><code class="xref py py-obj docutils literal"><span class="pre">BilinearResize2D</span></code></a></td>
<td>Perform 2D resizing (upsampling or downsampling) for 4D input using bilinear interpolation.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#mxnet.symbol.contrib.CTCLoss" title="mxnet.symbol.contrib.CTCLoss"><code class="xref py py-obj docutils literal"><span class="pre">CTCLoss</span></code></a></td>
<td>Connectionist Temporal Classification Loss.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#mxnet.symbol.contrib.DeformableConvolution" title="mxnet.symbol.contrib.DeformableConvolution"><code class="xref py py-obj docutils literal"><span class="pre">DeformableConvolution</span></code></a></td>
<td>Compute 2-D deformable convolution on 4-D input.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#mxnet.symbol.contrib.DeformablePSROIPooling" title="mxnet.symbol.contrib.DeformablePSROIPooling"><code class="xref py py-obj docutils literal"><span class="pre">DeformablePSROIPooling</span></code></a></td>
<td>Performs deformable position-sensitive region-of-interest pooling on inputs.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#mxnet.symbol.contrib.MultiBoxDetection" title="mxnet.symbol.contrib.MultiBoxDetection"><code class="xref py py-obj docutils literal"><span class="pre">MultiBoxDetection</span></code></a></td>
<td>Convert multibox detection predictions.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#mxnet.symbol.contrib.MultiBoxPrior" title="mxnet.symbol.contrib.MultiBoxPrior"><code class="xref py py-obj docutils literal"><span class="pre">MultiBoxPrior</span></code></a></td>
<td>Generate prior(anchor) boxes from data, sizes and ratios.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#mxnet.symbol.contrib.MultiBoxTarget" title="mxnet.symbol.contrib.MultiBoxTarget"><code class="xref py py-obj docutils literal"><span class="pre">MultiBoxTarget</span></code></a></td>
<td>Compute Multibox training targets</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#mxnet.symbol.contrib.MultiProposal" title="mxnet.symbol.contrib.MultiProposal"><code class="xref py py-obj docutils literal"><span class="pre">MultiProposal</span></code></a></td>
<td>Generate region proposals via RPN</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#mxnet.symbol.contrib.PSROIPooling" title="mxnet.symbol.contrib.PSROIPooling"><code class="xref py py-obj docutils literal"><span class="pre">PSROIPooling</span></code></a></td>
<td>Performs region-of-interest pooling on inputs.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#mxnet.symbol.contrib.Proposal" title="mxnet.symbol.contrib.Proposal"><code class="xref py py-obj docutils literal"><span class="pre">Proposal</span></code></a></td>
<td>Generate region proposals via RPN</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#mxnet.symbol.contrib.ROIAlign" title="mxnet.symbol.contrib.ROIAlign"><code class="xref py py-obj docutils literal"><span class="pre">ROIAlign</span></code></a></td>
<td>This operator takes a 4D feature map as an input array and region proposals as <cite>rois</cite>, then align the feature map over sub-regions of input and produces a fixed-sized output array.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#mxnet.symbol.contrib.count_sketch" title="mxnet.symbol.contrib.count_sketch"><code class="xref py py-obj docutils literal"><span class="pre">count_sketch</span></code></a></td>
<td>Apply CountSketch to input: map a d-dimension data to k-dimension data”</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#mxnet.symbol.contrib.ctc_loss" title="mxnet.symbol.contrib.ctc_loss"><code class="xref py py-obj docutils literal"><span class="pre">ctc_loss</span></code></a></td>
<td>Connectionist Temporal Classification Loss.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#mxnet.symbol.contrib.dequantize" title="mxnet.symbol.contrib.dequantize"><code class="xref py py-obj docutils literal"><span class="pre">dequantize</span></code></a></td>
<td>Dequantize the input tensor into a float tensor.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#mxnet.symbol.contrib.fft" title="mxnet.symbol.contrib.fft"><code class="xref py py-obj docutils literal"><span class="pre">fft</span></code></a></td>
<td>Apply 1D FFT to input”</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#mxnet.symbol.contrib.ifft" title="mxnet.symbol.contrib.ifft"><code class="xref py py-obj docutils literal"><span class="pre">ifft</span></code></a></td>
<td>Apply 1D ifft to input”</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#mxnet.symbol.contrib.quantize" title="mxnet.symbol.contrib.quantize"><code class="xref py py-obj docutils literal"><span class="pre">quantize</span></code></a></td>
<td>Quantize a input tensor from float to <cite>out_type</cite>, with user-specified <cite>min_range</cite> and <cite>max_range</cite>.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#mxnet.symbol.contrib.foreach" title="mxnet.symbol.contrib.foreach"><code class="xref py py-obj docutils literal"><span class="pre">foreach</span></code></a></td>
<td>Run a for loop with user-defined computation over Symbols on dimension 0.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#mxnet.symbol.contrib.while_loop" title="mxnet.symbol.contrib.while_loop"><code class="xref py py-obj docutils literal"><span class="pre">while_loop</span></code></a></td>
<td>Run a while loop with user-defined computation and loop condition.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#mxnet.symbol.contrib.cond" title="mxnet.symbol.contrib.cond"><code class="xref py py-obj docutils literal"><span class="pre">cond</span></code></a></td>
<td>Run an if-then-else using user-defined condition and computation</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="api-reference">
<span id="api-reference"></span><h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to this headline"></a></h2>
<script src="../../../_static/js/auto_module_index.js" type="text/javascript"></script><span class="target" id="module-mxnet.symbol.contrib"></span><p>Contrib Symbol API of MXNet.</p>
<dl class="function">
<dt id="mxnet.symbol.contrib.rand_zipfian">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">rand_zipfian</code><span class="sig-paren">(</span><em>true_classes</em>, <em>num_sampled</em>, <em>range_max</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/mxnet/symbol/contrib.html#rand_zipfian"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#mxnet.symbol.contrib.rand_zipfian" title="Permalink to this definition"></a></dt>
<dd><p>Draw random samples from an approximately log-uniform or Zipfian distribution.</p>
<p>This operation randomly samples <em>num_sampled</em> candidates the range of integers [0, range_max).
The elements of sampled_candidates are drawn with replacement from the base distribution.</p>
<p>The base distribution for this operator is an approximately log-uniform or Zipfian distribution:</p>
<p>P(class) = (log(class + 2) - log(class + 1)) / log(range_max + 1)</p>
<p>This sampler is useful when the true classes approximately follow such a distribution.
For example, if the classes represent words in a lexicon sorted in decreasing order of frequency. If your classes are not ordered by decreasing frequency, do not use this op.</p>
<p>Additionaly, it also returns the number of times each of the true classes and the sampled classes is expected to occur.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>true_classes</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The target classes in 1-D.</li>
<li><strong>num_sampled</strong> (<em>int</em>) – The number of classes to randomly sample.</li>
<li><strong>range_max</strong> (<em>int</em>) – The number of possible classes.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><ul class="simple">
<li><strong>samples</strong> (<em>Symbol</em>) – The sampled candidate classes in 1-D <cite>int64</cite> dtype.</li>
<li><strong>expected_count_true</strong> (<em>Symbol</em>) – The expected count for true classes in 1-D <cite>float64</cite> dtype.</li>
<li><strong>expected_count_sample</strong> (<em>Symbol</em>) – The expected count for sampled candidates in 1-D <cite>float64</cite> dtype.</li>
</ul>
</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">true_cls</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">nd</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mi">3</span><span class="p">])</span>
<span class="gp">>>> </span><span class="n">samples</span><span class="p">,</span> <span class="n">exp_count_true</span><span class="p">,</span> <span class="n">exp_count_sample</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">nd</span><span class="o">.</span><span class="n">contrib</span><span class="o">.</span><span class="n">rand_zipfian</span><span class="p">(</span><span class="n">true_cls</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">samples</span>
<span class="go">[1 3 3 3]</span>
<span class="go"><NDArray 4 @cpu(0)></span>
<span class="gp">>>> </span><span class="n">exp_count_true</span>
<span class="go">[ 0.12453879]</span>
<span class="go"><NDArray 1 @cpu(0)></span>
<span class="gp">>>> </span><span class="n">exp_count_sample</span>
<span class="go">[ 0.22629439 0.12453879 0.12453879 0.12453879]</span>
<span class="go"><NDArray 4 @cpu(0)></span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.foreach">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">foreach</code><span class="sig-paren">(</span><em>body</em>, <em>data</em>, <em>init_states</em>, <em>name='foreach'</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/mxnet/symbol/contrib.html#foreach"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#mxnet.symbol.contrib.foreach" title="Permalink to this definition"></a></dt>
<dd><p>Run a for loop with user-defined computation over Symbols on dimension 0.</p>
<p>This operator simulates a for loop and body has the computation for an iteration
of the for loop. It runs the computation in body on each slice from the input
NDArrays.</p>
<p>body takes two arguments as input and outputs a tuple of two elements,
as illustrated below:</p>
<p>out, states = body(data1, states)</p>
<p>data1 can be either a symbol or a list of symbols. If data is a symbol,
data1 is a symbol. Otherwise, data1 is a list of symbols and has the same
size as data. states is a list of symbols and have the same size as init_states.
Similarly, out can be either a symbol or a list of symbols, which are concatenated
as the first output of foreach; states from the last execution of body
are the second output of foreach.</p>
<p>foreach can output only output data or states. If a user only wants states,
the body function can return ([], states). Similarly, if a user only wants
output data, the body function can return (out, []).</p>
<p>The computation done by this operator is equivalent to the pseudo code below
when the input data is NDArray:</p>
<p>states = init_states
outs = []
for i in data.shape[0]:</p>
<blockquote>
<div>s = data[i]
out, states = body(s, states)
outs.append(out)</div></blockquote>
<p>outs = stack(<a href="#id1"><span class="problematic" id="id2">*</span></a>outs)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>body</strong> (<em>a Python function.</em>) – Define computation in an iteration.</li>
<li><strong>data</strong> (<em>a symbol</em><em> or </em><em>a list of symbols.</em>) – The input data.</li>
<li><strong>init_states</strong> (<em>a symbol</em><em> or </em><em>a list of symbols.</em>) – The initial values of the loop states.</li>
<li><strong>name</strong> (<em>string.</em>) – The name of the operator.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><ul class="simple">
<li><strong>outputs</strong> (<em>a Symbol or a list of Symbols.</em>) – The output data concatenated from the output of all iterations.</li>
<li><strong>states</strong> (<em>a list of Symbols.</em>) – The loop states in the last iteration.</li>
</ul>
</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">step</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">data</span><span class="p">,</span> <span class="n">states</span><span class="p">:</span> <span class="p">(</span><span class="n">data</span> <span class="o">+</span> <span class="n">states</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">states</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">*</span> <span class="mi">2</span><span class="p">])</span>
<span class="gp">>>> </span><span class="n">data</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">sym</span><span class="o">.</span><span class="n">var</span><span class="p">(</span><span class="s1">'data'</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">states</span> <span class="o">=</span> <span class="p">[</span><span class="n">mx</span><span class="o">.</span><span class="n">sym</span><span class="o">.</span><span class="n">var</span><span class="p">(</span><span class="s1">'state'</span><span class="p">)]</span>
<span class="gp">>>> </span><span class="n">outs</span><span class="p">,</span> <span class="n">states</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">sym</span><span class="o">.</span><span class="n">contrib</span><span class="o">.</span><span class="n">foreach</span><span class="p">(</span><span class="n">step</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">states</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.while_loop">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">while_loop</code><span class="sig-paren">(</span><em>cond</em>, <em>func</em>, <em>loop_vars</em>, <em>max_iterations=None</em>, <em>name='while_loop'</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/mxnet/symbol/contrib.html#while_loop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#mxnet.symbol.contrib.while_loop" title="Permalink to this definition"></a></dt>
<dd><p>Run a while loop with user-defined computation and loop condition.</p>
<p>This operator simulates a while loop which iterately does customized computation
as long as the condition is satisfied.</p>
<p><cite>loop_vars</cite> is a list of Symbols on which the computation uses.</p>
<p><cite>cond</cite> is a user-defined function, used as the loop condition.
It consumes <cite>loop_vars</cite>, and produces a scalar MXNet symbol,
indicating the termination of the loop.
The loop ends when <cite>cond</cite> returns false (zero).
The <cite>cond</cite> is variadic, and its signature should be
<cite>cond(*loop_vars) => Symbol</cite>.</p>
<p><cite>func</cite> is a user-defined function, used as the loop body.
It also consumes <cite>loop_vars</cite>, and produces <cite>step_output</cite> and <cite>new_loop_vars</cite> at each step.
In each step, <cite>step_output</cite> should contain the same number elements.
Through all steps, the i-th element of <cite>step_output</cite> should have the same shape and dtype.
Also, <cite>new_loop_vars</cite> should contain the same number of elements as <cite>loop_vars</cite>,
and the corresponding element should have the same shape and dtype.
The <cite>func</cite> is variadic, and its signature should be
<cite>func(*loop_vars) => (List[Symbol] step_output, List[Symbol] new_loop_vars)</cite>.</p>
<p><cite>max_iterations</cite> is a scalar that defines the maximum number of iterations allowed.</p>
<p>This function returns two lists.
The first list has the length of <cite>|step_output|</cite>,
in which the i-th element are all i-th elements of
<cite>step_output</cite> from all steps, stacked along axis 0.
The second list has the length of <cite>|loop_vars|</cite>,
which represents final states of loop variables.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">For now, the axis 0 of all Symbols in the first list are <cite>max_iterations</cite>,
due to lack of dynamic shape inference.</p>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Even if <cite>cond</cite> is never satisfied,
while_loop returns a list of outputs with inferred dtype and shape.
This is different from the Symbol version,
where in this case <cite>step_outputs</cite> are assumed as an empty list.</p>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>cond</strong> (<em>a Python function.</em>) – The loop condition.</li>
<li><strong>func</strong> (<em>a Python function.</em>) – The loop body.</li>
<li><strong>loop_vars</strong> (<em>list of Symbol.</em>) – The initial values of the loop variables.</li>
<li><strong>max_iterations</strong> (<em>a python int.</em>) – Maximum number of iterations.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><ul class="simple">
<li><strong>outputs</strong> (<em>list of Symbols</em>) – stacked output from each step</li>
<li><strong>states</strong> (<em>list of Symbols</em>) – final state</li>
</ul>
</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">cond</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">i</span><span class="p">,</span> <span class="n">s</span><span class="p">:</span> <span class="n">i</span> <span class="o"><=</span> <span class="mi">5</span>
<span class="gp">>>> </span><span class="n">func</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">i</span><span class="p">,</span> <span class="n">s</span><span class="p">:</span> <span class="p">([</span><span class="n">i</span> <span class="o">+</span> <span class="n">s</span><span class="p">],</span> <span class="p">[</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="n">i</span><span class="p">])</span>
<span class="gp">>>> </span><span class="n">loop_vars</span> <span class="o">=</span> <span class="p">(</span><span class="n">mx</span><span class="o">.</span><span class="n">sym</span><span class="o">.</span><span class="n">var</span><span class="p">(</span><span class="s1">'i'</span><span class="p">),</span> <span class="n">mx</span><span class="o">.</span><span class="n">sym</span><span class="o">.</span><span class="n">var</span><span class="p">(</span><span class="s1">'s'</span><span class="p">))</span>
<span class="gp">>>> </span><span class="n">outputs</span><span class="p">,</span> <span class="n">states</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">sym</span><span class="o">.</span><span class="n">contrib</span><span class="o">.</span><span class="n">while_loop</span><span class="p">(</span><span class="n">cond</span><span class="p">,</span> <span class="n">func</span><span class="p">,</span> <span class="n">loop_vars</span><span class="p">,</span> <span class="n">max_iterations</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.cond">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">cond</code><span class="sig-paren">(</span><em>pred</em>, <em>then_func</em>, <em>else_func</em>, <em>name='cond'</em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/mxnet/symbol/contrib.html#cond"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#mxnet.symbol.contrib.cond" title="Permalink to this definition"></a></dt>
<dd><p>Run an if-then-else using user-defined condition and computation</p>
<p>This operator simulates a if-like branch which chooses to do one of
the two customized computations according to the specified condition.</p>
<p><cite>pred</cite> is a scalar MXNet Symbol,
indicating which branch of computation should be used.</p>
<p><cite>then_func</cite> is a user-defined function, used as computation of the then branch.
It produces <cite>outputs</cite>, which is a list of Symbols.
The signature of <cite>then_func</cite> should be
<cite>then_func() => List[Symbol]</cite>.</p>
<p><cite>else_func</cite> is a user-defined function, used as computation of the else branch.
It produces <cite>outputs</cite>, which is a list of Symbols.
The signature of <cite>else_func</cite> should be
<cite>else_func() => List[Symbol]</cite>.</p>
<p>The <cite>outputs</cite> produces by <cite>then_func</cite> and <cite>else_func</cite> should have the same number
of elements, all of which should be in the same shape, of the same dtype and stype.</p>
<p>This function returns a list of symbols, representing the computation result.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>pred</strong> (<em>a MXNet Symbol representing a scalar.</em>) – The branch condition.</li>
<li><strong>then_func</strong> (<em>a Python function.</em>) – The computation to be executed if <cite>pred</cite> is true.</li>
<li><strong>else_func</strong> (<em>a Python function.</em>) – The computation to be executed if <cite>pred</cite> is false.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>outputs</strong></p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">a list of Symbols, representing the result of computation.</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">a</span><span class="p">,</span> <span class="n">b</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">sym</span><span class="o">.</span><span class="n">var</span><span class="p">(</span><span class="s1">'a'</span><span class="p">),</span> <span class="n">mx</span><span class="o">.</span><span class="n">sym</span><span class="o">.</span><span class="n">var</span><span class="p">(</span><span class="s1">'b'</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">pred</span> <span class="o">=</span> <span class="n">a</span> <span class="o">*</span> <span class="n">b</span> <span class="o"><</span> <span class="mi">5</span>
<span class="gp">>>> </span><span class="n">then_func</span> <span class="o">=</span> <span class="k">lambda</span><span class="p">:</span> <span class="p">(</span><span class="n">a</span> <span class="o">+</span> <span class="mi">5</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="n">b</span> <span class="o">+</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">else_func</span> <span class="o">=</span> <span class="k">lambda</span><span class="p">:</span> <span class="p">(</span><span class="n">a</span> <span class="o">-</span> <span class="mi">5</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="n">b</span> <span class="o">-</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">outputs</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">sym</span><span class="o">.</span><span class="n">contrib</span><span class="o">.</span><span class="n">cond</span><span class="p">(</span><span class="n">pred</span><span class="p">,</span> <span class="n">then_func</span><span class="p">,</span> <span class="n">else_func</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.AdaptiveAvgPooling2D">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">AdaptiveAvgPooling2D</code><span class="sig-paren">(</span><em>data=None</em>, <em>output_size=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.AdaptiveAvgPooling2D" title="Permalink to this definition"></a></dt>
<dd><p>Applies a 2D adaptive average pooling over a 4D input with the shape of (NCHW).
The pooling kernel and stride sizes are automatically chosen for desired output sizes.</p>
<ul class="simple">
<li>If a single integer is provided for output_size, the output size is</li>
</ul>
<p>(N x C x output_size x output_size) for any input (NCHW).</p>
<ul class="simple">
<li>If a tuple of integers (height, width) are provided for output_size, the output size is</li>
</ul>
<p>(N x C x height x width) for any input (NCHW).</p>
<p>Defined in src/operator/contrib/adaptive_avg_pooling.cc:L214</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data</li>
<li><strong>output_size</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>]</em>) – int (output size) or a tuple of int for output (height, width).</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.BilinearResize2D">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">BilinearResize2D</code><span class="sig-paren">(</span><em>data=None</em>, <em>height=_Null</em>, <em>width=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.BilinearResize2D" title="Permalink to this definition"></a></dt>
<dd><p>Perform 2D resizing (upsampling or downsampling) for 4D input using bilinear interpolation.</p>
<p>Expected input is a 4 dimensional NDArray (NCHW) and the output
with the shape of (N x C x height x width).
The key idea of bilinear interpolation is to perform linear interpolation
first in one direction, and then again in the other direction. See the wikipedia of
<a class="reference external" href="https://en.wikipedia.org/wiki/Bilinear_interpolation">Bilinear interpolation</a>
for more details.</p>
<p>Defined in src/operator/contrib/bilinear_resize.cc:L175</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data</li>
<li><strong>height</strong> (<em>int</em><em>, </em><em>required</em>) – output height (required)</li>
<li><strong>width</strong> (<em>int</em><em>, </em><em>required</em>) – output width (required)</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.CTCLoss">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">CTCLoss</code><span class="sig-paren">(</span><em>data=None</em>, <em>label=None</em>, <em>data_lengths=None</em>, <em>label_lengths=None</em>, <em>use_data_lengths=_Null</em>, <em>use_label_lengths=_Null</em>, <em>blank_label=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.CTCLoss" title="Permalink to this definition"></a></dt>
<dd><p>Connectionist Temporal Classification Loss.</p>
<p>The shapes of the inputs and outputs:</p>
<ul class="simple">
<li><strong>data</strong>: <cite>(sequence_length, batch_size, alphabet_size)</cite></li>
<li><strong>label</strong>: <cite>(batch_size, label_sequence_length)</cite></li>
<li><strong>out</strong>: <cite>(batch_size)</cite></li>
</ul>
<p>The <cite>data</cite> tensor consists of sequences of activation vectors (without applying softmax),
with i-th channel in the last dimension corresponding to i-th label
for i between 0 and alphabet_size-1 (i.e always 0-indexed).
Alphabet size should include one additional value reserved for blank label.
When <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"first"</span></code>, the <code class="docutils literal"><span class="pre">0</span></code>-th channel is be reserved for
activation of blank label, or otherwise if it is “last”, <code class="docutils literal"><span class="pre">(alphabet_size-1)</span></code>-th channel should be
reserved for blank label.</p>
<p><code class="docutils literal"><span class="pre">label</span></code> is an index matrix of integers. When <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"first"</span></code>,
the value 0 is then reserved for blank label, and should not be passed in this matrix. Otherwise,
when <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"last"</span></code>, the value <cite>(alphabet_size-1)</cite> is reserved for blank label.</p>
<p>If a sequence of labels is shorter than <em>label_sequence_length</em>, use the special
padding value at the end of the sequence to conform it to the correct
length. The padding value is <cite>0</cite> when <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"first"</span></code>, and <cite>-1</cite> otherwise.</p>
<p>For example, suppose the vocabulary is <cite>[a, b, c]</cite>, and in one batch we have three sequences
‘ba’, ‘cbb’, and ‘abac’. When <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"first"</span></code>, we can index the labels as
<cite>{‘a’: 1, ‘b’: 2, ‘c’: 3}</cite>, and we reserve the 0-th channel for blank label in data tensor.
The resulting <cite>label</cite> tensor should be padded to be:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">]]</span>
</pre></div>
</div>
<p>When <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"last"</span></code>, we can index the labels as
<cite>{‘a’: 0, ‘b’: 1, ‘c’: 2}</cite>, and we reserve the channel index 3 for blank label in data tensor.
The resulting <cite>label</cite> tensor should be padded to be:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">]]</span>
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">out</span></code> is a list of CTC loss values, one per example in the batch.</p>
<p>See <em>Connectionist Temporal Classification: Labelling Unsegmented
Sequence Data with Recurrent Neural Networks</em>, A. Graves <em>et al</em>. for more
information on the definition and the algorithm.</p>
<p>Defined in src/operator/contrib/ctc_loss.cc:L115</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data to the ctc_loss op.</li>
<li><strong>label</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Ground-truth labels for the loss.</li>
<li><strong>data_lengths</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Lengths of data for each of the samples. Only required when use_data_lengths is true.</li>
<li><strong>label_lengths</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Lengths of labels for each of the samples. Only required when use_label_lengths is true.</li>
<li><strong>use_data_lengths</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Whether the data lenghts are decided by <cite>data_lengths</cite>. If false, the lengths are equal to the max sequence length.</li>
<li><strong>use_label_lengths</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Whether the label lenghts are decided by <cite>label_lengths</cite>, or derived from <cite>padding_mask</cite>. If false, the lengths are derived from the first occurrence of the value of <cite>padding_mask</cite>. The value of <cite>padding_mask</cite> is <code class="docutils literal"><span class="pre">0</span></code> when first CTC label is reserved for blank, and <code class="docutils literal"><span class="pre">-1</span></code> when last label is reserved for blank. See <cite>blank_label</cite>.</li>
<li><strong>blank_label</strong> (<em>{'first'</em><em>, </em><em>'last'}</em><em>,</em><em>optional</em><em>, </em><em>default='first'</em>) – Set the label that is reserved for blank label.If “first”, 0-th label is reserved, and label values for tokens in the vocabulary are between <code class="docutils literal"><span class="pre">1</span></code> and <code class="docutils literal"><span class="pre">alphabet_size-1</span></code>, and the padding mask is <code class="docutils literal"><span class="pre">-1</span></code>. If “last”, last label value <code class="docutils literal"><span class="pre">alphabet_size-1</span></code> is reserved for blank label instead, and label values for tokens in the vocabulary are between <code class="docutils literal"><span class="pre">0</span></code> and <code class="docutils literal"><span class="pre">alphabet_size-2</span></code>, and the padding mask is <code class="docutils literal"><span class="pre">0</span></code>.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.DeformableConvolution">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">DeformableConvolution</code><span class="sig-paren">(</span><em>data=None</em>, <em>offset=None</em>, <em>weight=None</em>, <em>bias=None</em>, <em>kernel=_Null</em>, <em>stride=_Null</em>, <em>dilate=_Null</em>, <em>pad=_Null</em>, <em>num_filter=_Null</em>, <em>num_group=_Null</em>, <em>num_deformable_group=_Null</em>, <em>workspace=_Null</em>, <em>no_bias=_Null</em>, <em>layout=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.DeformableConvolution" title="Permalink to this definition"></a></dt>
<dd><p>Compute 2-D deformable convolution on 4-D input.</p>
<p>The deformable convolution operation is described in <a class="reference external" href="https://arxiv.org/abs/1703.06211">https://arxiv.org/abs/1703.06211</a></p>
<p>For 2-D deformable convolution, the shapes are</p>
<ul class="simple">
<li><strong>data</strong>: <em>(batch_size, channel, height, width)</em></li>
<li><strong>offset</strong>: <em>(batch_size, num_deformable_group * kernel[0] * kernel[1], height, width)</em></li>
<li><strong>weight</strong>: <em>(num_filter, channel, kernel[0], kernel[1])</em></li>
<li><strong>bias</strong>: <em>(num_filter,)</em></li>
<li><strong>out</strong>: <em>(batch_size, num_filter, out_height, out_width)</em>.</li>
</ul>
<p>Define:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">f</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="n">k</span><span class="p">,</span><span class="n">p</span><span class="p">,</span><span class="n">s</span><span class="p">,</span><span class="n">d</span><span class="p">)</span> <span class="o">=</span> <span class="n">floor</span><span class="p">((</span><span class="n">x</span><span class="o">+</span><span class="mi">2</span><span class="o">*</span><span class="n">p</span><span class="o">-</span><span class="n">d</span><span class="o">*</span><span class="p">(</span><span class="n">k</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="n">s</span><span class="p">)</span><span class="o">+</span><span class="mi">1</span>
</pre></div>
</div>
<p>then we have:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">out_height</span><span class="o">=</span><span class="n">f</span><span class="p">(</span><span class="n">height</span><span class="p">,</span> <span class="n">kernel</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">pad</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">stride</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">dilate</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="n">out_width</span><span class="o">=</span><span class="n">f</span><span class="p">(</span><span class="n">width</span><span class="p">,</span> <span class="n">kernel</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">pad</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">stride</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">dilate</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
</pre></div>
</div>
<p>If <code class="docutils literal"><span class="pre">no_bias</span></code> is set to be true, then the <code class="docutils literal"><span class="pre">bias</span></code> term is ignored.</p>
<p>The default data <code class="docutils literal"><span class="pre">layout</span></code> is <em>NCHW</em>, namely <em>(batch_size, channle, height,
width)</em>.</p>
<p>If <code class="docutils literal"><span class="pre">num_group</span></code> is larger than 1, denoted by <em>g</em>, then split the input <code class="docutils literal"><span class="pre">data</span></code>
evenly into <em>g</em> parts along the channel axis, and also evenly split <code class="docutils literal"><span class="pre">weight</span></code>
along the first dimension. Next compute the convolution on the <em>i</em>-th part of
the data with the <em>i</em>-th weight part. The output is obtained by concating all
the <em>g</em> results.</p>
<p>If <code class="docutils literal"><span class="pre">num_deformable_group</span></code> is larger than 1, denoted by <em>dg</em>, then split the
input <code class="docutils literal"><span class="pre">offset</span></code> evenly into <em>dg</em> parts along the channel axis, and also evenly
split <code class="docutils literal"><span class="pre">out</span></code> evenly into <em>dg</em> parts along the channel axis. Next compute the
deformable convolution, apply the <em>i</em>-th part of the offset part on the <em>i</em>-th
out.</p>
<p>Both <code class="docutils literal"><span class="pre">weight</span></code> and <code class="docutils literal"><span class="pre">bias</span></code> are learnable parameters.</p>
<p>Defined in src/operator/contrib/deformable_convolution.cc:L100</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data to the DeformableConvolutionOp.</li>
<li><strong>offset</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input offset to the DeformableConvolutionOp.</li>
<li><strong>weight</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Weight matrix.</li>
<li><strong>bias</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Bias parameter.</li>
<li><strong>kernel</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>required</em>) – Convolution kernel size: (h, w) or (d, h, w)</li>
<li><strong>stride</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>]</em>) – Convolution stride: (h, w) or (d, h, w). Defaults to 1 for each dimension.</li>
<li><strong>dilate</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>]</em>) – Convolution dilate: (h, w) or (d, h, w). Defaults to 1 for each dimension.</li>
<li><strong>pad</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>]</em>) – Zero pad for convolution: (h, w) or (d, h, w). Defaults to no padding.</li>
<li><strong>num_filter</strong> (<em>int</em><em> (</em><em>non-negative</em><em>)</em><em>, </em><em>required</em>) – Convolution filter(channel) number</li>
<li><strong>num_group</strong> (<em>int</em><em> (</em><em>non-negative</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=1</em>) – Number of group partitions.</li>
<li><strong>num_deformable_group</strong> (<em>int</em><em> (</em><em>non-negative</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=1</em>) – Number of deformable group partitions.</li>
<li><strong>workspace</strong> (<em>long</em><em> (</em><em>non-negative</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=1024</em>) – Maximum temperal workspace allowed for convolution (MB).</li>
<li><strong>no_bias</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Whether to disable bias parameter.</li>
<li><strong>layout</strong> (<em>{None</em><em>, </em><em>'NCDHW'</em><em>, </em><em>'NCHW'</em><em>, </em><em>'NCW'}</em><em>,</em><em>optional</em><em>, </em><em>default='None'</em>) – Set layout for input, output and weight. Empty for
default layout: NCW for 1d, NCHW for 2d and NCDHW for 3d.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.DeformablePSROIPooling">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">DeformablePSROIPooling</code><span class="sig-paren">(</span><em>data=None</em>, <em>rois=None</em>, <em>trans=None</em>, <em>spatial_scale=_Null</em>, <em>output_dim=_Null</em>, <em>group_size=_Null</em>, <em>pooled_size=_Null</em>, <em>part_size=_Null</em>, <em>sample_per_part=_Null</em>, <em>trans_std=_Null</em>, <em>no_trans=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.DeformablePSROIPooling" title="Permalink to this definition"></a></dt>
<dd><p>Performs deformable position-sensitive region-of-interest pooling on inputs.
The DeformablePSROIPooling operation is described in <a class="reference external" href="https://arxiv.org/abs/1703.06211">https://arxiv.org/abs/1703.06211</a> .batch_size will change to the number of region bounding boxes after DeformablePSROIPooling</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data to the pooling operator, a 4D Feature maps</li>
<li><strong>rois</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Bounding box coordinates, a 2D array of [[batch_index, x1, y1, x2, y2]]. (x1, y1) and (x2, y2) are top left and down right corners of designated region of interest. batch_index indicates the index of corresponding image in the input data</li>
<li><strong>trans</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – transition parameter</li>
<li><strong>spatial_scale</strong> (<em>float</em><em>, </em><em>required</em>) – Ratio of input feature map height (or w) to raw image height (or w). Equals the reciprocal of total stride in convolutional layers</li>
<li><strong>output_dim</strong> (<em>int</em><em>, </em><em>required</em>) – fix output dim</li>
<li><strong>group_size</strong> (<em>int</em><em>, </em><em>required</em>) – fix group size</li>
<li><strong>pooled_size</strong> (<em>int</em><em>, </em><em>required</em>) – fix pooled size</li>
<li><strong>part_size</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='0'</em>) – fix part size</li>
<li><strong>sample_per_part</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='1'</em>) – fix samples per part</li>
<li><strong>trans_std</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – fix transition std</li>
<li><strong>no_trans</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Whether to disable trans parameter.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.MultiBoxDetection">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">MultiBoxDetection</code><span class="sig-paren">(</span><em>cls_prob=None</em>, <em>loc_pred=None</em>, <em>anchor=None</em>, <em>clip=_Null</em>, <em>threshold=_Null</em>, <em>background_id=_Null</em>, <em>nms_threshold=_Null</em>, <em>force_suppress=_Null</em>, <em>variances=_Null</em>, <em>nms_topk=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.MultiBoxDetection" title="Permalink to this definition"></a></dt>
<dd><p>Convert multibox detection predictions.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>cls_prob</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Class probabilities.</li>
<li><strong>loc_pred</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Location regression predictions.</li>
<li><strong>anchor</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Multibox prior anchor boxes</li>
<li><strong>clip</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=1</em>) – Clip out-of-boundary boxes.</li>
<li><strong>threshold</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0.01</em>) – Threshold to be a positive prediction.</li>
<li><strong>background_id</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='0'</em>) – Background id.</li>
<li><strong>nms_threshold</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0.5</em>) – Non-maximum suppression threshold.</li>
<li><strong>force_suppress</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Suppress all detections regardless of class_id.</li>
<li><strong>variances</strong> (<em>tuple of <float></em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>0.1</em><em>,</em><em>0.1</em><em>,</em><em>0.2</em><em>,</em><em>0.2</em><em>]</em>) – Variances to be decoded from box regression output.</li>
<li><strong>nms_topk</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='-1'</em>) – Keep maximum top k detections before nms, -1 for no limit.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.MultiBoxPrior">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">MultiBoxPrior</code><span class="sig-paren">(</span><em>data=None</em>, <em>sizes=_Null</em>, <em>ratios=_Null</em>, <em>clip=_Null</em>, <em>steps=_Null</em>, <em>offsets=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.MultiBoxPrior" title="Permalink to this definition"></a></dt>
<dd><p>Generate prior(anchor) boxes from data, sizes and ratios.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data.</li>
<li><strong>sizes</strong> (<em>tuple of <float></em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>1</em><em>]</em>) – List of sizes of generated MultiBoxPriores.</li>
<li><strong>ratios</strong> (<em>tuple of <float></em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>1</em><em>]</em>) – List of aspect ratios of generated MultiBoxPriores.</li>
<li><strong>clip</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Whether to clip out-of-boundary boxes.</li>
<li><strong>steps</strong> (<em>tuple of <float></em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>-1</em><em>,</em><em>-1</em><em>]</em>) – Priorbox step across y and x, -1 for auto calculation.</li>
<li><strong>offsets</strong> (<em>tuple of <float></em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>0.5</em><em>,</em><em>0.5</em><em>]</em>) – Priorbox center offsets, y and x respectively</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.MultiBoxTarget">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">MultiBoxTarget</code><span class="sig-paren">(</span><em>anchor=None</em>, <em>label=None</em>, <em>cls_pred=None</em>, <em>overlap_threshold=_Null</em>, <em>ignore_label=_Null</em>, <em>negative_mining_ratio=_Null</em>, <em>negative_mining_thresh=_Null</em>, <em>minimum_negative_samples=_Null</em>, <em>variances=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.MultiBoxTarget" title="Permalink to this definition"></a></dt>
<dd><p>Compute Multibox training targets</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>anchor</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Generated anchor boxes.</li>
<li><strong>label</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Object detection labels.</li>
<li><strong>cls_pred</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Class predictions.</li>
<li><strong>overlap_threshold</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0.5</em>) – Anchor-GT overlap threshold to be regarded as a positive match.</li>
<li><strong>ignore_label</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=-1</em>) – Label for ignored anchors.</li>
<li><strong>negative_mining_ratio</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=-1</em>) – Max negative to positive samples ratio, use -1 to disable mining</li>
<li><strong>negative_mining_thresh</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0.5</em>) – Threshold used for negative mining.</li>
<li><strong>minimum_negative_samples</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='0'</em>) – Minimum number of negative samples.</li>
<li><strong>variances</strong> (<em>tuple of <float></em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>0.1</em><em>,</em><em>0.1</em><em>,</em><em>0.2</em><em>,</em><em>0.2</em><em>]</em>) – Variances to be encoded in box regression target.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.MultiProposal">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">MultiProposal</code><span class="sig-paren">(</span><em>cls_prob=None</em>, <em>bbox_pred=None</em>, <em>im_info=None</em>, <em>rpn_pre_nms_top_n=_Null</em>, <em>rpn_post_nms_top_n=_Null</em>, <em>threshold=_Null</em>, <em>rpn_min_size=_Null</em>, <em>scales=_Null</em>, <em>ratios=_Null</em>, <em>feature_stride=_Null</em>, <em>output_score=_Null</em>, <em>iou_loss=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.MultiProposal" title="Permalink to this definition"></a></dt>
<dd><p>Generate region proposals via RPN</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>cls_prob</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Score of how likely proposal is object.</li>
<li><strong>bbox_pred</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – BBox Predicted deltas from anchors for proposals</li>
<li><strong>im_info</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Image size and scale.</li>
<li><strong>rpn_pre_nms_top_n</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='6000'</em>) – Number of top scoring boxes to keep after applying NMS to RPN proposals</li>
<li><strong>rpn_post_nms_top_n</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='300'</em>) – Overlap threshold used for non-maximumsuppresion(suppress boxes with IoU >= this threshold</li>
<li><strong>threshold</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0.7</em>) – NMS value, below which to suppress.</li>
<li><strong>rpn_min_size</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='16'</em>) – Minimum height or width in proposal</li>
<li><strong>scales</strong> (<em>tuple of <float></em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>4</em><em>,</em><em>8</em><em>,</em><em>16</em><em>,</em><em>32</em><em>]</em>) – Used to generate anchor windows by enumerating scales</li>
<li><strong>ratios</strong> (<em>tuple of <float></em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>0.5</em><em>,</em><em>1</em><em>,</em><em>2</em><em>]</em>) – Used to generate anchor windows by enumerating ratios</li>
<li><strong>feature_stride</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='16'</em>) – The size of the receptive field each unit in the convolution layer of the rpn,for example the product of all stride’s prior to this layer.</li>
<li><strong>output_score</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Add score to outputs</li>
<li><strong>iou_loss</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Usage of IoU Loss</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.PSROIPooling">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">PSROIPooling</code><span class="sig-paren">(</span><em>data=None</em>, <em>rois=None</em>, <em>spatial_scale=_Null</em>, <em>output_dim=_Null</em>, <em>pooled_size=_Null</em>, <em>group_size=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.PSROIPooling" title="Permalink to this definition"></a></dt>
<dd><p>Performs region-of-interest pooling on inputs. Resize bounding box coordinates by spatial_scale and crop input feature maps accordingly. The cropped feature maps are pooled by max pooling to a fixed size output indicated by pooled_size. batch_size will change to the number of region bounding boxes after PSROIPooling</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data to the pooling operator, a 4D Feature maps</li>
<li><strong>rois</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Bounding box coordinates, a 2D array of [[batch_index, x1, y1, x2, y2]]. (x1, y1) and (x2, y2) are top left and down right corners of designated region of interest. batch_index indicates the index of corresponding image in the input data</li>
<li><strong>spatial_scale</strong> (<em>float</em><em>, </em><em>required</em>) – Ratio of input feature map height (or w) to raw image height (or w). Equals the reciprocal of total stride in convolutional layers</li>
<li><strong>output_dim</strong> (<em>int</em><em>, </em><em>required</em>) – fix output dim</li>
<li><strong>pooled_size</strong> (<em>int</em><em>, </em><em>required</em>) – fix pooled size</li>
<li><strong>group_size</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='0'</em>) – fix group size</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.Proposal">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">Proposal</code><span class="sig-paren">(</span><em>cls_prob=None</em>, <em>bbox_pred=None</em>, <em>im_info=None</em>, <em>rpn_pre_nms_top_n=_Null</em>, <em>rpn_post_nms_top_n=_Null</em>, <em>threshold=_Null</em>, <em>rpn_min_size=_Null</em>, <em>scales=_Null</em>, <em>ratios=_Null</em>, <em>feature_stride=_Null</em>, <em>output_score=_Null</em>, <em>iou_loss=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.Proposal" title="Permalink to this definition"></a></dt>
<dd><p>Generate region proposals via RPN</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>cls_prob</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Score of how likely proposal is object.</li>
<li><strong>bbox_pred</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – BBox Predicted deltas from anchors for proposals</li>
<li><strong>im_info</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Image size and scale.</li>
<li><strong>rpn_pre_nms_top_n</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='6000'</em>) – Number of top scoring boxes to keep after applying NMS to RPN proposals</li>
<li><strong>rpn_post_nms_top_n</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='300'</em>) – Overlap threshold used for non-maximumsuppresion(suppress boxes with IoU >= this threshold</li>
<li><strong>threshold</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0.7</em>) – NMS value, below which to suppress.</li>
<li><strong>rpn_min_size</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='16'</em>) – Minimum height or width in proposal</li>
<li><strong>scales</strong> (<em>tuple of <float></em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>4</em><em>,</em><em>8</em><em>,</em><em>16</em><em>,</em><em>32</em><em>]</em>) – Used to generate anchor windows by enumerating scales</li>
<li><strong>ratios</strong> (<em>tuple of <float></em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>0.5</em><em>,</em><em>1</em><em>,</em><em>2</em><em>]</em>) – Used to generate anchor windows by enumerating ratios</li>
<li><strong>feature_stride</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='16'</em>) – The size of the receptive field each unit in the convolution layer of the rpn,for example the product of all stride’s prior to this layer.</li>
<li><strong>output_score</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Add score to outputs</li>
<li><strong>iou_loss</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Usage of IoU Loss</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.ROIAlign">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">ROIAlign</code><span class="sig-paren">(</span><em>data=None</em>, <em>rois=None</em>, <em>pooled_size=_Null</em>, <em>spatial_scale=_Null</em>, <em>sample_ratio=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.ROIAlign" title="Permalink to this definition"></a></dt>
<dd><p>This operator takes a 4D feature map as an input array and region proposals as <cite>rois</cite>,
then align the feature map over sub-regions of input and produces a fixed-sized output array.
This operator is typically used in Faster R-CNN &amp; Mask R-CNN networks.</p>
<p>Different from ROI pooling, ROI Align removes the harsh quantization, properly aligning
the extracted features with the input. RoIAlign computes the value of each sampling point
by bilinear interpolation from the nearby grid points on the feature map. No quantization is
performed on any coordinates involved in the RoI, its bins, or the sampling points.
Bilinear interpolation is used to compute the exact values of the
input features at four regularly sampled locations in each RoI bin.
Then the feature map can be aggregated by avgpooling.</p>
<p>He, Kaiming, et al. “Mask R-CNN.” ICCV, 2017</p>
<p>Defined in src/operator/contrib/roi_align.cc:L522</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data to the pooling operator, a 4D Feature maps</li>
<li><strong>rois</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Bounding box coordinates, a 2D array</li>
<li><strong>pooled_size</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>required</em>) – ROI Align output roi feature map height and width: (h, w)</li>
<li><strong>spatial_scale</strong> (<em>float</em><em>, </em><em>required</em>) – Ratio of input feature map height (or w) to raw image height (or w). Equals the reciprocal of total stride in convolutional layers</li>
<li><strong>sample_ratio</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='-1'</em>) – Optional sampling ratio of ROI align, using adaptive size by default.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.SparseEmbedding">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">SparseEmbedding</code><span class="sig-paren">(</span><em>data=None</em>, <em>weight=None</em>, <em>input_dim=_Null</em>, <em>output_dim=_Null</em>, <em>dtype=_Null</em>, <em>sparse_grad=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.SparseEmbedding" title="Permalink to this definition"></a></dt>
<dd><p>Maps integer indices to vector representations (embeddings).</p>
<p>note:: <code class="docutils literal"><span class="pre">contrib.SparseEmbedding</span></code> is deprecated, use <code class="docutils literal"><span class="pre">Embedding</span></code> instead.</p>
<p>This operator maps words to real-valued vectors in a high-dimensional space,
called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
For example, it has been noted that in the learned embedding spaces, similar words tend
to be close to each other and dissimilar words far apart.</p>
<p>For an input array of shape (d1, ..., dK),
the shape of an output array is (d1, ..., dK, output_dim).
All the input values should be integers in the range [0, input_dim).</p>
<p>If the input_dim is ip0 and output_dim is op0, then shape of the embedding weight matrix must be
(ip0, op0).</p>
<p>The storage type of the gradient will be <cite>row_sparse</cite>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><cite>SparseEmbedding</cite> is designed for the use case where <cite>input_dim</cite> is very large (e.g. 100k).
The operator is available on both CPU and GPU.
When <cite>deterministic</cite> is set to <cite>True</cite>, the accumulation of gradients follows a
deterministic order if a feature appears multiple times in the input. However, the
accumulation is usually slower when the order is enforced on GPU.
When the operator is used on the GPU, the recommended value for <cite>deterministic</cite> is <cite>True</cite>.</p>
</div>
<p>Examples:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">input_dim</span> <span class="o">=</span> <span class="mi">4</span>
<span class="n">output_dim</span> <span class="o">=</span> <span class="mi">5</span>
<span class="o">//</span> <span class="n">Each</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">weight</span> <span class="n">matrix</span> <span class="n">y</span> <span class="n">represents</span> <span class="n">a</span> <span class="n">word</span><span class="o">.</span> <span class="n">So</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="p">(</span><span class="n">w0</span><span class="p">,</span><span class="n">w1</span><span class="p">,</span><span class="n">w2</span><span class="p">,</span><span class="n">w3</span><span class="p">)</span>
<span class="n">y</span> <span class="o">=</span> <span class="p">[[</span> <span class="mf">0.</span><span class="p">,</span> <span class="mf">1.</span><span class="p">,</span> <span class="mf">2.</span><span class="p">,</span> <span class="mf">3.</span><span class="p">,</span> <span class="mf">4.</span><span class="p">],</span>
<span class="p">[</span> <span class="mf">5.</span><span class="p">,</span> <span class="mf">6.</span><span class="p">,</span> <span class="mf">7.</span><span class="p">,</span> <span class="mf">8.</span><span class="p">,</span> <span class="mf">9.</span><span class="p">],</span>
<span class="p">[</span> <span class="mf">10.</span><span class="p">,</span> <span class="mf">11.</span><span class="p">,</span> <span class="mf">12.</span><span class="p">,</span> <span class="mf">13.</span><span class="p">,</span> <span class="mf">14.</span><span class="p">],</span>
<span class="p">[</span> <span class="mf">15.</span><span class="p">,</span> <span class="mf">16.</span><span class="p">,</span> <span class="mf">17.</span><span class="p">,</span> <span class="mf">18.</span><span class="p">,</span> <span class="mf">19.</span><span class="p">]]</span>
<span class="o">//</span> <span class="n">Input</span> <span class="n">array</span> <span class="n">x</span> <span class="n">represents</span> <span class="n">n</span><span class="o">-</span><span class="n">grams</span><span class="p">(</span><span class="mi">2</span><span class="o">-</span><span class="n">gram</span><span class="p">)</span><span class="o">.</span> <span class="n">So</span><span class="p">,</span> <span class="n">x</span> <span class="o">=</span> <span class="p">[(</span><span class="n">w1</span><span class="p">,</span><span class="n">w3</span><span class="p">),</span> <span class="p">(</span><span class="n">w0</span><span class="p">,</span><span class="n">w2</span><span class="p">)]</span>
<span class="n">x</span> <span class="o">=</span> <span class="p">[[</span> <span class="mf">1.</span><span class="p">,</span> <span class="mf">3.</span><span class="p">],</span>
<span class="p">[</span> <span class="mf">0.</span><span class="p">,</span> <span class="mf">2.</span><span class="p">]]</span>
<span class="o">//</span> <span class="n">Mapped</span> <span class="nb">input</span> <span class="n">x</span> <span class="n">to</span> <span class="n">its</span> <span class="n">vector</span> <span class="n">representation</span> <span class="n">y</span><span class="o">.</span>
<span class="n">SparseEmbedding</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span> <span class="o">=</span> <span class="p">[[[</span> <span class="mf">5.</span><span class="p">,</span> <span class="mf">6.</span><span class="p">,</span> <span class="mf">7.</span><span class="p">,</span> <span class="mf">8.</span><span class="p">,</span> <span class="mf">9.</span><span class="p">],</span>
<span class="p">[</span> <span class="mf">15.</span><span class="p">,</span> <span class="mf">16.</span><span class="p">,</span> <span class="mf">17.</span><span class="p">,</span> <span class="mf">18.</span><span class="p">,</span> <span class="mf">19.</span><span class="p">]],</span>
<span class="p">[[</span> <span class="mf">0.</span><span class="p">,</span> <span class="mf">1.</span><span class="p">,</span> <span class="mf">2.</span><span class="p">,</span> <span class="mf">3.</span><span class="p">,</span> <span class="mf">4.</span><span class="p">],</span>
<span class="p">[</span> <span class="mf">10.</span><span class="p">,</span> <span class="mf">11.</span><span class="p">,</span> <span class="mf">12.</span><span class="p">,</span> <span class="mf">13.</span><span class="p">,</span> <span class="mf">14.</span><span class="p">]]]</span>
</pre></div>
</div>
<p>Defined in src/operator/tensor/indexing_op.cc:L343</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The input array to the embedding operator.</li>
<li><strong>weight</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The embedding weight matrix.</li>
<li><strong>input_dim</strong> (<em>int</em><em>, </em><em>required</em>) – Vocabulary size of the input indices.</li>
<li><strong>output_dim</strong> (<em>int</em><em>, </em><em>required</em>) – Dimension of the embedding vectors.</li>
<li><strong>dtype</strong> (<em>{'float16'</em><em>, </em><em>'float32'</em><em>, </em><em>'float64'</em><em>, </em><em>'int32'</em><em>, </em><em>'int64'</em><em>, </em><em>'int8'</em><em>, </em><em>'uint8'}</em><em>,</em><em>optional</em><em>, </em><em>default='float32'</em>) – Data type of weight.</li>
<li><strong>sparse_grad</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Compute row sparse gradient in the backward calculation. If set to True, the grad’s storage type is row_sparse.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.SyncBatchNorm">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">SyncBatchNorm</code><span class="sig-paren">(</span><em>data=None</em>, <em>gamma=None</em>, <em>beta=None</em>, <em>moving_mean=None</em>, <em>moving_var=None</em>, <em>eps=_Null</em>, <em>momentum=_Null</em>, <em>fix_gamma=_Null</em>, <em>use_global_stats=_Null</em>, <em>output_mean_var=_Null</em>, <em>ndev=_Null</em>, <em>key=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.SyncBatchNorm" title="Permalink to this definition"></a></dt>
<dd><p>Batch normalization.</p>
<p>Normalizes a data batch by mean and variance, and applies a scale <code class="docutils literal"><span class="pre">gamma</span></code> as
well as offset <code class="docutils literal"><span class="pre">beta</span></code>.
Standard BN <a class="footnote-reference" href="#id5" id="id3">[1]</a> implementation only normalize the data within each device.
SyncBN normalizes the input within the whole mini-batch.
We follow the sync-onece implmentation described in the paper <a class="footnote-reference" href="#id6" id="id4">[2]</a>.</p>
<p>Assume the input has more than one dimension and we normalize along axis 1.
We first compute the mean and variance along this axis:</p>
<div class="math">
\[\begin{split}data\_mean[i] = mean(data[:,i,:,...]) \\
data\_var[i] = var(data[:,i,:,...])\end{split}\]</div>
<p>Then compute the normalized output, which has the same shape as input, as following:</p>
<div class="math">
\[out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]\]</div>
<p>Both <em>mean</em> and <em>var</em> returns a scalar by treating the input as a vector.</p>
<p>Assume the input has size <em>k</em> on axis 1, then both <code class="docutils literal"><span class="pre">gamma</span></code> and <code class="docutils literal"><span class="pre">beta</span></code>
have shape <em>(k,)</em>. If <code class="docutils literal"><span class="pre">output_mean_var</span></code> is set to be true, then outputs both <code class="docutils literal"><span class="pre">data_mean</span></code> and
<code class="docutils literal"><span class="pre">data_var</span></code> as well, which are needed for the backward pass.</p>
<p>Besides the inputs and the outputs, this operator accepts two auxiliary
states, <code class="docutils literal"><span class="pre">moving_mean</span></code> and <code class="docutils literal"><span class="pre">moving_var</span></code>, which are <em>k</em>-length
vectors. They are global statistics for the whole dataset, which are updated
by:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">moving_mean</span> <span class="o">=</span> <span class="n">moving_mean</span> <span class="o">*</span> <span class="n">momentum</span> <span class="o">+</span> <span class="n">data_mean</span> <span class="o">*</span> <span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="n">momentum</span><span class="p">)</span>
<span class="n">moving_var</span> <span class="o">=</span> <span class="n">moving_var</span> <span class="o">*</span> <span class="n">momentum</span> <span class="o">+</span> <span class="n">data_var</span> <span class="o">*</span> <span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="n">momentum</span><span class="p">)</span>
</pre></div>
</div>
<p>If <code class="docutils literal"><span class="pre">use_global_stats</span></code> is set to be true, then <code class="docutils literal"><span class="pre">moving_mean</span></code> and
<code class="docutils literal"><span class="pre">moving_var</span></code> are used instead of <code class="docutils literal"><span class="pre">data_mean</span></code> and <code class="docutils literal"><span class="pre">data_var</span></code> to compute
the output. It is often used during inference.</p>
<p>Both <code class="docutils literal"><span class="pre">gamma</span></code> and <code class="docutils literal"><span class="pre">beta</span></code> are learnable parameters. But if <code class="docutils literal"><span class="pre">fix_gamma</span></code> is true,
then set <code class="docutils literal"><span class="pre">gamma</span></code> to 1 and its gradient to 0.</p>
<dl class="docutils">
<dt>Reference:</dt>
<dd><table class="first docutils footnote" frame="void" id="id5" rules="none">
<colgroup><col class="label"/><col/></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id3">[1]</a></td><td>Ioffe, Sergey, and Christian Szegedy. “Batch normalization: Accelerating deep network training by reducing internal covariate shift.” <em>ICML 2015</em></td></tr>
</tbody>
</table>
<table class="last docutils footnote" frame="void" id="id6" rules="none">
<colgroup><col class="label"/><col/></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id4">[2]</a></td><td>Hang Zhang, Kristin Dana, Jianping Shi, Zhongyue Zhang, Xiaogang Wang, Ambrish Tyagi, and Amit Agrawal. “Context Encoding for Semantic Segmentation.” <em>CVPR 2018</em></td></tr>
</tbody>
</table>
</dd>
</dl>
<p>Defined in src/operator/contrib/sync_batch_norm.cc:L97</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data to batch normalization</li>
<li><strong>gamma</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – gamma array</li>
<li><strong>beta</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – beta array</li>
<li><strong>moving_mean</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – running mean of input</li>
<li><strong>moving_var</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – running variance of input</li>
<li><strong>eps</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0.001</em>) – Epsilon to prevent div 0</li>
<li><strong>momentum</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0.9</em>) – Momentum for moving average</li>
<li><strong>fix_gamma</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=1</em>) – Fix gamma while training</li>
<li><strong>use_global_stats</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Whether use global moving statistics instead of local batch-norm. This will force change batch-norm into a scale shift operator.</li>
<li><strong>output_mean_var</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Output All,normal mean and var</li>
<li><strong>ndev</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='1'</em>) – The count of GPU devices</li>
<li><strong>key</strong> (<em>string</em><em>, </em><em>optional</em><em>, </em><em>default=''</em>) – Hash key for synchronization, please set the same hash key for same layer, Block.prefix is typically used as in <code class="xref py py-class docutils literal"><span class="pre">gluon.nn.contrib.SyncBatchNorm</span></code>.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.backward_quadratic">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">backward_quadratic</code><span class="sig-paren">(</span><em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.backward_quadratic" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The result symbol.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.bipartite_matching">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">bipartite_matching</code><span class="sig-paren">(</span><em>data=None</em>, <em>is_ascend=_Null</em>, <em>threshold=_Null</em>, <em>topk=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.bipartite_matching" title="Permalink to this definition"></a></dt>
<dd><dl class="docutils">
<dt>Compute bipartite matching.</dt>
<dd><p class="first">The matching is performed on score matrix with shape [B, N, M]
- B: batch_size
- N: number of rows to match
- M: number of columns as reference to be matched against.</p>
<p>Returns:
x : matched column indices. -1 indicating non-matched elements in rows.
y : matched row indices.</p>
<p>Note:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">Zero</span> <span class="n">gradients</span> <span class="n">are</span> <span class="n">back</span><span class="o">-</span><span class="n">propagated</span> <span class="ow">in</span> <span class="n">this</span> <span class="n">op</span> <span class="k">for</span> <span class="n">now</span><span class="o">.</span>
</pre></div>
</div>
<p>Example:</p>
<div class="last highlight-default"><div class="highlight"><pre><span></span><span class="n">s</span> <span class="o">=</span> <span class="p">[[</span><span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.6</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">]]</span>
<span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">bipartite_matching</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">threshold</span><span class="o">=</span><span class="mf">1e-12</span><span class="p">,</span> <span class="n">is_ascend</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">x</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span>
<span class="n">y</span> <span class="o">=</span> <span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span>
</pre></div>
</div>
</dd>
</dl>
<p>Defined in src/operator/contrib/bounding_box.cc:L169</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The input</li>
<li><strong>is_ascend</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Use ascend order for scores instead of descending. Please set threshold accordingly.</li>
<li><strong>threshold</strong> (<em>float</em><em>, </em><em>required</em>) – Ignore matching when score < thresh, if is_ascend=false, or ignore score > thresh, if is_ascend=true.</li>
<li><strong>topk</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='-1'</em>) – Limit the number of matches to topk, set -1 for no limit</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.box_iou">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">box_iou</code><span class="sig-paren">(</span><em>lhs=None</em>, <em>rhs=None</em>, <em>format=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.box_iou" title="Permalink to this definition"></a></dt>
<dd><dl class="docutils">
<dt>Bounding box overlap of two arrays.</dt>
<dd><p class="first">The overlap is defined as Intersection-over-Union, aka, IOU.
- lhs: (a_1, a_2, ..., a_n, 4) array
- rhs: (b_1, b_2, ..., b_n, 4) array
- output: (a_1, a_2, ..., a_n, b_1, b_2, ..., b_n) array</p>
<p>Note:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">Zero</span> <span class="n">gradients</span> <span class="n">are</span> <span class="n">back</span><span class="o">-</span><span class="n">propagated</span> <span class="ow">in</span> <span class="n">this</span> <span class="n">op</span> <span class="k">for</span> <span class="n">now</span><span class="o">.</span>
</pre></div>
</div>
<p>Example:</p>
<div class="last highlight-default"><div class="highlight"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="p">[[</span><span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">]]</span>
<span class="n">y</span> <span class="o">=</span> <span class="p">[[</span><span class="mf">0.25</span><span class="p">,</span> <span class="mf">0.25</span><span class="p">,</span> <span class="mf">0.75</span><span class="p">,</span> <span class="mf">0.75</span><span class="p">]]</span>
<span class="n">box_iou</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="s1">'corner'</span><span class="p">)</span> <span class="o">=</span> <span class="p">[[</span><span class="mf">0.1428</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.1428</span><span class="p">]]</span>
</pre></div>
</div>
</dd>
</dl>
<p>Defined in src/operator/contrib/bounding_box.cc:L123</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>lhs</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The first input</li>
<li><strong>rhs</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The second input</li>
<li><strong>format</strong> (<em>{'center'</em><em>, </em><em>'corner'}</em><em>,</em><em>optional</em><em>, </em><em>default='corner'</em>) – The box encoding type.
“corner” means boxes are encoded as [xmin, ymin, xmax, ymax], “center” means boxes are encodes as [x, y, width, height].</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.box_nms">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">box_nms</code><span class="sig-paren">(</span><em>data=None</em>, <em>overlap_thresh=_Null</em>, <em>valid_thresh=_Null</em>, <em>topk=_Null</em>, <em>coord_start=_Null</em>, <em>score_index=_Null</em>, <em>id_index=_Null</em>, <em>force_suppress=_Null</em>, <em>in_format=_Null</em>, <em>out_format=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.box_nms" title="Permalink to this definition"></a></dt>
<dd><p>Apply non-maximum suppression to input.</p>
<p>The output will be sorted in descending order according to <cite>score</cite>. Boxes with
overlaps larger than <cite>overlap_thresh</cite> and smaller scores will be removed and
filled with -1, the corresponding position will be recorded for backward propogation.</p>
<p>During back-propagation, the gradient will be copied to the original
position according to the input index. For positions that have been suppressed,
the in_grad will be assigned 0.
In summary, gradients are sticked to its boxes, will either be moved or discarded
according to its original index in input.</p>
<p>Input requirements:
1. Input tensor have at least 2 dimensions, (n, k), any higher dims will be regarded
as batch, e.g. (a, b, c, d, n, k) == (a*b*c*d, n, k)
2. n is the number of boxes in each batch
3. k is the width of each box item.</p>
<p>By default, a box is [id, score, xmin, ymin, xmax, ymax, ...],
additional elements are allowed.
- <cite>id_index</cite>: optional, use -1 to ignore, useful if <cite>force_suppress=False</cite>, which means
we will skip highly overlapped boxes if one is <cite>apple</cite> while the other is <cite>car</cite>.
- <cite>coord_start</cite>: required, default=2, the starting index of the 4 coordinates.
Two formats are supported:</p>
<blockquote>
<div><cite>corner</cite>: [xmin, ymin, xmax, ymax]
<cite>center</cite>: [x, y, width, height]</div></blockquote>
<ul class="simple">
<li><cite>score_index</cite>: required, default=1, box score/confidence.</li>
</ul>
<p>When two boxes overlap IOU > <cite>overlap_thresh</cite>, the one with smaller score will be suppressed.
- <cite>in_format</cite> and <cite>out_format</cite>: default=’corner’, specify in/out box formats.</p>
<p>Examples:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="p">[[</span><span class="mi">0</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">],</span>
<span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.14</span><span class="p">,</span> <span class="mf">0.14</span><span class="p">],</span> <span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mf">0.6</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.7</span><span class="p">,</span> <span class="mf">0.8</span><span class="p">]]</span>
<span class="n">box_nms</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">overlap_thresh</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">coord_start</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">score_index</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">id_index</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
<span class="n">force_suppress</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">in_format</span><span class="o">=</span><span class="s1">'corner'</span><span class="p">,</span> <span class="n">out_typ</span><span class="o">=</span><span class="s1">'corner'</span><span class="p">)</span> <span class="o">=</span>
<span class="p">[[</span><span class="mi">2</span><span class="p">,</span> <span class="mf">0.6</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.7</span><span class="p">,</span> <span class="mf">0.8</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">],</span>
<span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">]]</span>
<span class="n">out_grad</span> <span class="o">=</span> <span class="p">[[</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">],</span>
<span class="p">[</span><span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">]]</span>
<span class="c1"># exe.backward</span>
<span class="n">in_grad</span> <span class="o">=</span> <span class="p">[[</span><span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span>
<span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">]]</span>
</pre></div>
</div>
<p>Defined in src/operator/contrib/bounding_box.cc:L82</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The input</li>
<li><strong>overlap_thresh</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0.5</em>) – Overlapping(IoU) threshold to suppress object with smaller score.</li>
<li><strong>valid_thresh</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Filter input boxes to those whose scores greater than valid_thresh.</li>
<li><strong>topk</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='-1'</em>) – Apply nms to topk boxes with descending scores, -1 to no restriction.</li>
<li><strong>coord_start</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='2'</em>) – Start index of the consecutive 4 coordinates.</li>
<li><strong>score_index</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='1'</em>) – Index of the scores/confidence of boxes.</li>
<li><strong>id_index</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='-1'</em>) – Optional, index of the class categories, -1 to disable.</li>
<li><strong>force_suppress</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Optional, if set false and id_index is provided, nms will only apply to boxes belongs to the same category</li>
<li><strong>in_format</strong> (<em>{'center'</em><em>, </em><em>'corner'}</em><em>,</em><em>optional</em><em>, </em><em>default='corner'</em>) – The input box encoding type.
“corner” means boxes are encoded as [xmin, ymin, xmax, ymax], “center” means boxes are encodes as [x, y, width, height].</li>
<li><strong>out_format</strong> (<em>{'center'</em><em>, </em><em>'corner'}</em><em>,</em><em>optional</em><em>, </em><em>default='corner'</em>) – The output box encoding type.
“corner” means boxes are encoded as [xmin, ymin, xmax, ymax], “center” means boxes are encodes as [x, y, width, height].</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.box_non_maximum_suppression">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">box_non_maximum_suppression</code><span class="sig-paren">(</span><em>data=None</em>, <em>overlap_thresh=_Null</em>, <em>valid_thresh=_Null</em>, <em>topk=_Null</em>, <em>coord_start=_Null</em>, <em>score_index=_Null</em>, <em>id_index=_Null</em>, <em>force_suppress=_Null</em>, <em>in_format=_Null</em>, <em>out_format=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.box_non_maximum_suppression" title="Permalink to this definition"></a></dt>
<dd><p>Apply non-maximum suppression to input.</p>
<p>The output will be sorted in descending order according to <cite>score</cite>. Boxes with
overlaps larger than <cite>overlap_thresh</cite> and smaller scores will be removed and
filled with -1, the corresponding position will be recorded for backward propogation.</p>
<p>During back-propagation, the gradient will be copied to the original
position according to the input index. For positions that have been suppressed,
the in_grad will be assigned 0.
In summary, gradients are sticked to its boxes, will either be moved or discarded
according to its original index in input.</p>
<p>Input requirements:
1. Input tensor have at least 2 dimensions, (n, k), any higher dims will be regarded
as batch, e.g. (a, b, c, d, n, k) == (a*b*c*d, n, k)
2. n is the number of boxes in each batch
3. k is the width of each box item.</p>
<p>By default, a box is [id, score, xmin, ymin, xmax, ymax, ...],
additional elements are allowed.
- <cite>id_index</cite>: optional, use -1 to ignore, useful if <cite>force_suppress=False</cite>, which means
we will skip highly overlapped boxes if one is <cite>apple</cite> while the other is <cite>car</cite>.
- <cite>coord_start</cite>: required, default=2, the starting index of the 4 coordinates.
Two formats are supported:</p>
<blockquote>
<div><cite>corner</cite>: [xmin, ymin, xmax, ymax]
<cite>center</cite>: [x, y, width, height]</div></blockquote>
<ul class="simple">
<li><cite>score_index</cite>: required, default=1, box score/confidence.</li>
</ul>
<p>When two boxes overlap IOU > <cite>overlap_thresh</cite>, the one with smaller score will be suppressed.
- <cite>in_format</cite> and <cite>out_format</cite>: default=’corner’, specify in/out box formats.</p>
<p>Examples:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="p">[[</span><span class="mi">0</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">],</span>
<span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.14</span><span class="p">,</span> <span class="mf">0.14</span><span class="p">],</span> <span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mf">0.6</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.7</span><span class="p">,</span> <span class="mf">0.8</span><span class="p">]]</span>
<span class="n">box_nms</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">overlap_thresh</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">coord_start</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">score_index</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">id_index</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
<span class="n">force_suppress</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">in_format</span><span class="o">=</span><span class="s1">'corner'</span><span class="p">,</span> <span class="n">out_typ</span><span class="o">=</span><span class="s1">'corner'</span><span class="p">)</span> <span class="o">=</span>
<span class="p">[[</span><span class="mi">2</span><span class="p">,</span> <span class="mf">0.6</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.7</span><span class="p">,</span> <span class="mf">0.8</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">],</span>
<span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">]]</span>
<span class="n">out_grad</span> <span class="o">=</span> <span class="p">[[</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">],</span>
<span class="p">[</span><span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">]]</span>
<span class="c1"># exe.backward</span>
<span class="n">in_grad</span> <span class="o">=</span> <span class="p">[[</span><span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">,</span> <span class="mf">0.2</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span>
<span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">]]</span>
</pre></div>
</div>
<p>Defined in src/operator/contrib/bounding_box.cc:L82</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The input</li>
<li><strong>overlap_thresh</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0.5</em>) – Overlapping(IoU) threshold to suppress object with smaller score.</li>
<li><strong>valid_thresh</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Filter input boxes to those whose scores greater than valid_thresh.</li>
<li><strong>topk</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='-1'</em>) – Apply nms to topk boxes with descending scores, -1 to no restriction.</li>
<li><strong>coord_start</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='2'</em>) – Start index of the consecutive 4 coordinates.</li>
<li><strong>score_index</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='1'</em>) – Index of the scores/confidence of boxes.</li>
<li><strong>id_index</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='-1'</em>) – Optional, index of the class categories, -1 to disable.</li>
<li><strong>force_suppress</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Optional, if set false and id_index is provided, nms will only apply to boxes belongs to the same category</li>
<li><strong>in_format</strong> (<em>{'center'</em><em>, </em><em>'corner'}</em><em>,</em><em>optional</em><em>, </em><em>default='corner'</em>) – The input box encoding type.
“corner” means boxes are encoded as [xmin, ymin, xmax, ymax], “center” means boxes are encodes as [x, y, width, height].</li>
<li><strong>out_format</strong> (<em>{'center'</em><em>, </em><em>'corner'}</em><em>,</em><em>optional</em><em>, </em><em>default='corner'</em>) – The output box encoding type.
“corner” means boxes are encoded as [xmin, ymin, xmax, ymax], “center” means boxes are encodes as [x, y, width, height].</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.count_sketch">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">count_sketch</code><span class="sig-paren">(</span><em>data=None</em>, <em>h=None</em>, <em>s=None</em>, <em>out_dim=_Null</em>, <em>processing_batch_size=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.count_sketch" title="Permalink to this definition"></a></dt>
<dd><p>Apply CountSketch to input: map a d-dimension data to k-dimension data”</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><cite>count_sketch</cite> is only available on GPU.</p>
</div>
<p>Assume input data has shape (N, d), sign hash table s has shape (N, d),
index hash table h has shape (N, d) and mapping dimension out_dim = k,
each element in s is either +1 or -1, each element in h is random integer from 0 to k-1.
Then the operator computs:</p>
<div class="math">
\[out[h[i]] += data[i] * s[i]\]</div>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">out_dim</span> <span class="o">=</span> <span class="mi">5</span>
<span class="n">x</span> <span class="o">=</span> <span class="p">[[</span><span class="mf">1.2</span><span class="p">,</span> <span class="mf">2.5</span><span class="p">,</span> <span class="mf">3.4</span><span class="p">],[</span><span class="mf">3.2</span><span class="p">,</span> <span class="mf">5.7</span><span class="p">,</span> <span class="mf">6.6</span><span class="p">]]</span>
<span class="n">h</span> <span class="o">=</span> <span class="p">[[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">]]</span>
<span class="n">s</span> <span class="o">=</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">]]</span>
<span class="n">mx</span><span class="o">.</span><span class="n">contrib</span><span class="o">.</span><span class="n">ndarray</span><span class="o">.</span><span class="n">count_sketch</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">x</span><span class="p">,</span> <span class="n">h</span><span class="o">=</span><span class="n">h</span><span class="p">,</span> <span class="n">s</span><span class="o">=</span><span class="n">s</span><span class="p">,</span> <span class="n">out_dim</span> <span class="o">=</span> <span class="mi">5</span><span class="p">)</span> <span class="o">=</span> <span class="p">[[</span><span class="mf">1.2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mf">2.5</span><span class="p">,</span> <span class="mf">3.4</span><span class="p">],</span>
<span class="p">[</span><span class="mf">3.2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mf">5.7</span><span class="p">,</span> <span class="mf">6.6</span><span class="p">]]</span>
</pre></div>
</div>
<p>Defined in src/operator/contrib/count_sketch.cc:L67</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data to the CountSketchOp.</li>
<li><strong>h</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The index vector</li>
<li><strong>s</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The sign vector</li>
<li><strong>out_dim</strong> (<em>int</em><em>, </em><em>required</em>) – The output dimension.</li>
<li><strong>processing_batch_size</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='32'</em>) – How many sketch vectors to process at one time.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.ctc_loss">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">ctc_loss</code><span class="sig-paren">(</span><em>data=None</em>, <em>label=None</em>, <em>data_lengths=None</em>, <em>label_lengths=None</em>, <em>use_data_lengths=_Null</em>, <em>use_label_lengths=_Null</em>, <em>blank_label=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.ctc_loss" title="Permalink to this definition"></a></dt>
<dd><p>Connectionist Temporal Classification Loss.</p>
<p>The shapes of the inputs and outputs:</p>
<ul class="simple">
<li><strong>data</strong>: <cite>(sequence_length, batch_size, alphabet_size)</cite></li>
<li><strong>label</strong>: <cite>(batch_size, label_sequence_length)</cite></li>
<li><strong>out</strong>: <cite>(batch_size)</cite></li>
</ul>
<p>The <cite>data</cite> tensor consists of sequences of activation vectors (without applying softmax),
with i-th channel in the last dimension corresponding to i-th label
for i between 0 and alphabet_size-1 (i.e always 0-indexed).
Alphabet size should include one additional value reserved for blank label.
When <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"first"</span></code>, the <code class="docutils literal"><span class="pre">0</span></code>-th channel is be reserved for
activation of blank label, or otherwise if it is “last”, <code class="docutils literal"><span class="pre">(alphabet_size-1)</span></code>-th channel should be
reserved for blank label.</p>
<p><code class="docutils literal"><span class="pre">label</span></code> is an index matrix of integers. When <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"first"</span></code>,
the value 0 is then reserved for blank label, and should not be passed in this matrix. Otherwise,
when <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"last"</span></code>, the value <cite>(alphabet_size-1)</cite> is reserved for blank label.</p>
<p>If a sequence of labels is shorter than <em>label_sequence_length</em>, use the special
padding value at the end of the sequence to conform it to the correct
length. The padding value is <cite>0</cite> when <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"first"</span></code>, and <cite>-1</cite> otherwise.</p>
<p>For example, suppose the vocabulary is <cite>[a, b, c]</cite>, and in one batch we have three sequences
‘ba’, ‘cbb’, and ‘abac’. When <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"first"</span></code>, we can index the labels as
<cite>{‘a’: 1, ‘b’: 2, ‘c’: 3}</cite>, and we reserve the 0-th channel for blank label in data tensor.
The resulting <cite>label</cite> tensor should be padded to be:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">]]</span>
</pre></div>
</div>
<p>When <cite>blank_label</cite> is <code class="docutils literal"><span class="pre">"last"</span></code>, we can index the labels as
<cite>{‘a’: 0, ‘b’: 1, ‘c’: 2}</cite>, and we reserve the channel index 3 for blank label in data tensor.
The resulting <cite>label</cite> tensor should be padded to be:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">]]</span>
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">out</span></code> is a list of CTC loss values, one per example in the batch.</p>
<p>See <em>Connectionist Temporal Classification: Labelling Unsegmented
Sequence Data with Recurrent Neural Networks</em>, A. Graves <em>et al</em>. for more
information on the definition and the algorithm.</p>
<p>Defined in src/operator/contrib/ctc_loss.cc:L115</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data to the ctc_loss op.</li>
<li><strong>label</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Ground-truth labels for the loss.</li>
<li><strong>data_lengths</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Lengths of data for each of the samples. Only required when use_data_lengths is true.</li>
<li><strong>label_lengths</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Lengths of labels for each of the samples. Only required when use_label_lengths is true.</li>
<li><strong>use_data_lengths</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Whether the data lenghts are decided by <cite>data_lengths</cite>. If false, the lengths are equal to the max sequence length.</li>
<li><strong>use_label_lengths</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Whether the label lenghts are decided by <cite>label_lengths</cite>, or derived from <cite>padding_mask</cite>. If false, the lengths are derived from the first occurrence of the value of <cite>padding_mask</cite>. The value of <cite>padding_mask</cite> is <code class="docutils literal"><span class="pre">0</span></code> when first CTC label is reserved for blank, and <code class="docutils literal"><span class="pre">-1</span></code> when last label is reserved for blank. See <cite>blank_label</cite>.</li>
<li><strong>blank_label</strong> (<em>{'first'</em><em>, </em><em>'last'}</em><em>,</em><em>optional</em><em>, </em><em>default='first'</em>) – Set the label that is reserved for blank label.If “first”, 0-th label is reserved, and label values for tokens in the vocabulary are between <code class="docutils literal"><span class="pre">1</span></code> and <code class="docutils literal"><span class="pre">alphabet_size-1</span></code>, and the padding mask is <code class="docutils literal"><span class="pre">-1</span></code>. If “last”, last label value <code class="docutils literal"><span class="pre">alphabet_size-1</span></code> is reserved for blank label instead, and label values for tokens in the vocabulary are between <code class="docutils literal"><span class="pre">0</span></code> and <code class="docutils literal"><span class="pre">alphabet_size-2</span></code>, and the padding mask is <code class="docutils literal"><span class="pre">0</span></code>.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.dequantize">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">dequantize</code><span class="sig-paren">(</span><em>data=None</em>, <em>min_range=None</em>, <em>max_range=None</em>, <em>out_type=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.dequantize" title="Permalink to this definition"></a></dt>
<dd><p>Dequantize the input tensor into a float tensor.
min_range and max_range are scalar floats that specify the range for
the output data.</p>
<p>When input data type is <cite>uint8</cite>, the output is calculated using the following equation:</p>
<p><cite>out[i] = in[i] * (max_range - min_range) / 255.0</cite>,</p>
<p>When input data type is <cite>int8</cite>, the output is calculate using the following equation
by keep zero centered for the quantized value:</p>
<p><cite>out[i] = in[i] * MaxAbs(min_range, max_range) / 127.0</cite>,</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This operator only supports forward propogation. DO NOT use it in training.</p>
</div>
<p>Defined in src/operator/quantization/dequantize.cc:L67</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – A ndarray/symbol of type <cite>uint8</cite></li>
<li><strong>min_range</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The minimum scalar value possibly produced for the input in float32</li>
<li><strong>max_range</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The maximum scalar value possibly produced for the input in float32</li>
<li><strong>out_type</strong> (<em>{'float32'}</em><em>,</em><em>optional</em><em>, </em><em>default='float32'</em>) – Output data type.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.div_sqrt_dim">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">div_sqrt_dim</code><span class="sig-paren">(</span><em>data=None</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.div_sqrt_dim" title="Permalink to this definition"></a></dt>
<dd><p>Rescale the input by the square root of the channel dimension.</p>
<blockquote>
<div>out = data / sqrt(data.shape[-1])</div></blockquote>
<p>Defined in src/operator/contrib/transformer.cc:L38</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The input array.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.fft">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">fft</code><span class="sig-paren">(</span><em>data=None</em>, <em>compute_size=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.fft" title="Permalink to this definition"></a></dt>
<dd><p>Apply 1D FFT to input”</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><cite>fft</cite> is only available on GPU.</p>
</div>
<p>Currently accept 2 input data shapes: (N, d) or (N1, N2, N3, d), data can only be real numbers.
The output data has shape: (N, 2*d) or (N1, N2, N3, 2*d). The format is: [real0, imag0, real1, imag1, ...].</p>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">normal</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,(</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">))</span>
<span class="n">out</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">contrib</span><span class="o">.</span><span class="n">ndarray</span><span class="o">.</span><span class="n">fft</span><span class="p">(</span><span class="n">data</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">nd</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">data</span><span class="p">,</span><span class="n">ctx</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">gpu</span><span class="p">(</span><span class="mi">0</span><span class="p">)))</span>
</pre></div>
</div>
<p>Defined in src/operator/contrib/fft.cc:L56</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data to the FFTOp.</li>
<li><strong>compute_size</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='128'</em>) – Maximum size of sub-batch to be forwarded at one time</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.ifft">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">ifft</code><span class="sig-paren">(</span><em>data=None</em>, <em>compute_size=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.ifft" title="Permalink to this definition"></a></dt>
<dd><p>Apply 1D ifft to input”</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><cite>ifft</cite> is only available on GPU.</p>
</div>
<p>Currently accept 2 input data shapes: (N, d) or (N1, N2, N3, d). Data is in format: [real0, imag0, real1, imag1, ...].
Last dimension must be an even number.
The output data has shape: (N, d/2) or (N1, N2, N3, d/2). It is only the real part of the result.</p>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">normal</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,(</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">))</span>
<span class="n">out</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">contrib</span><span class="o">.</span><span class="n">ndarray</span><span class="o">.</span><span class="n">ifft</span><span class="p">(</span><span class="n">data</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">nd</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">data</span><span class="p">,</span><span class="n">ctx</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">gpu</span><span class="p">(</span><span class="mi">0</span><span class="p">)))</span>
</pre></div>
</div>
<p>Defined in src/operator/contrib/ifft.cc:L58</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data to the IFFTOp.</li>
<li><strong>compute_size</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>default='128'</em>) – Maximum size of sub-batch to be forwarded at one time</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.quadratic">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">quadratic</code><span class="sig-paren">(</span><em>data=None</em>, <em>a=_Null</em>, <em>b=_Null</em>, <em>c=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.quadratic" title="Permalink to this definition"></a></dt>
<dd><p>This operators implements the quadratic function:
.. math:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">f</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">=</span> <span class="n">ax</span><span class="o">^</span><span class="mi">2</span><span class="o">+</span><span class="n">bx</span><span class="o">+</span><span class="n">c</span>
</pre></div>
</div>
<p>where <span class="math">\(x\)</span> is an input tensor and all operations
in the function are element-wise.
Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="p">[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">],</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">]]</span>
<span class="n">y</span> <span class="o">=</span> <span class="n">quadratic</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="n">y</span> <span class="o">=</span> <span class="p">[[</span><span class="mi">6</span><span class="p">,</span> <span class="mi">11</span><span class="p">],</span> <span class="p">[</span><span class="mi">18</span><span class="p">,</span> <span class="mi">27</span><span class="p">]]</span>
</pre></div>
</div>
<dl class="docutils">
<dt>The storage type of <code class="docutils literal"><span class="pre">quadratic</span></code> output depends on storage types of inputs</dt>
<dd><ul class="first last simple">
<li>quadratic(csr, a, b, 0) = csr</li>
<li>quadratic(default, a, b, c) = default</li>
</ul>
</dd>
</dl>
<p>Defined in src/operator/contrib/quadratic_op.cc:L46</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input ndarray</li>
<li><strong>a</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Coefficient of the quadratic term in the quadratic function.</li>
<li><strong>b</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Coefficient of the linear term in the quadratic function.</li>
<li><strong>c</strong> (<em>float</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Constant term in the quadratic function.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.quantize">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">quantize</code><span class="sig-paren">(</span><em>data=None</em>, <em>min_range=None</em>, <em>max_range=None</em>, <em>out_type=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.quantize" title="Permalink to this definition"></a></dt>
<dd><p>Quantize a input tensor from float to <cite>out_type</cite>,
with user-specified <cite>min_range</cite> and <cite>max_range</cite>.</p>
<p>min_range and max_range are scalar floats that specify the range for
the input data.</p>
<p>When out_type is <cite>uint8</cite>, the output is calculated using the following equation:</p>
<p><cite>out[i] = (in[i] - min_range) * range(OUTPUT_TYPE) / (max_range - min_range) + 0.5</cite>,</p>
<p>where <cite>range(T) = numeric_limits<T>::max() - numeric_limits<T>::min()</cite>.</p>
<p>When out_type is <cite>int8</cite>, the output is calculate using the following equation
by keep zero centered for the quantized value:</p>
<p><cite>out[i] = sign(in[i]) * min(abs(in[i] * scale + 0.5f, quantized_range)</cite>,</p>
<p>where
<cite>quantized_range = MinAbs(max(int8), min(int8))</cite> and
<cite>scale = quantized_range / MaxAbs(min_range, max_range).</cite></p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This operator only supports forward propogation. DO NOT use it in training.</p>
</div>
<p>Defined in src/operator/quantization/quantize.cc:L74</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – A ndarray/symbol of type <cite>float32</cite></li>
<li><strong>min_range</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The minimum scalar value possibly produced for the input</li>
<li><strong>max_range</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The maximum scalar value possibly produced for the input</li>
<li><strong>out_type</strong> (<em>{'int8'</em><em>, </em><em>'uint8'}</em><em>,</em><em>optional</em><em>, </em><em>default='uint8'</em>) – Output data type.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.quantized_conv">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">quantized_conv</code><span class="sig-paren">(</span><em>data=None</em>, <em>weight=None</em>, <em>bias=None</em>, <em>min_data=None</em>, <em>max_data=None</em>, <em>min_weight=None</em>, <em>max_weight=None</em>, <em>min_bias=None</em>, <em>max_bias=None</em>, <em>kernel=_Null</em>, <em>stride=_Null</em>, <em>dilate=_Null</em>, <em>pad=_Null</em>, <em>num_filter=_Null</em>, <em>num_group=_Null</em>, <em>workspace=_Null</em>, <em>no_bias=_Null</em>, <em>cudnn_tune=_Null</em>, <em>cudnn_off=_Null</em>, <em>layout=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.quantized_conv" title="Permalink to this definition"></a></dt>
<dd><p>Convolution operator for input, weight and bias data type of int8,
and accumulates in type int32 for the output. For each argument, two more arguments of type
float32 must be provided representing the thresholds of quantizing argument from data
type float32 to int8. The final outputs contain the convolution result in int32, and min
and max thresholds representing the threholds for quantizing the float32 output into int32.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This operator only supports forward propogation. DO NOT use it in training.</p>
</div>
<p>Defined in src/operator/quantization/quantized_conv.cc:L137</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data.</li>
<li><strong>weight</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – weight.</li>
<li><strong>bias</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – bias.</li>
<li><strong>min_data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Minimum value of data.</li>
<li><strong>max_data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Maximum value of data.</li>
<li><strong>min_weight</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Minimum value of weight.</li>
<li><strong>max_weight</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Maximum value of weight.</li>
<li><strong>min_bias</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Minimum value of bias.</li>
<li><strong>max_bias</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Maximum value of bias.</li>
<li><strong>kernel</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>required</em>) – Convolution kernel size: (w,), (h, w) or (d, h, w)</li>
<li><strong>stride</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>]</em>) – Convolution stride: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension.</li>
<li><strong>dilate</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>]</em>) – Convolution dilate: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension.</li>
<li><strong>pad</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>]</em>) – Zero pad for convolution: (w,), (h, w) or (d, h, w). Defaults to no padding.</li>
<li><strong>num_filter</strong> (<em>int</em><em> (</em><em>non-negative</em><em>)</em><em>, </em><em>required</em>) – Convolution filter(channel) number</li>
<li><strong>num_group</strong> (<em>int</em><em> (</em><em>non-negative</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=1</em>) – Number of group partitions.</li>
<li><strong>workspace</strong> (<em>long</em><em> (</em><em>non-negative</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=1024</em>) – Maximum temporary workspace allowed (MB) in convolution.This parameter has two usages. When CUDNN is not used, it determines the effective batch size of the convolution kernel. When CUDNN is used, it controls the maximum temporary storage used for tuning the best CUDNN kernel when <cite>limited_workspace</cite> strategy is used.</li>
<li><strong>no_bias</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Whether to disable bias parameter.</li>
<li><strong>cudnn_tune</strong> (<em>{None</em><em>, </em><em>'fastest'</em><em>, </em><em>'limited_workspace'</em><em>, </em><em>'off'}</em><em>,</em><em>optional</em><em>, </em><em>default='None'</em>) – Whether to pick convolution algo by running performance test.</li>
<li><strong>cudnn_off</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Turn off cudnn for this layer.</li>
<li><strong>layout</strong> (<em>{None</em><em>, </em><em>'NCDHW'</em><em>, </em><em>'NCHW'</em><em>, </em><em>'NCW'</em><em>, </em><em>'NDHWC'</em><em>, </em><em>'NHWC'}</em><em>,</em><em>optional</em><em>, </em><em>default='None'</em>) – Set layout for input, output and weight. Empty for
default layout: NCW for 1d, NCHW for 2d and NCDHW for 3d.NHWC and NDHWC are only supported on GPU.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.quantized_flatten">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">quantized_flatten</code><span class="sig-paren">(</span><em>data=None</em>, <em>min_data=None</em>, <em>max_data=None</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.quantized_flatten" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – A ndarray/symbol of type <cite>float32</cite></li>
<li><strong>min_data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The minimum scalar value possibly produced for the data</li>
<li><strong>max_data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The maximum scalar value possibly produced for the data</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.quantized_fully_connected">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">quantized_fully_connected</code><span class="sig-paren">(</span><em>data=None</em>, <em>weight=None</em>, <em>bias=None</em>, <em>min_data=None</em>, <em>max_data=None</em>, <em>min_weight=None</em>, <em>max_weight=None</em>, <em>min_bias=None</em>, <em>max_bias=None</em>, <em>num_hidden=_Null</em>, <em>no_bias=_Null</em>, <em>flatten=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.quantized_fully_connected" title="Permalink to this definition"></a></dt>
<dd><p>Fully Connected operator for input, weight and bias data type of int8,
and accumulates in type int32 for the output. For each argument, two more arguments of type
float32 must be provided representing the thresholds of quantizing argument from data
type float32 to int8. The final outputs contain the convolution result in int32, and min
and max thresholds representing the threholds for quantizing the float32 output into int32.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This operator only supports forward propogation. DO NOT use it in training.</p>
</div>
<p>Defined in src/operator/quantization/quantized_fully_connected.cc:L90</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data.</li>
<li><strong>weight</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – weight.</li>
<li><strong>bias</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – bias.</li>
<li><strong>min_data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Minimum value of data.</li>
<li><strong>max_data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Maximum value of data.</li>
<li><strong>min_weight</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Minimum value of weight.</li>
<li><strong>max_weight</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Maximum value of weight.</li>
<li><strong>min_bias</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Minimum value of bias.</li>
<li><strong>max_bias</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Maximum value of bias.</li>
<li><strong>num_hidden</strong> (<em>int</em><em>, </em><em>required</em>) – Number of hidden nodes of the output.</li>
<li><strong>no_bias</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Whether to disable bias parameter.</li>
<li><strong>flatten</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=1</em>) – Whether to collapse all but the first axis of the input data tensor.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.quantized_pooling">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">quantized_pooling</code><span class="sig-paren">(</span><em>data=None</em>, <em>min_data=None</em>, <em>max_data=None</em>, <em>kernel=_Null</em>, <em>pool_type=_Null</em>, <em>global_pool=_Null</em>, <em>cudnn_off=_Null</em>, <em>pooling_convention=_Null</em>, <em>stride=_Null</em>, <em>pad=_Null</em>, <em>p_value=_Null</em>, <em>count_include_pad=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.quantized_pooling" title="Permalink to this definition"></a></dt>
<dd><p>Pooling operator for input and output data type of int8.
The input and output data comes with min and max thresholds for quantizing
the float32 data into int8.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This operator only supports forward propogation. DO NOT use it in training.
This operator only supports <cite>pool_type</cite> of <cite>avg</cite> or <cite>max</cite>.</p>
</div>
<p>Defined in src/operator/quantization/quantized_pooling.cc:L129</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Input data.</li>
<li><strong>min_data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Minimum value of data.</li>
<li><strong>max_data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – Maximum value of data.</li>
<li><strong>kernel</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>]</em>) – Pooling kernel size: (y, x) or (d, y, x)</li>
<li><strong>pool_type</strong> (<em>{'avg'</em><em>, </em><em>'lp'</em><em>, </em><em>'max'</em><em>, </em><em>'sum'}</em><em>,</em><em>optional</em><em>, </em><em>default='max'</em>) – Pooling type to be applied.</li>
<li><strong>global_pool</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Ignore kernel size, do global pooling based on current input feature map.</li>
<li><strong>cudnn_off</strong> (<em>boolean</em><em>, </em><em>optional</em><em>, </em><em>default=0</em>) – Turn off cudnn pooling and use MXNet pooling operator.</li>
<li><strong>pooling_convention</strong> (<em>{'full'</em><em>, </em><em>'valid'}</em><em>,</em><em>optional</em><em>, </em><em>default='valid'</em>) – Pooling convention to be applied.</li>
<li><strong>stride</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>]</em>) – Stride: for pooling (y, x) or (d, y, x). Defaults to 1 for each dimension.</li>
<li><strong>pad</strong> (<em>Shape</em><em>(</em><em>tuple</em><em>)</em><em>, </em><em>optional</em><em>, </em><em>default=</em><em>[</em><em>]</em>) – Pad for pooling: (y, x) or (d, y, x). Defaults to no padding.</li>
<li><strong>p_value</strong> (<em>int</em><em> or </em><em>None</em><em>, </em><em>optional</em><em>, </em><em>default='None'</em>) – Value of p for Lp pooling, can be 1 or 2, required for Lp Pooling.</li>
<li><strong>count_include_pad</strong> (<em>boolean</em><em> or </em><em>None</em><em>, </em><em>optional</em><em>, </em><em>default=None</em>) – Only used for AvgPool, specify whether to count padding elements for averagecalculation. For example, with a 5*5 kernel on a 3*3 corner of a image,the sum of the 9 valid elements will be divided by 25 if this is set to true,or it will be divided by 9 if this is set to false. Defaults to true.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="mxnet.symbol.contrib.requantize">
<code class="descclassname">mxnet.symbol.contrib.</code><code class="descname">requantize</code><span class="sig-paren">(</span><em>data=None</em>, <em>min_range=None</em>, <em>max_range=None</em>, <em>min_calib_range=_Null</em>, <em>max_calib_range=_Null</em>, <em>name=None</em>, <em>attr=None</em>, <em>out=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.symbol.contrib.requantize" title="Permalink to this definition"></a></dt>
<dd><p>Given data that is quantized in int32 and the corresponding thresholds,
requantize the data into int8 using min and max thresholds either calculated at runtime
or from calibration. It’s highly recommended to pre-calucate the min and max thresholds
through calibration since it is able to save the runtime of the operator and improve the
inference accuracy.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This operator only supports forward propogation. DO NOT use it in training.</p>
</div>
<p>Defined in src/operator/quantization/requantize.cc:L60</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name"/>
<col class="field-body"/>
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – A ndarray/symbol of type <cite>int32</cite></li>
<li><strong>min_range</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The original minimum scalar value in the form of float32 used for quantizing data into int32.</li>
<li><strong>max_range</strong> (<a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol"><em>Symbol</em></a>) – The original maximum scalar value in the form of float32 used for quantizing data into int32.</li>
<li><strong>min_calib_range</strong> (<em>float</em><em> or </em><em>None</em><em>, </em><em>optional</em><em>, </em><em>default=None</em>) – The minimum scalar value in the form of float32 obtained through calibration. If present, it will be used to requantize the int32 data into int8.</li>
<li><strong>max_calib_range</strong> (<em>float</em><em> or </em><em>None</em><em>, </em><em>optional</em><em>, </em><em>default=None</em>) – The maximum scalar value in the form of float32 obtained through calibration. If present, it will be used to requantize the int32 data into int8.</li>
<li><strong>name</strong> (<em>string</em><em>, </em><em>optional.</em>) – Name of the resulting symbol.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The result symbol.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="symbol.html#mxnet.symbol.Symbol" title="mxnet.symbol.Symbol">Symbol</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<script>auto_index("api-reference");</script></div>
</div>
</div>
</div>
<div aria-label="main navigation" class="sphinxsidebar rightsidebar" role="navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../../../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Contrib Symbol API</a><ul>
<li><a class="reference internal" href="#overview">Overview</a></li>
<li><a class="reference internal" href="#contrib">Contrib</a></li>
<li><a class="reference internal" href="#api-reference">API Reference</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div><div class="footer">
<div class="section-disclaimer">
<div class="container">
<div>
<img height="60" src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/apache_incubator_logo.png"/>
<p>
Apache MXNet is an effort undergoing incubation at The Apache Software Foundation (ASF), <strong>sponsored by the <i>Apache Incubator</i></strong>. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
</p>
<p>
"Copyright © 2017-2018, The Apache Software Foundation
Apache MXNet, MXNet, Apache, the Apache feather, and the Apache MXNet project logo are either registered trademarks or trademarks of the Apache Software Foundation."
</p>
</div>
</div>
</div>
</div> <!-- pagename != index -->
</div>
<script crossorigin="anonymous" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="../../../_static/js/sidebar.js" type="text/javascript"></script>
<script src="../../../_static/js/search.js" type="text/javascript"></script>
<script src="../../../_static/js/navbar.js" type="text/javascript"></script>
<script src="../../../_static/js/clipboard.min.js" type="text/javascript"></script>
<script src="../../../_static/js/copycode.js" type="text/javascript"></script>
<script src="../../../_static/js/page.js" type="text/javascript"></script>
<script type="text/javascript">
$('body').ready(function () {
$('body').css('visibility', 'visible');
});
</script>
</body>
</html>