# 学习率eta

## 静态学习率

1. 确定$$\eta$$的量级： &#x20;

   尝试0.01、0.1、1等数值，找到使训练样本在第一轮迭代中cost下降的最大的$$\eta$$ &#x20;
2. 确定$$\eta$$的threshold：

   $$\eta$$的threshold为使训练样本在第一轮迭代中cost的下降的最大的$$\eta$$。

   例如$$\eta$$的量级为0.1，threshold在0.1到1之间。不需要太准确。 &#x20;
3. 比如$$\eta$$的threshold为0.5，书上取threshold的一半为比较好的$$\eta$$。 &#x20;

**问：为什么使用训练样本集来选择超参数**$$\eta$$**？**\
答：前文说过，训练样本用于训练模型，验证样本用于选择超参数，为什么在这里作者建议使用训练样本来选择超参数$$\eta$$？因为：\
1\. eta主要作用是控制模型的学习进度（训练模型），顺便提升准确率（验证模型）。而其它超参数的主要作用是提升准确率（验证模型）。\
2\. 作者个人喜好。

## 动态学习率

在训练开始时，模型错误比较大，可以使用较大的$$\eta$$。\
迭代一定次数后，模型错误较小，应该调整为较小的$$\eta$$。

作者介绍一次调整$$\eta$$的方法：\
1\. 先使用固定的$$\eta$$训练。\
2\. 迭代一定次数后，准确率开始下降，则按一定比例调小$$\eta$$，继续训练\
3\. 当当前$$\eta$$已经是初始$$\eta$$的一定比例，例如1/1000以后，停止迭代。


---

# 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-2/zen-yang-xuan-ze-chao-can-shu/2.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.
