This is an automated email from the ASF dual-hosted git repository.
cjolivier01 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new 492a5fd add MSRAPrelu initializer for cpp-package (#9121)
492a5fd is described below
commit 492a5fde03418ae31b64d9866ca6a7a5c72388d3
Author: nihui <[email protected]>
AuthorDate: Wed Jan 10 04:59:23 2018 +0800
add MSRAPrelu initializer for cpp-package (#9121)
* add MSRAPrelu initializer for cpp-package
hello, this change adds the MSRAPrelu initializer for cpp-package, which
follows the python code
```
// def __init__(self, factor_type="avg", slope=0.25):
// magnitude = 2. / (1 + slope ** 2)
// super(MSRAPrelu, self).__init__("gaussian", factor_type,
magnitude)
// self._kwargs = {'factor_type': factor_type, 'slope': slope}
```
* change indent
* declare explicit
---
cpp-package/include/mxnet-cpp/initializer.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/cpp-package/include/mxnet-cpp/initializer.h
b/cpp-package/include/mxnet-cpp/initializer.h
index 61e9546..021808b 100644
--- a/cpp-package/include/mxnet-cpp/initializer.h
+++ b/cpp-package/include/mxnet-cpp/initializer.h
@@ -195,6 +195,12 @@ class Xavier : public Initializer {
}
};
+class MSRAPrelu : public Xavier {
+ public:
+ explicit MSRAPrelu(FactorType factor_type = avg, float slope = 0.25f)
+ : Xavier(gaussian, factor_type, 2. / (1 + slope * slope)) {}
+};
+
} // namespace cpp
} // namespace mxnet
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].