Enable swish (#1682)
authorEvgeny Lazarev <evgeny.lazarev@intel.com>
Mon, 10 Aug 2020 12:51:21 +0000 (15:51 +0300)
committerGitHub <noreply@github.com>
Mon, 10 Aug 2020 12:51:21 +0000 (15:51 +0300)
commit318d38770b7fa2e0bb9ae9be231ce6bd94f5ca12
tree0637c5eea404dc8c71e5be63c09ab37d6e0f7dcd
parent600ad8d180e746b2a6bad2c8e085728e81324086
Enable swish (#1682)

* Draft version of the Swish nGraph operation and fusing transformations for different approaches to express the operation

* Swish fusing transformation refactoring

* Added Swish operation and extractor for TF. Removed unfolding transformation for the operation.

* Added SwishIE. Implemented transformation to convert Swish to SwishIE.

* Code style fixes

* Updated Swish reference implementation. Added tests for shape and value inference

* Fixed code style for Python API

* Fixed unit test

* Apply review comments

* Use matcher_pass_callback

* Make m_alpha attribute protected in the SwishIE operation

* Fixed Swish op PythonAPI test
29 files changed:
inference-engine/src/legacy_api/src/convert_function_to_cnn_network.cpp
inference-engine/src/transformations/include/ngraph_ops/swish_ie.hpp [new file with mode: 0644]
inference-engine/src/transformations/include/transformations/convert_opset1_to_legacy/convert_swish_to_swish_ie.hpp [new file with mode: 0644]
inference-engine/src/transformations/include/transformations/swish_fusion.hpp [new file with mode: 0644]
inference-engine/src/transformations/src/ngraph_ops/swish_ie.cpp [new file with mode: 0644]
inference-engine/src/transformations/src/transformations/common_optimizations/common_optimizations.cpp
inference-engine/src/transformations/src/transformations/convert_opset1_to_legacy/convert_opset1_to_legacy.cpp
inference-engine/src/transformations/src/transformations/convert_opset1_to_legacy/convert_swish_to_swish_ie.cpp [new file with mode: 0644]
inference-engine/src/transformations/src/transformations/swish_fusion.cpp [new file with mode: 0644]
inference-engine/tests/functional/inference_engine/transformations/mish_fusion_test.cpp
inference-engine/tests/functional/inference_engine/transformations/swish_fusion_test.cpp [new file with mode: 0644]
model-optimizer/automation/package_BOM.txt
model-optimizer/extensions/front/tf/swish.py [deleted file]
model-optimizer/extensions/front/tf/swish_ext.py [new file with mode: 0644]
model-optimizer/extensions/front/tf/swish_test.py [deleted file]
model-optimizer/extensions/ops/activation_ops.py
ngraph/python/src/ngraph/__init__.py
ngraph/python/src/ngraph/opset4/__init__.py
ngraph/python/src/ngraph/opset4/ops.py
ngraph/python/tests/test_ngraph/test_swish.py [new file with mode: 0644]
ngraph/src/ngraph/CMakeLists.txt
ngraph/src/ngraph/op/swish.cpp [new file with mode: 0644]
ngraph/src/ngraph/op/swish.hpp [new file with mode: 0644]
ngraph/src/ngraph/ops.hpp
ngraph/src/ngraph/opsets/opset4_tbl.hpp
ngraph/src/ngraph/runtime/reference/swish.hpp [new file with mode: 0644]
ngraph/test/CMakeLists.txt
ngraph/test/op_eval/swish.cpp [new file with mode: 0644]
ngraph/test/type_prop/swish.cpp [new file with mode: 0644]