Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into fix_elementwise_gradient
commit
0f5d5b1ffc
@ -1 +0,0 @@
|
||||
../../v2/getstarted/quickstart_cn.rst
|
@ -1 +0,0 @@
|
||||
../../v2/getstarted/quickstart_en.rst
|
@ -0,0 +1,49 @@
|
||||
Quick Start
|
||||
============
|
||||
|
||||
Quick Install
|
||||
-------------
|
||||
|
||||
You can use pip to install PaddlePaddle with a single command, supports
|
||||
CentOS 6 above, Ubuntu 14.04 above or MacOS 10.12, with Python 2.7 installed.
|
||||
Simply run the following command to install, the version is cpu_avx_openblas:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install paddlepaddle
|
||||
|
||||
If you need to install GPU version (cuda7.5_cudnn5_avx_openblas), run:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install paddlepaddle-gpu
|
||||
|
||||
For more details about installation and build: :ref:`install_steps` .
|
||||
|
||||
Quick Use
|
||||
---------
|
||||
|
||||
Create a new file called housing.py, and paste this Python
|
||||
code:
|
||||
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import paddle.dataset.uci_housing as uci_housing
|
||||
import paddle.fluid as fluid
|
||||
|
||||
with fluid.scope_guard(fluid.core.Scope()):
|
||||
# initialize executor with cpu
|
||||
exe = fluid.Executor(place=fluid.CPUPlace())
|
||||
# load inference model
|
||||
[inference_program, feed_target_names,fetch_targets] = \
|
||||
fluid.io.load_inference_model(uci_housing.fluid_model(), exe)
|
||||
# run inference
|
||||
result = exe.run(inference_program,
|
||||
feed={feed_target_names[0]: uci_housing.predict_reader()},
|
||||
fetch_list=fetch_targets)
|
||||
# print predicted price is $12,273.97
|
||||
print 'Predicted price: ${:,.2f}'.format(result[0][0][0] * 1000)
|
||||
|
||||
Run :code:`python housing.py` and voila! It should print out a list of predictions
|
||||
for the test housing data.
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,13 @@
|
||||
## Background
|
||||
|
||||
The RecordIO file format is a container for records. This package is a C++ implementation of https://github.com/paddlepaddle/recordio, which originates from https://github.com/wangkuiyi/recordio.
|
||||
|
||||
## Fault-tolerant Writing
|
||||
|
||||
For the initial design purpose of RecordIO within Google, which was logging, RecordIO groups record into *chunks*, whose header contains an MD5 hash of the chunk. A process that writes logs is supposed to call the Writer interface to add records. Once the writer accumulates a handful of them, it groups a chunk, put the MD5 into the chunk header, and appends the chunk to the file. In the event the process crashes unexpected, the last chunk in the RecordIO file could be incomplete/corrupt. The RecordIO reader is able to recover from these errors when the process restarts by identifying incomplete chucks and skipping over them.
|
||||
|
||||
## Reading Ranges
|
||||
|
||||
A side-effect of chunks is to make it easy to indexing records while reading, thus allows us to read a range of successive records. This is good for distributed log process, where each MapReduce task handles only part of records in a big RecordIO file.
|
||||
|
||||
The procedure that creates the index starts from reading the header of the first chunk. It indexes the offset (0) and the size of the chunk, and skips to the header of the next chunk by calling the `fseek` API. Please be aware that most distributed filesystems and all POSIX-compatible local filesystem provides `fseek`, and makes sure that `fseek` runs much faster than `fread`. This procedure generates a map from chunks to their offsets, which allows the readers is to locate and read a range of records.
|
Loading…
Reference in new issue