# 2.10 是否要使用端到端的深度学习？（Whether to use end-to-end learning?）

## 端到端学习的优点

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/2211e8807cc6d4c2c0941625e2de4860.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/2211e8807cc6d4c2c0941625e2de4860.png)

* **端到端学习只是让数据说话**。如果有足够多的$$(x,y)$$数据，不管从$$x$$到$$y$$最适合的函数映射是什么，如果训练一个足够大的神经网络，希望这个神经网络能自己搞清楚。使用纯机器学习方法，直接从$$x$$到$$y$$输入去训练神经网络，可能更能够捕获数据中的任何统计信息，而不是被迫引入人类的成见。例如在语音识别领域，早期的识别系统有这个音位概念，如果让学习算法学习它想学习的任意表示方式，而不是强迫使用音位作为表示方式，其整体表现可能会更好
* **所需手工设计的组件更少**，能够简化设计工作流程，不需要花太多时间去手工设计功能，手工设计中间表示方式

## 端到端学习的缺点

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/b73c65c89f8af6e000369e12f0303409.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/b73c65c89f8af6e000369e12f0303409.png)

* 直接学到$$x$$到$$y$$的映射，**需要大量**$$(x,y)$$**数据**
* **排除了可能有用的手工设计组件**。当有大量数据时，手工设计不太重要，当没有太多的数据时，构造一个精心设计的系统，可以将人类对这个问题的很多认识直接注入到问题里，对算法很有帮助

端到端深度学习的弊端之一是它把可能有用的人工设计的组件排除在外，精心设计的人工组件可能非常有用，但也可能真的影响算法表现。例如，强制算法以音位为单位思考，也许让算法自己找到更好的表示方法更好。但往往好处更多，手工设计的组件往往在训练集更小的时候帮助更大

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/93e5f8097f3246be83f704e468e72d76.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/93e5f8097f3246be83f704e468e72d76.png)

决定是否使用端到端深度学习，关键的问题是**是否有足够的数据能够直接学到从**$$x$$**映射到**$$y$$**足够复杂的函数**。识别图中骨头位置是相对简单的问题，系统不需要那么多数据。但把手的X射线照片直接映射到孩子的年龄，直接去找这种函数，就是更为复杂的问题。如果用纯端到端方法，需要很多数据去学习

![](https://2314428465-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Le0cHhI0S0DK8pwlrmD%2F-Le0cKOp1vaxoORIi4ak%2F-Le0cbEcbzheauKpIfD9%2F391import.png?generation=1556953089553545\&alt=media)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://baozoulin.gitbook.io/neural-networks-and-deep-learning/di-san-men-ke-jie-gou-hua-ji-qi-xue-xi-xiang-mu-structuring-machine-learning-projects/di-san-men-ke-structuring-machine-learning-projects/ml-strategy/210-shi-fou-yao-shi-yong-duan-dao-duan-de-shen-du-xue-xi-ff1f-ff08-whether-to-use-end-to-end-learnin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
