From dd7dcd6b54276deeb847a0b39b853a994f45dfe6 Mon Sep 17 00:00:00 2001 From: dangqingqing Date: Mon, 6 Mar 2017 19:26:04 +0800 Subject: [PATCH] Rename reader_dict --- label_semantic_roles/README.en.md | 8 ++++---- label_semantic_roles/README.md | 6 +++--- label_semantic_roles/train.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/label_semantic_roles/README.en.md b/label_semantic_roles/README.en.md index 4accfe0..b2a75cb 100644 --- a/label_semantic_roles/README.en.md +++ b/label_semantic_roles/README.en.md @@ -440,15 +440,15 @@ trainer = paddle.trainer.SGD(cost=crf_cost, As mentioned in data preparation section, we will use CoNLL 2005 test corpus as training data set. `conll05.test()` outputs one training instance at a time. It will be shuffled, and batched into mini batches as input. ```python -reader = paddle.reader.batched( +reader = paddle.batch( paddle.reader.shuffle( conll05.test(), buf_size=8192), batch_size=20) ``` -`reader_dict` is used to specify relationship between data instance and layer layer. For example, according to following `reader_dict`, the 0th column of data instance produced by`conll05.test()` correspond to data layer named `word_data`. +`feeding` is used to specify relationship between data instance and layer layer. For example, according to following `feeding`, the 0th column of data instance produced by`conll05.test()` correspond to data layer named `word_data`. ```python -reader_dict = { +feeding = { 'word_data': 0, 'ctx_n2_data': 1, 'ctx_n1_data': 2, @@ -478,7 +478,7 @@ trainer.train( reader=reader, event_handler=event_handler, num_passes=10000, - reader_dict=reader_dict) + feeding=feeding) ``` ## Conclusion diff --git a/label_semantic_roles/README.md b/label_semantic_roles/README.md index a96d960..0bead42 100644 --- a/label_semantic_roles/README.md +++ b/label_semantic_roles/README.md @@ -409,11 +409,11 @@ reader = paddle.batch( conll05.test(), buf_size=8192), batch_size=20) ``` -通过`reader_dict`来指定每一个数据和data_layer的对应关系。 例如 下面`reader_dict`表示: `conll05.test()`产生数据的第0列对应`word_data`层的特征。 +通过`feeding`来指定每一个数据和data_layer的对应关系。 例如 下面`feeding`表示: `conll05.test()`产生数据的第0列对应`word_data`层的特征。 ```python -reader_dict = { +feeding = { 'word_data': 0, 'ctx_n2_data': 1, 'ctx_n1_data': 2, @@ -443,7 +443,7 @@ trainer.train( reader=reader, event_handler=event_handler, num_passes=10000, - reader_dict=reader_dict) + feeding=feeding) ``` ## 总结 diff --git a/label_semantic_roles/train.py b/label_semantic_roles/train.py index f88a709..623b614 100644 --- a/label_semantic_roles/train.py +++ b/label_semantic_roles/train.py @@ -159,7 +159,7 @@ def main(): paddle.reader.shuffle( conll05.test(), buf_size=8192), batch_size=10) - reader_dict = { + feeding = { 'word_data': 0, 'ctx_n2_data': 1, 'ctx_n1_data': 2, @@ -181,7 +181,7 @@ def main(): reader=reader, event_handler=event_handler, num_passes=10000, - reader_dict=reader_dict) + feeding=feeding) if __name__ == '__main__': -- GitLab