diff --git a/08.machine_translation/README.cn.md b/08.machine_translation/README.cn.md index 81d268a7fc4000cde43934d931c6ad9eeee284da..65d78cb9d4d5e578300a19bbab10dcce58afdc1b 100644 --- a/08.machine_translation/README.cn.md +++ b/08.machine_translation/README.cn.md @@ -173,6 +173,7 @@ $$e_{ij} = {align(z_i, h_j)}$$ # 加载 paddle的python包 import sys import paddle.v2 as paddle +import numpy as np # 配置只使用cpu,并且使用一个cpu进行训练 paddle.init(use_gpu=False, trainer_count=1) @@ -273,11 +274,11 @@ is_generating = False output_mem=decoder_mem, size=decoder_size) - out = paddle.layer.mixed( + out = paddle.layer.fc( size=target_dict_dim, bias_attr=True, act=paddle.activation.Softmax(), - input=paddle.layer.full_matrix_projection(input=gru_step)) + input=gru_step) return out ``` diff --git a/08.machine_translation/README.md b/08.machine_translation/README.md index 45d7e19a3fc85afa0e9cdc936226aa7b5d1d9aed..96effbde4627aba4d07cd77105b9e69ecd42c92c 100644 --- a/08.machine_translation/README.md +++ b/08.machine_translation/README.md @@ -215,6 +215,7 @@ This subset has 193319 instances of training data and 6003 instances of test dat ```python import sys import paddle.v2 as paddle +import numpy as np # train with a single CPU paddle.init(use_gpu=False, trainer_count=1)