# 关于代价函数的两个假设

反向传播算法的目标：**求出代价函数C在任意w、b处的偏导**$$\partial C / \partial w$$**和**$$\partial C / \partial b$$。

反向传播函数对代价函数有两个假设，以第一章所使用的二次代价函数为例：

$$
\begin{eqnarray}
C = \frac{1}{2n} \sum\_x |y(x)-a^L(x)|^2,
\tag{26}\end{eqnarray}
$$

## 假设一

假设一：代价函数C可以写成每个样本的代价函数之和的形式

$$
C = \frac{1}{n} \sum\_x C\_x
$$

例如对于公式26来说，有

$$
C\_x = \frac{1}{2} |y-a^L |^2 \tag{1}
$$

问：为什么会有这样的假设？ 答：因为反向传播算法是针对每个样本单独计算偏导的。

## 假设二

假设二：代价函数$$C\_x$$可以写成神经元视角的形式。\
\&#xNAN;*神经元视角是我发明的词，我不知道怎么表达这种形式。参见*[*link*](https://windmising.gitbook.io/nielsen-nndl/introduction-1/assumptions)

例如公式（1）可以写成

$$
\begin{eqnarray}
C = \frac{1}{2} |y-a^L|^2 = \frac{1}{2} \sum\_j (y\_j-a^L\_j)^2,
\tag{27}\end{eqnarray}
$$


---

# 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://windmising.gitbook.io/nielsen-nndl/introduction-1/assumptions.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.
