Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Recognize digits new api first draft #528

Merged

Conversation

jetfuel
Copy link
Contributor

@jetfuel jetfuel commented May 31, 2018

This PR cover a bit of the Chinese version. Please don't mind them. I will focus on the English version first. and port the update to Chinese later.

@jetfuel jetfuel self-assigned this May 31, 2018
@@ -124,183 +136,179 @@ PaddlePaddle provides a Python module, `paddle.dataset.mnist`, which downloads a
|t10k-labels-idx1-ubyte | Evaluation labels | 10,000 |


## Fluid API Overview
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good summarization. Should we include that in Chapter 1? @daming-lu

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

predict = paddle.layer.fc(input=img,
size=10,
act=paddle.activation.Softmax())
return predict
```

- Multi-Layer Perceptron: this network has two hidden fully-connected layers, one with ReLU and the other with softmax activation:
- Multi-Layer Perceptron: this network has two hidden fully-connected layers, both are using ReLU as activation functino. The output layer is using softmax activation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functino -> function


`batch` is a special decorator, which takes a reader and outputs a *batch reader*, which doesn't yield an instance, but a minibatch at a time.
```python
use_cude = False # set to True if training with GPU
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cude -> cuda

```

PaddlePaddle provides a special layer `layer.data` for reading data. Let us create a data layer for reading images and connect it to a classification network created using one of above three functions. We also need a cost layer for training the model.
#### Train Program Configuration
Copy link
Contributor

@nickyfantasy nickyfantasy May 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you intend to make this section a child under Program Functions Configuration? Or it should be just ###

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do feel it should be under the Program Functions Configuration since it is a program function. What do you think? @nickyfantasy

@jetfuel jetfuel merged commit ebe54c6 into PaddlePaddle:high-level-api-branch Jun 1, 2018
@jetfuel jetfuel deleted the recognize_digits_new_api branch June 1, 2018 00:26
@@ -124,183 +136,179 @@ PaddlePaddle provides a Python module, `paddle.dataset.mnist`, which downloads a
|t10k-labels-idx1-ubyte | Evaluation labels | 10,000 |


## Fluid API Overview
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@@ -124,183 +136,177 @@ PaddlePaddle provides a Python module, `paddle.dataset.mnist`, which downloads a
|t10k-labels-idx1-ubyte | Evaluation labels | 10,000 |


## Fluid API Overview

The demo will be using the latest paddle fluid API. Fluid API is the latest Paddle API. It simplifies the model configurations without sacrifice the performance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without sacrificing


The demo will be using the latest paddle fluid API. Fluid API is the latest Paddle API. It simplifies the model configurations without sacrifice the performance.
We recommend using Fluid API as it is much easier to pick up.
Here are the quick overview on the major fluid API complements.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a quick

We recommend using Fluid API as it is much easier to pick up.
Here are the quick overview on the major fluid API complements.

1. `inference_program`: A function that specify how to get the prediction from the data input.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specifies


1. `inference_program`: A function that specify how to get the prediction from the data input.
This is where you specify the network flow.
1. `train_program`: A function that specify how to get avg_cost from `inference_program` and labels.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specifies

@@ -315,27 +321,25 @@ Usually, with MNIST data, the softmax regression model achieves an accuracy arou

## Application

After training, users can use the trained model to classify images. The following code shows how to inference MNIST images through `paddle.infer` interface.
After training, users can use the trained model to classify images. The following code shows how to inference MNIST images through `fluid.Inferencer`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to infer or do inference

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants