Files
pytorch/caffe2/python
Honghao Wei 290acab2c7 implement drelu and unittest
Summary:
In this revision, I mainly implemented the DRelu activation. See https://arxiv.org/pdf/1706.06978v1.pdf for details.
To sum up, different from standard relu and purely, which divide the scope into two parts with boundary at zero, DRelu calculate another value p to divide the activation into two part. P is the softmax value of the output of Batch Normalization. For f(x)=x part in relu, you can find similar patten in f(x)=px, and for f(x)=0 part in rely, you can find similar pattern in f(x)=a(1-p)x, in which a is a parameter to tune. Drelu activation result is the sum of these two parts, f(x) = a(1-p)x + px.

To implement DRelu, I take BatchNormalization as super class and then use the above formula for computation. In order to allow users to choose activation methods, which usually takes place when calling add_mlp function in processor_util.py, I pass the parameter transfer in model_option from UI to the details, just as what dropout do. Currently, I place it in extra_option, but can modify it if AML team needs to redesign the UI.

I also add units test for DRelu. We check the shape of output and also do the numeric unit tests.
For Unit test, I first check the numeric value of BatchNormalization, since there is no similar test before. I then compute the value of DRelu outputs and compare the results with current DRelu layer.

Reviewed By: chocjy

Differential Revision: D5341464

fbshipit-source-id: 896b4dcc49cfd5493d97a8b448401b19e9c80630
2017-07-20 11:50:08 -07:00
..
2017-06-23 14:02:40 -07:00
2017-07-11 18:17:52 -07:00
2017-07-20 11:50:08 -07:00
2017-07-13 23:31:54 -07:00
2017-06-25 17:21:24 -07:00
2017-07-14 17:49:24 -07:00
2017-07-11 18:17:52 -07:00
2017-06-27 22:06:30 -07:00
2017-07-15 19:22:32 -07:00
2017-07-10 17:52:25 -07:00
2017-07-17 23:20:37 -07:00
2017-07-20 11:50:08 -07:00
2017-07-13 01:51:30 -07:00
2017-07-17 13:07:33 -07:00
2017-07-11 15:26:52 -07:00
2017-06-21 03:18:20 -07:00
2017-06-28 13:50:48 -07:00
2017-07-17 10:24:18 -07:00
2017-07-07 23:06:11 -07:00