@@ -102,14 +102,11 @@ After issuing a command `python train.py`, training will start immediately. The
### Initialize PaddlePaddle
We must import and initialize PaddlePaddle (enable/disable GPU, set the number of trainers, etc).
We must import and initialize Paddle.
```python
importsys
importpaddle.v2aspaddle
# PaddlePaddle init
paddle.init(use_gpu=False,trainer_count=1)
importpaddle
importpaddle.fluidasfluid
```
As alluded to in section [Model Overview](#model-overview), here we provide the implementations of both Text CNN and Stacked-bidirectional LSTM models.
...
...
@@ -121,20 +118,26 @@ We create a neural network `convolution_net` as the following snippet code.
Note: `paddle.networks.sequence_conv_pool` includes both convolution and pooling layer operations.
@@ -144,14 +144,11 @@ After issuing a command `python train.py`, training will start immediately. The
### Initialize PaddlePaddle
We must import and initialize PaddlePaddle (enable/disable GPU, set the number of trainers, etc).
We must import and initialize Paddle.
```python
import sys
import paddle.v2 as paddle
# PaddlePaddle init
paddle.init(use_gpu=False, trainer_count=1)
import paddle
import paddle.fluid as fluid
```
As alluded to in section [Model Overview](#model-overview), here we provide the implementations of both Text CNN and Stacked-bidirectional LSTM models.
...
...
@@ -163,20 +160,26 @@ We create a neural network `convolution_net` as the following snippet code.
Note: `paddle.networks.sequence_conv_pool` includes both convolution and pooling layer operations.