update grad_clip to 1.8

pull/449/head
lfchener 4 years ago
parent 766e96e600
commit 01019fb92b

@ -27,7 +27,7 @@ To avoid the trouble of environment setup, [running in Docker container](#runnin
### Prerequisites ### Prerequisites
- Python 2.7 only supported - Python 2.7 only supported
- PaddlePaddle 1.6.0 or later (please refer to the [Installation Guide](https://www.paddlepaddle.org.cn/documentation/docs/en/beginners_guide/index_en.html)) - PaddlePaddle 1.8.0 or later (please refer to the [Installation Guide](https://www.paddlepaddle.org.cn/documentation/docs/en/beginners_guide/index_en.html))
### Setup ### Setup
- Make sure these libraries or tools installed: `pkg-config`, `flac`, `ogg`, `vorbis`, `boost` and `swig`, e.g. installing them via `apt-get`: - Make sure these libraries or tools installed: `pkg-config`, `flac`, `ogg`, `vorbis`, `boost` and `swig`, e.g. installing them via `apt-get`:

@ -25,7 +25,7 @@
### 前提 ### 前提
- 只支持Python 2.7 - 只支持Python 2.7
- PaddlePaddle 1.6.0 版本及以上(请参考[安装指南](https://www.paddlepaddle.org.cn/install/quick) - PaddlePaddle 1.8.0 版本及以上(请参考[安装指南](https://www.paddlepaddle.org.cn/install/quick)
### 安装 ### 安装
- 请确保以下库或工具已安装完毕:`pkg-config`, `flac`, `ogg`, `vorbis`, `boost``swig`, 如可以通过`apt-get`安装: - 请确保以下库或工具已安装完毕:`pkg-config`, `flac`, `ogg`, `vorbis`, `boost``swig`, 如可以通过`apt-get`安装:

@ -285,9 +285,8 @@ class DeepSpeech2Model(object):
learning_rate=learning_rate, learning_rate=learning_rate,
decay_steps=num_samples / batch_size / dev_count, decay_steps=num_samples / batch_size / dev_count,
decay_rate=0.83, decay_rate=0.83,
staircase=True)) staircase=True),
fluid.clip.set_gradient_clip( grad_clip=fluid.clip.GradientClipByGlobalNorm(
clip=fluid.clip.GradientClipByGlobalNorm(
clip_norm=gradient_clipping)) clip_norm=gradient_clipping))
optimizer.minimize(loss=ctc_loss) optimizer.minimize(loss=ctc_loss)

Loading…
Cancel
Save