Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 02.recognize_digits/README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ Test with Epoch 0, avg_cost: 0.053097883707459624, acc: 0.9822850318471338

### 生成预测输入数据

`infer_3.png` 是数字 3 的一个示例图像。把它变成一个 numpy 数组以匹配数据feed格式。
[infer_3.png](https://github.com/PaddlePaddle/book/blob/develop/02.recognize_digits/image/infer_3.png) 是数字 3 的一个示例图像。把它变成一个 numpy 数组以匹配数据feed格式。

```python
def load_image(file):
Expand Down Expand Up @@ -558,7 +558,7 @@ with fluid.scope_guard(inference_scope):
lab = numpy.argsort(results)

# 打印 infer_3.png 这张图片的预测结果
img=Image.open('image/infer_3.png')
img=Image.open(cur_dir + 'image/infer_3.png')
plt.imshow(img)
print("Inference result of image/infer_3.png is: %d" % lab[0][0][-1])
```
Expand Down
4 changes: 2 additions & 2 deletions 02.recognize_digits/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ You can use trained model to classify handwriting pictures of digits. The progra

### Generate input data to be inferred

`infer_3.png` is an example picture of number 3. Transform it into a numpy to match feed data format
[infer_3.png](https://github.com/PaddlePaddle/book/blob/develop/02.recognize_digits/image/infer_3.png) is an example picture of number 3. Transform it into a numpy to match feed data format


```python
Expand Down Expand Up @@ -547,7 +547,7 @@ with fluid.scope_guard(inference_scope):
lab = numpy.argsort(results)

# Print prediction result of infer_3.png
img=Image.open('image/infer_3.png')
img=Image.open(cur_dir + 'image/infer_3.png')
plt.imshow(img)
print("Inference result of image/infer_3.png is: %d" % lab[0][0][-1])
```
Expand Down
4 changes: 2 additions & 2 deletions 02.recognize_digits/index.cn.html
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@

### 生成预测输入数据

`infer_3.png` 是数字 3 的一个示例图像。把它变成一个 numpy 数组以匹配数据feed格式。
[infer_3.png](https://github.com/PaddlePaddle/book/blob/develop/02.recognize_digits/image/infer_3.png) 是数字 3 的一个示例图像。把它变成一个 numpy 数组以匹配数据feed格式。

```python
def load_image(file):
Expand Down Expand Up @@ -600,7 +600,7 @@
lab = numpy.argsort(results)

# 打印 infer_3.png 这张图片的预测结果
img=Image.open('image/infer_3.png')
img=Image.open(cur_dir + 'image/infer_3.png')
plt.imshow(img)
print("Inference result of image/infer_3.png is: %d" % lab[0][0][-1])
```
Expand Down
4 changes: 2 additions & 2 deletions 02.recognize_digits/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@

### Generate input data to be inferred

`infer_3.png` is an example picture of number 3. Transform it into a numpy to match feed data format
[infer_3.png](https://github.com/PaddlePaddle/book/blob/develop/02.recognize_digits/image/infer_3.png) is an example picture of number 3. Transform it into a numpy to match feed data format


```python
Expand Down Expand Up @@ -589,7 +589,7 @@
lab = numpy.argsort(results)

# Print prediction result of infer_3.png
img=Image.open('image/infer_3.png')
img=Image.open(cur_dir + 'image/infer_3.png')
plt.imshow(img)
print("Inference result of image/infer_3.png is: %d" % lab[0][0][-1])
```
Expand Down
2 changes: 1 addition & 1 deletion 03.image_classification/README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ ResNet(Residual Network) \[[15](#参考文献)\] 是2015年ImageNet图像分类
图9. 残差模块
</p>

图10展示了50、101、152层网络连接示意图,使用的是瓶颈模块。这三个模型的区别在于每组中残差模块的重复次数不同(见图右上角)。ResNet训练收敛较快,成功的训练了上百乃至近千层的卷积神经网络。
图10展示了50、116、152层网络连接示意图,使用的是瓶颈模块。这三个模型的区别在于每组中残差模块的重复次数不同(见图右上角)。ResNet训练收敛较快,成功的训练了上百乃至近千层的卷积神经网络。

<p align="center">
<img src="https://github.com/PaddlePaddle/book/blob/develop/03.image_classification/image/resnet.png?raw=true"><br/>
Expand Down
2 changes: 1 addition & 1 deletion 03.image_classification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Figure 9 illustrates the ResNet architecture. To the left is the basic building
Figure 9. Residual block
</p>

Figure 10 illustrates ResNets with 50, 101, 152 layers, respectively. All three networks use bottleneck blocks and their difference lies in the repetition time of residual blocks. ResNet converges very fast and can be trained with hundreds or thousands of layers.
Figure 10 illustrates ResNets with 50, 116, 152 layers, respectively. All three networks use bottleneck blocks and their difference lies in the repetition time of residual blocks. ResNet converges very fast and can be trained with hundreds or thousands of layers.

<p align="center">
<img src="https://github.com/PaddlePaddle/book/blob/develop/03.image_classification/image/resnet.png?raw=true"><br/>
Expand Down
2 changes: 1 addition & 1 deletion 03.image_classification/index.cn.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
图9. 残差模块
</p>

图10展示了50、101、152层网络连接示意图,使用的是瓶颈模块。这三个模型的区别在于每组中残差模块的重复次数不同(见图右上角)。ResNet训练收敛较快,成功的训练了上百乃至近千层的卷积神经网络。
图10展示了50、116、152层网络连接示意图,使用的是瓶颈模块。这三个模型的区别在于每组中残差模块的重复次数不同(见图右上角)。ResNet训练收敛较快,成功的训练了上百乃至近千层的卷积神经网络。

<p align="center">
<img src="https://github.com/PaddlePaddle/book/blob/develop/03.image_classification/image/resnet.png?raw=true"><br/>
Expand Down
2 changes: 1 addition & 1 deletion 03.image_classification/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
Figure 9. Residual block
</p>

Figure 10 illustrates ResNets with 50, 101, 152 layers, respectively. All three networks use bottleneck blocks and their difference lies in the repetition time of residual blocks. ResNet converges very fast and can be trained with hundreds or thousands of layers.
Figure 10 illustrates ResNets with 50, 116, 152 layers, respectively. All three networks use bottleneck blocks and their difference lies in the repetition time of residual blocks. ResNet converges very fast and can be trained with hundreds or thousands of layers.

<p align="center">
<img src="https://github.com/PaddlePaddle/book/blob/develop/03.image_classification/image/resnet.png?raw=true"><br/>
Expand Down
22 changes: 11 additions & 11 deletions 05.recommender_system/README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Paddle在API中提供了自动加载数据的模块。数据模块为 `paddle.da
```python
import paddle
movie_info = paddle.dataset.movielens.movie_info()
print movie_info.values()[0]
print(list(movie_info.values())[0])
```


Expand All @@ -152,7 +152,7 @@ print movie_info.values()[0]

```python
movie_info = paddle.dataset.movielens.movie_info()
print movie_info.values()[0]
print(list(movie_info.values())[0])
```

<MovieInfo id(1), title(Toy Story ), categories(['Animation', "Children's", 'Comedy'])>
Expand All @@ -163,7 +163,7 @@ print movie_info.values()[0]

```python
user_info = paddle.dataset.movielens.user_info()
print user_info.values()[0]
print(list(user_info.values())[0])
```

<UserInfo id(1), gender(F), age(1), job(10)>
Expand Down Expand Up @@ -216,7 +216,7 @@ train_set_creator = paddle.dataset.movielens.train()
train_sample = next(train_set_creator())
uid = train_sample[0]
mov_id = train_sample[len(user_info[uid].value())]
print "User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1])
print("User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1]))
```

User <UserInfo id(1), gender(F), age(1), job(10)> rates Movie <MovieInfo id(1193), title(One Flew Over the Cuckoo's Nest ), categories(['Drama'])> with Score [5.0]
Expand Down Expand Up @@ -533,13 +533,13 @@ train_loop()
```python
infer_movie_id = 783
infer_movie_name = paddle.dataset.movielens.movie_info()[infer_movie_id].title
user_id = fluid.create_lod_tensor([[np.int64(1)]], [[1]], place)
gender_id = fluid.create_lod_tensor([[np.int64(1)]], [[1]], place)
age_id = fluid.create_lod_tensor([[np.int64(0)]], [[1]], place)
job_id = fluid.create_lod_tensor([[np.int64(10)]], [[1]], place)
movie_id = fluid.create_lod_tensor([[np.int64(783)]], [[1]], place) # Hunchback of Notre Dame
category_id = fluid.create_lod_tensor([np.array([10, 8, 9], dtype='int64')], [[3]], place) # Animation, Children's, Musical
movie_title = fluid.create_lod_tensor([np.array([1069, 4140, 2923, 710, 988], dtype='int64')], [[5]],
user_id = fluid.create_lod_tensor([[1]], [[1]], place)
gender_id = fluid.create_lod_tensor([[1]], [[1]], place)
age_id = fluid.create_lod_tensor([[0]], [[1]], place)
job_id = fluid.create_lod_tensor([[10]], [[1]], place)
movie_id = fluid.create_lod_tensor([[783]], [[1]], place) # Hunchback of Notre Dame
category_id = fluid.create_lod_tensor([[10, 8, 9]], [[3]], place) # Animation, Children's, Musical
movie_title = fluid.create_lod_tensor([[1069, 4140, 2923, 710, 988]], [[5]],
place) # 'hunchback','of','notre','dame','the'
```

Expand Down
8 changes: 4 additions & 4 deletions 05.recommender_system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Paddle provides modules for automatically loading data in the API. The data modu
```python
import paddle
movie_info = paddle.dataset.movielens.movie_info()
print movie_info.values()[0]
print(list(movie_info.values())[0])
```


Expand All @@ -138,7 +138,7 @@ For example, one of the movie features is:

```python
movie_info = paddle.dataset.movielens.movie_info()
print movie_info.values()[0]
print(list(movie_info.values())[0])
```

<MovieInfo id(1), title(Toy Story ), categories(['Animation', "Children's", 'Comedy'])>
Expand All @@ -149,7 +149,7 @@ This means that the movie id is 1, and the title is 《Toy Story》, which is di

```python
user_info = paddle.dataset.movielens.user_info()
print user_info.values()[0]
print(list(user_info.values())[0])
```

<UserInfo id(1), gender(F), age(1), job(10)>
Expand Down Expand Up @@ -202,7 +202,7 @@ train_set_creator = paddle.dataset.movielens.train()
train_sample = next(train_set_creator())
uid = train_sample[0]
mov_id = train_sample[len(user_info[uid].value())]
print "User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1])
print("User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1]))
```

```python
Expand Down
22 changes: 11 additions & 11 deletions 05.recommender_system/index.cn.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
```python
import paddle
movie_info = paddle.dataset.movielens.movie_info()
print movie_info.values()[0]
print(list(movie_info.values())[0])
```


Expand All @@ -194,7 +194,7 @@

```python
movie_info = paddle.dataset.movielens.movie_info()
print movie_info.values()[0]
print(list(movie_info.values())[0])
```

<MovieInfo id(1), title(Toy Story ), categories(['Animation', "Children's", 'Comedy'])>
Expand All @@ -205,7 +205,7 @@

```python
user_info = paddle.dataset.movielens.user_info()
print user_info.values()[0]
print(list(user_info.values())[0])
```

<UserInfo id(1), gender(F), age(1), job(10)>
Expand Down Expand Up @@ -258,7 +258,7 @@
train_sample = next(train_set_creator())
uid = train_sample[0]
mov_id = train_sample[len(user_info[uid].value())]
print "User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1])
print("User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1]))
```

User <UserInfo id(1), gender(F), age(1), job(10)> rates Movie <MovieInfo id(1193), title(One Flew Over the Cuckoo's Nest ), categories(['Drama'])> with Score [5.0]
Expand Down Expand Up @@ -575,13 +575,13 @@
```python
infer_movie_id = 783
infer_movie_name = paddle.dataset.movielens.movie_info()[infer_movie_id].title
user_id = fluid.create_lod_tensor([[np.int64(1)]], [[1]], place)
gender_id = fluid.create_lod_tensor([[np.int64(1)]], [[1]], place)
age_id = fluid.create_lod_tensor([[np.int64(0)]], [[1]], place)
job_id = fluid.create_lod_tensor([[np.int64(10)]], [[1]], place)
movie_id = fluid.create_lod_tensor([[np.int64(783)]], [[1]], place) # Hunchback of Notre Dame
category_id = fluid.create_lod_tensor([np.array([10, 8, 9], dtype='int64')], [[3]], place) # Animation, Children's, Musical
movie_title = fluid.create_lod_tensor([np.array([1069, 4140, 2923, 710, 988], dtype='int64')], [[5]],
user_id = fluid.create_lod_tensor([[1]], [[1]], place)
gender_id = fluid.create_lod_tensor([[1]], [[1]], place)
age_id = fluid.create_lod_tensor([[0]], [[1]], place)
job_id = fluid.create_lod_tensor([[10]], [[1]], place)
movie_id = fluid.create_lod_tensor([[783]], [[1]], place) # Hunchback of Notre Dame
category_id = fluid.create_lod_tensor([[10, 8, 9]], [[3]], place) # Animation, Children's, Musical
movie_title = fluid.create_lod_tensor([[1069, 4140, 2923, 710, 988]], [[5]],
place) # 'hunchback','of','notre','dame','the'
```

Expand Down
8 changes: 4 additions & 4 deletions 05.recommender_system/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
```python
import paddle
movie_info = paddle.dataset.movielens.movie_info()
print movie_info.values()[0]
print(list(movie_info.values())[0])
```


Expand All @@ -180,7 +180,7 @@

```python
movie_info = paddle.dataset.movielens.movie_info()
print movie_info.values()[0]
print(list(movie_info.values())[0])
```

<MovieInfo id(1), title(Toy Story ), categories(['Animation', "Children's", 'Comedy'])>
Expand All @@ -191,7 +191,7 @@

```python
user_info = paddle.dataset.movielens.user_info()
print user_info.values()[0]
print(list(user_info.values())[0])
```

<UserInfo id(1), gender(F), age(1), job(10)>
Expand Down Expand Up @@ -244,7 +244,7 @@
train_sample = next(train_set_creator())
uid = train_sample[0]
mov_id = train_sample[len(user_info[uid].value())]
print "User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1])
print("User %s rates Movie %s with Score %s"%(user_info[uid], movie_info[mov_id], train_sample[-1]))
```

```python
Expand Down
2 changes: 1 addition & 1 deletion 09.gan/README.cn.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 生成对抗网络

本教程源代码目录在book/09.gan,初次使用请您参考Book文档使用说明。
本教程源代码目录在[book/09.gan](https://github.com/PaddlePaddle/book/tree/develop/09.gan),初次使用请您参考Book文档使用说明。

### 说明: ###
1. 硬件环境要求:
Expand Down
2 changes: 1 addition & 1 deletion 09.gan/index.cn.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<div id="markdown" style='display:none'>
# 生成对抗网络

本教程源代码目录在book/09.gan,初次使用请您参考Book文档使用说明。
本教程源代码目录在[book/09.gan](https://github.com/PaddlePaddle/book/tree/develop/09.gan),初次使用请您参考Book文档使用说明。

### 说明: ###
1. 硬件环境要求:
Expand Down