> For the complete documentation index, see [llms.txt](https://baozoulin.gitbook.io/neural-networks-and-deep-learning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://baozoulin.gitbook.io/neural-networks-and-deep-learning/di-er-men-ke-gai-shan-shen-ceng-shen-jing-wang-luo-chao-can-shu-tiao-shi-zheng-ze-hua-yi-ji-you-hua/improving-deep-neural-networks/practical-aspects-of-deep-learning/112-ti-du-de-shu-zhi-bi-jin-ff08-numerical-approximation-of-gradients.md).

# 1.12 梯度的数值逼近（Numerical approximation of gradients）

Back Propagation神经网络有一项重要的测试是梯度检验（gradient checking）。其目的是检查验证反向传播过程中梯度下降算法是否正确。

![](/files/-Le0ccUMoXtbcRdkrVmb)

对于一个非零的$$\varepsilon$$，它的逼近误差可以写成$$O(\varepsilon^2)$$，$$\varepsilon$$值非常小，大写符号$$O$$的含义是指**逼近误差**

函数$$f$$在点$$\theta$$处的梯度可以表示成：

$$
g(\theta)=\frac{f(\theta+\varepsilon)-f(\theta-\varepsilon)}{2\varepsilon}
$$

$$\varepsilon>0$$，且足够小
