Skip to content

Commit

Permalink
generalized conv doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischoy committed Jan 29, 2020
1 parent e285f60 commit 5d8dbeb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MinkowskiEngine/SparseTensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class SparseTensor():
:attr:`MinkowskiEngine.SparseTensor`.
The :attr:`SparseTensor` class is the basic tensor in MinkowskiEngine. For
the definition of a sparse tensor, please visit `[the terminology page]
the definition of a sparse tensor, please visit `the terminology page
<https://stanfordvl.github.io/MinkowskiEngine/terminology.html#sparse-tensor>`_.
We use the COOrdinate (COO) format to save a sparse tensor `[1]
<http://groups.csail.mit.edu/commit/papers/2016/parker-thesis.pdf>`_. This
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The Minkowski Engine supports various functions that can be built on a sparse te
## Building a Neural Network on a Sparse Tensor

The Minkowski Engine provides APIs that allow users to build a neural network on a sparse tensor. Then, how dow we define convolution/pooling/transposed operations on a sparse tensor?
Visually, a convolution on a sparse tensor is similar to that on a dense tensor. However, on a sparse tensor, we compute convolution outputs on a few specified points. For more information, please visit [convolution on a sparse tensor](https://stanfordvl.github.io/MinkowskiEngine/convolution_on_sparse.html)
Visually, a convolution on a sparse tensor is similar to that on a dense tensor. However, on a sparse tensor, we compute convolution outputs on a few specified points. For more information, please visit [convolution on a sparse tensor](https://stanfordvl.github.io/MinkowskiEngine/convolution_on_sparse.html).

| Dense Tensor | Sparse Tensor |
|:-------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------:|
Expand Down
24 changes: 24 additions & 0 deletions docs/convolution_on_sparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ dense convolution. If we define the :math:`\mathcal{C}^\text{in}` and
.. |sparse| image:: images/conv_sparse.gif
:width: 100%

.. |sparse_conv| image:: images/conv_sparse_conv.gif
:width: 100%

.. |generalized| image:: images/conv_generalized.gif
:width: 100%


We visualize a simple 2D image convolution on a dense tensor and a sparse tensor. Note that the order of convolution on a sparse tensor is not sequential.

Expand All @@ -95,6 +101,24 @@ We visualize a simple 2D image convolution on a dense tensor and a sparse tensor
To efficiently compute the convolution on a sparse tensor, we must find how each non-zero element in an input sparse tensor is mapped to the output sparse tensor. We call this mapping a kernel map `[3] <https://arxiv.org/abs/1904.08755>`_ since it defines how an input is mapped to an output through a kernel. Please refer to the `terminology page <terminology.html>`_ for more details.


Extending the Sparse Convolution
--------------------------------

The generalized convolution extends the sparse convolution `[2] <https://arxiv.org/abs/1711.10275>`_. We visually summarized the difference on the following table. Compared with the sparse convolution, the generalized convolution relaxes the constraint on the output and allows the output sparse tensor to have a different sparsity pattern from the input. Secondly, the generalized convolution allows the convolution kernels to be located on arbitrary points, which is crucial for high-dimensional convolutional neural networks as hyper-cubic kernels require an exponentially large number of parameters as the dimension increases `[3] <https://arxiv.org/abs/1904.08755>`_.

+-------------------------+-------------------------+-------------------------+
| Sparse Convolution | Arbitrary input outputs | Generalized Convolution |
+-------------------------+-------------------------+-------------------------+
| |sparse_conv| | |sparse| | |generalized| |
+-------------------------+-------------------------+-------------------------+
| [Photo Credit: `Chris Choy <https://chrischoy.org>`_] |
+-----------------------------------------------------------------------------+

- Sparse Convolution: Convolution a sparse tensor
- Arbitrary patterns: Different input, output sparsity patterns
- Generalized Convoluion: Different input, output sparsity patterns and arbitrary kernel shapes.


References
----------

Expand Down
Binary file added docs/images/conv_generalized.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/conv_sparse_conv.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5d8dbeb

Please sign in to comment.