You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Paddle/doc_cn/ui/data_provider/index.rst

18 lines
1.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

PaddlePaddle的数据提供(DataProvider)介绍
========================================
数据提供(DataProvider)是PaddlePaddle负责提供数据的模块。其作用是将训练数据传入内存或者显存让神经网络可以进行训练。简单的使用用户可以使用Python的 :code:`PyDataProvider` 来自定义传数据的过程。如果有更复杂的使用或者需要更高的效率用户也可以在C++端自定义一个 :code:`DataProvider`
PaddlePaddle需要用户在网络配置(trainer_config.py)中定义使用哪种DataProvider及其参数训练文件列表(train.list)和测试文件列表(test.list)。
其中train.list和test.list均为本地的两个文件(推荐直接放置到训练目录,以相对路径引用)。如果test.list不设置或者设置为None那么在训练过程中不会执行测试操作。否则会根据命令行参数指定的测试方式在训练过程中进行测试从而防止过拟合。
一般情况下train.list和test.list为纯文本文件一行对应一个数据文件数据文件存放在本地磁盘中。将文件的绝对路径或相对路径(相对于PaddlePaddle程序运行时的路径)写在train.list和test.list中。当然train.list和test.list也可以放置hdfs文件路径或者数据库连接地址等等。
用户在DataProvider中需要实现如何访问其中每一个文件。DataProvider的具体用法和如何实现一个新的DataProvider请参考下述文章:
.. toctree::
pydataprovider2.rst
write_new_dataprovider.rst