提交 398d50dd 编写于 作者: Q qijun

fix typo error

上级 b571a414
...@@ -66,12 +66,12 @@ def reader_creator(filename, sub_name): ...@@ -66,12 +66,12 @@ def reader_creator(filename, sub_name):
def train100(): def train100():
""" """
CIFAR-100 train set creator. CIFAR-100 training set creator.
It returns a reader creator, each sample in the reader is image pixels in It returns a reader creator, each sample in the reader is image pixels in
[0, 1] and label in [0, 99]. [0, 1] and label in [0, 99].
:return: Train reader creator :return: Training reader creator
:rtype: callable :rtype: callable
""" """
return reader_creator( return reader_creator(
...@@ -93,12 +93,12 @@ def test100(): ...@@ -93,12 +93,12 @@ def test100():
def train10(): def train10():
""" """
CIFAR-10 train set creator. CIFAR-10 training set creator.
It returns a reader creator, each sample in the reader is image pixels in It returns a reader creator, each sample in the reader is image pixels in
[0, 1] and label in [0, 9]. [0, 1] and label in [0, 9].
:return: Train reader creator :return: Training reader creator
:rtype: callable :rtype: callable
""" """
return reader_creator( return reader_creator(
......
...@@ -199,12 +199,12 @@ def test(): ...@@ -199,12 +199,12 @@ def test():
""" """
Conll05 test set creator. Conll05 test set creator.
Because the train dataset is not free, the test dataset is used for Because the training dataset is not free, the test dataset is used for
training. It returns a reader creator, each sample in the reader is nine training. It returns a reader creator, each sample in the reader is nine
features, including sentence sequence, predicate, predicate context, features, including sentence sequence, predicate, predicate context,
predicate context flag and tagged sequence. predicate context flag and tagged sequence.
:return: Train reader creator :return: Training reader creator
:rtype: callable :rtype: callable
""" """
word_dict, verb_dict, label_dict = get_dict() word_dict, verb_dict, label_dict = get_dict()
......
...@@ -121,14 +121,14 @@ def reader_creator(pos_pattern, neg_pattern, word_idx, buffer_size): ...@@ -121,14 +121,14 @@ def reader_creator(pos_pattern, neg_pattern, word_idx, buffer_size):
def train(word_idx): def train(word_idx):
""" """
IMDB train set creator. IMDB training set creator.
It returns a reader creator, each sample in the reader is an zero-based ID It returns a reader creator, each sample in the reader is an zero-based ID
sequence and label in [0, 1]. sequence and label in [0, 1].
:param word_idx: word dictionary :param word_idx: word dictionary
:type word_idx: dict :type word_idx: dict
:return: Train reader creator :return: Training reader creator
:rtype: callable :rtype: callable
""" """
return reader_creator( return reader_creator(
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
imikolov's simple dataset. imikolov's simple dataset.
This module will download dataset from This module will download dataset from
http://www.fit.vutbr.cz/~imikolov/rnnlm/ and parse train/test set into paddle http://www.fit.vutbr.cz/~imikolov/rnnlm/ and parse training set and test set
reader creators. into paddle reader creators.
""" """
import paddle.v2.dataset.common import paddle.v2.dataset.common
import collections import collections
...@@ -91,7 +91,7 @@ def reader_creator(filename, word_idx, n): ...@@ -91,7 +91,7 @@ def reader_creator(filename, word_idx, n):
def train(word_idx, n): def train(word_idx, n):
""" """
imikolov train set creator. imikolov training set creator.
It returns a reader creator, each sample in the reader is a word ID It returns a reader creator, each sample in the reader is a word ID
tuple. tuple.
...@@ -100,7 +100,7 @@ def train(word_idx, n): ...@@ -100,7 +100,7 @@ def train(word_idx, n):
:type word_idx: dict :type word_idx: dict
:param n: sliding window size :param n: sliding window size
:type n: int :type n: int
:return: Train reader creator :return: Training reader creator
:rtype: callable :rtype: callable
""" """
return reader_creator('./simple-examples/data/ptb.train.txt', word_idx, n) return reader_creator('./simple-examples/data/ptb.train.txt', word_idx, n)
...@@ -117,7 +117,7 @@ def test(word_idx, n): ...@@ -117,7 +117,7 @@ def test(word_idx, n):
:type word_idx: dict :type word_idx: dict
:param n: sliding window size :param n: sliding window size
:type n: int :type n: int
:return: Train reader creator :return: Test reader creator
:rtype: callable :rtype: callable
""" """
return reader_creator('./simple-examples/data/ptb.valid.txt', word_idx, n) return reader_creator('./simple-examples/data/ptb.valid.txt', word_idx, n)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
MNIST dataset. MNIST dataset.
This module will download dataset from http://yann.lecun.com/exdb/mnist/ and This module will download dataset from http://yann.lecun.com/exdb/mnist/ and
parse train/test set into paddle reader creators. parse training set and test set into paddle reader creators.
""" """
import paddle.v2.dataset.common import paddle.v2.dataset.common
import subprocess import subprocess
...@@ -76,12 +76,12 @@ def reader_creator(image_filename, label_filename, buffer_size): ...@@ -76,12 +76,12 @@ def reader_creator(image_filename, label_filename, buffer_size):
def train(): def train():
""" """
MNIST train set creator. MNIST training set creator.
It returns a reader creator, each sample in the reader is image pixels in It returns a reader creator, each sample in the reader is image pixels in
[0, 1] and label in [0, 9]. [0, 1] and label in [0, 9].
:return: Train reader creator :return: Training reader creator
:rtype: callable :rtype: callable
""" """
return reader_creator( return reader_creator(
......
...@@ -17,8 +17,8 @@ Movielens 1-M dataset. ...@@ -17,8 +17,8 @@ Movielens 1-M dataset.
Movielens 1-M dataset contains 1 million ratings from 6000 users on 4000 Movielens 1-M dataset contains 1 million ratings from 6000 users on 4000
movies, which was collected by GroupLens Research. This module will download movies, which was collected by GroupLens Research. This module will download
Movielens 1-M dataset from Movielens 1-M dataset from
http://files.grouplens.org/datasets/movielens/ml-1m.zip and parse train/test http://files.grouplens.org/datasets/movielens/ml-1m.zip and parse training
set into paddle reader creators. set and test set into paddle reader creators.
""" """
......
...@@ -113,7 +113,7 @@ def reader_creator(data): ...@@ -113,7 +113,7 @@ def reader_creator(data):
def train(): def train():
""" """
Default train set reader creator Default training set reader creator
""" """
data_set = load_sentiment_data() data_set = load_sentiment_data()
return reader_creator(data_set[0:NUM_TRAINING_INSTANCES]) return reader_creator(data_set[0:NUM_TRAINING_INSTANCES])
......
...@@ -16,7 +16,7 @@ UCI Housing dataset. ...@@ -16,7 +16,7 @@ UCI Housing dataset.
This module will download dataset from This module will download dataset from
https://archive.ics.uci.edu/ml/machine-learning-databases/housing/ and https://archive.ics.uci.edu/ml/machine-learning-databases/housing/ and
parse train/test set into paddle reader creators. parse training set and test set into paddle reader creators.
""" """
import numpy as np import numpy as np
...@@ -73,12 +73,12 @@ def load_data(filename, feature_num=14, ratio=0.8): ...@@ -73,12 +73,12 @@ def load_data(filename, feature_num=14, ratio=0.8):
def train(): def train():
""" """
UCI_HOUSING train set creator. UCI_HOUSING training set creator.
It returns a reader creator, each sample in the reader is features after It returns a reader creator, each sample in the reader is features after
normalization and price number. normalization and price number.
:return: Train reader creator :return: Training reader creator
:rtype: callable :rtype: callable
""" """
global UCI_TRAIN_DATA global UCI_TRAIN_DATA
......
...@@ -16,7 +16,7 @@ WMT14 dataset. ...@@ -16,7 +16,7 @@ WMT14 dataset.
The original WMT14 dataset is too large and a small set of data for set is The original WMT14 dataset is too large and a small set of data for set is
provided. This module will download dataset from provided. This module will download dataset from
http://paddlepaddle.cdn.bcebos.com/demo/wmt_shrinked_data/wmt14.tgz and http://paddlepaddle.cdn.bcebos.com/demo/wmt_shrinked_data/wmt14.tgz and
parse train/test set into paddle reader creators. parse training set and test set into paddle reader creators.
""" """
import tarfile import tarfile
...@@ -105,13 +105,13 @@ def reader_creator(tar_file, file_name, dict_size): ...@@ -105,13 +105,13 @@ def reader_creator(tar_file, file_name, dict_size):
def train(dict_size): def train(dict_size):
""" """
WMT14 train set creator. WMT14 training set creator.
It returns a reader creator, each sample in the reader is source language It returns a reader creator, each sample in the reader is source language
word ID sequence, target language word ID sequence and next word ID word ID sequence, target language word ID sequence and next word ID
sequence. sequence.
:return: Train reader creator :return: Training reader creator
:rtype: callable :rtype: callable
""" """
return reader_creator( return reader_creator(
...@@ -126,7 +126,7 @@ def test(dict_size): ...@@ -126,7 +126,7 @@ def test(dict_size):
word ID sequence, target language word ID sequence and next word ID word ID sequence, target language word ID sequence and next word ID
sequence. sequence.
:return: Train reader creator :return: Test reader creator
:rtype: callable :rtype: callable
""" """
return reader_creator( return reader_creator(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册