Skip to content
Snippets Groups Projects
Commit 2ee0a0fa authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Added keras/doc/Support.md and fixed a few links

parent c1dd30aa
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ HPVM consists of a few relatively independent key components.
* HPVM code generator: a few ``opt`` passes that lowers HPVM IR to LLVM IR,
which is then compiled into object code and binary.
`Compilation process of HPVM <../references/hpvm-specification.html>`_
:doc:`Compilation process of HPVM </references/hpvm-specification>`
shows how these 2 components work together.
In addition, there are:
......@@ -26,6 +26,7 @@ which explains their role, usage, and other details.
:maxdepth: 1
keras-frontend
keras-support
keras-benchmarks
torch2hpvm
predtuner
......
......@@ -39,5 +39,5 @@ At the root of this project (``/projects/keras/``) install the Keras frontend pi
Suppported Operations
---------------------
List of supported operations and limitations are documented `here <../projects/keras/docs/Support.md>`_.
TODO: move that Support.md in here as well, otherwise the link will fail when we publish to a website.
List of supported operations and limitations are documented
:doc:`here <keras-support>`.
../../projects/keras/docs/Support.rst
\ No newline at end of file
.. _hpvm-comp-process:
HPVM Compilation Process
========================
......
## Supported Keras Operators
Supported Keras Operators
=========================
The Keras frontend supports `Sequential()` Keras models.
The Keras frontend supports ``Sequential()`` Keras models.
The list of supported operations is as follows:
* `Conv2D`
* `DepthwiseConv2D`
* `Dense`
* `BatchNormalization`
* `MaxPooling2D`
* `AveragePooling2D`
* `Flatten`
* `Add`
* `ZeroPadding2D`
* `Activation`
* `relu`
* `tanh`
* `softmax`
* ``Conv2D``
* ``DepthwiseConv2D``
* ``Dense``
* ``BatchNormalization``
* ``MaxPooling2D``
* ``AveragePooling2D``
* ``Flatten``
* ``Add``
* ``ZeroPadding2D``
* ``Activation``
* ``relu``
* ``tanh``
* ``softmax``
## Limitations
Limitations
-----------
* Currently, we support Convolutional Neural Networks (CNNs) that include the supported operators (above) - RNNs/LSTMs not supported
* We currently only support models in NCHW format (NHWC is not supported)
* Softmax operator should be the last operation in the CNN pipeline
* Softmax operation must be a separate operator (not specified as activation to another type of Keras operator). Example of what works:
```python
Activation ("softmax")
```
.. code-block:: python
Activation ("softmax")
Example of what is NOT supported:
```python
Dense(num_classes, activation="softmax")
```
.. code-block:: python
* For convolutions with stride > 1 `same` convolution is NOT supported. Explicitly add `ZeroPadding2D` layer before `Conv2D` or `DepthwiseConv2D` operators. Example of what does NOT work:
Dense(num_classes, activation="softmax")
```python
Conv2D(num_filters, kernel_size = (3,3), strides = (2,2), padding = `same`)
```
Example of what works instead:
* For convolutions with stride > 1 ``same`` convolution is NOT supported. Explicitly add ``ZeroPadding2D`` layer before ``Conv2D`` or ``DepthwiseConv2D`` operators. Example of what does NOT work:
```python
# NOTE: Amount of padding varies with kernel sizes and strides
ZeroPadding2D(padding=(1,1), data_format = `channels_first`) # only support NCHW
Conv2D(num_filters, kernel_size = (3,3), strides = (2,2), padding = `valid`)
```
.. code-block:: python
Conv2D(num_filters, kernel_size = (3,3), strides = (2,2), padding = `same`)
Example of what works instead:
.. code-block:: python
# NOTE: Amount of padding varies with kernel sizes and strides
ZeroPadding2D(padding=(1,1), data_format = `channels_first`) # only support NCHW
Conv2D(num_filters, kernel_size = (3,3), strides = (2,2), padding = `valid`)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment