Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 20af58f

Browse files
authored
Fix gelu (#1287)
* fix leaky_relu * update mxnet as 0b20200802
1 parent 7e1f9d0 commit 20af58f

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ First of all, install the latest MXNet. You may use the following commands:
2020

2121
```bash
2222
# Install the version with CUDA 10.0
23-
pip install -U --pre "mxnet-cu100>=2.0.0b20200716" -f https://dist.mxnet.io/python
23+
pip install -U --pre "mxnet-cu100>=2.0.0b20200802" -f https://dist.mxnet.io/python
2424

2525
# Install the version with CUDA 10.1
26-
pip install -U --pre "mxnet-cu101>=2.0.0b20200716" -f https://dist.mxnet.io/python
26+
pip install -U --pre "mxnet-cu101>=2.0.0b20200802" -f https://dist.mxnet.io/python
2727

2828
# Install the version with CUDA 10.2
29-
pip install -U --pre "mxnet-cu102>=2.0.0b20200716" -f https://dist.mxnet.io/python
29+
pip install -U --pre "mxnet-cu102>=2.0.0b20200802" -f https://dist.mxnet.io/python
3030

3131
# Install the cpu-only version
32-
pip install -U --pre "mxnet>=2.0.0b20200716" -f https://dist.mxnet.io/python
32+
pip install -U --pre "mxnet>=2.0.0b20200802" -f https://dist.mxnet.io/python
3333
```
3434

3535

@@ -42,7 +42,7 @@ pip install -U -e .
4242
pip install -U -e .[extras]
4343

4444
# In case you are using zsh, try to use the following command for installing
45-
pip install -U -e ."[extras]"
45+
pip install -U -e ."[extras]"
4646
```
4747

4848
If you find that you do not have the permission, you can also install to the user folder:
@@ -51,12 +51,12 @@ If you find that you do not have the permission, you can also install to the use
5151
pip install -U -e . --user
5252
```
5353

54-
For Windows users, we recommend to use the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/about).
54+
For Windows users, we recommend to use the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/about).
5555

5656

5757
# Access the Command-line Toolkits
5858

59-
To facilitate the researcher and the engineers, we provide command-line-toolkits for
59+
To facilitate the researcher and the engineers, we provide command-line-toolkits for
6060
downloading and preprocessing the NLP datasets. For more details, you may refer to
6161
[GluonNLP Datasets](./scripts/datasets) and [GluonNLP Preprocessing Tools](./scripts/preprocess).
6262

src/gluonnlp/layers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,7 @@ def __init__(self, mode='erf'):
356356

357357
def hybrid_forward(self, F, x):
358358
if self._mode == 'erf':
359-
# TODO Investigate the precision of F.npx.leaky_relu(x, act_type='gelu')
360-
return x * 0.5 * (1.0 + F.npx.erf(x / math.sqrt(2.0)))
359+
return F.npx.leaky_relu(x, act_type='gelu')
361360
elif self._mode == 'tanh':
362361
return 0.5 * x\
363362
* (1.0 + F.np.tanh(math.sqrt(2.0 / math.pi) * (x + 0.044715 * (x ** 3))))

0 commit comments

Comments
 (0)