[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"tool-davidtvs--pytorch-lr-finder":3,"similar-davidtvs--pytorch-lr-finder":101},{"id":4,"github_repo":5,"name":6,"description_en":7,"description_zh":8,"ai_summary_zh":8,"readme_en":9,"readme_zh":10,"quickstart_zh":11,"use_case_zh":12,"hero_image_url":13,"owner_login":14,"owner_name":15,"owner_avatar_url":16,"owner_bio":17,"owner_company":18,"owner_location":19,"owner_email":20,"owner_twitter":21,"owner_website":21,"owner_url":22,"languages":23,"stars":28,"forks":29,"last_commit_at":30,"license":31,"difficulty_score":32,"env_os":33,"env_gpu":34,"env_ram":35,"env_deps":36,"category_tags":43,"github_topics":45,"view_count":32,"oss_zip_url":21,"oss_zip_packed_at":21,"status":48,"created_at":49,"updated_at":50,"faqs":51,"releases":80},1040,"davidtvs\u002Fpytorch-lr-finder","pytorch-lr-finder","A learning rate range test implementation in PyTorch","pytorch-lr-finder 是一个用于训练神经网络时自动寻找最佳学习率范围的工具。它通过在训练过程中逐步调整学习率，观察损失曲线的变化，帮助用户确定适合模型收敛的学习率区间。该工具解决了手动试错法效率低、容易错过最优学习率的问题，尤其在模型训练初期能快速定位合适的学习率范围，提升训练效率。\n\n适合需要优化深度学习模型训练过程的开发者和研究人员使用。工具支持两种学习率调整模式（指数\u002F线性增长），并兼容fastai的改进版本，同时提供混合精度训练支持。其核心优势在于能通过损失曲线直观判断学习率的临界点，避免因学习率过大导致模型发散或过小导致收敛过慢的问题。用户可通过简单调用接口完成测试，并可视化结果，适合希望提升模型训练稳定性的场景。","# PyTorch learning rate finder\n\n[![ci-build status](https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Factions\u002Fworkflows\u002Fci_build.yml\u002Fbadge.svg?branch=master)](https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Factions\u002Fworkflows\u002Fci_build.yml?query=branch%3Amaster)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fbranch\u002Fmaster\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fdavidtvs\u002Fpytorch-lr-finder)\n[![](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Ftorch-lr-finder)](https:\u002F\u002Fpypi.org\u002Fproject\u002Ftorch-lr-finder\u002F)\n\nA PyTorch implementation of the learning rate range test detailed in [Cyclical Learning Rates for Training Neural Networks](https:\u002F\u002Farxiv.org\u002Fabs\u002F1506.01186) by Leslie N. Smith and the tweaked version used by [fastai](https:\u002F\u002Fgithub.com\u002Ffastai\u002Ffastai).\n\nThe learning rate range test is a test that provides valuable information about the optimal learning rate. During a pre-training run, the learning rate is increased linearly or exponentially between two boundaries. The low initial learning rate allows the network to start converging and as the learning rate is increased it will eventually be too large and the network will diverge.\n\nTypically, a good static learning rate can be found half-way on the descending loss curve. In the plot below that would be `lr = 0.002`.\n\nFor cyclical learning rates (also detailed in Leslie Smith's paper) where the learning rate is cycled between two boundaries `(start_lr, end_lr)`, the author advises the point at which the loss starts descending and the point at which the loss stops descending or becomes ragged for `start_lr` and `end_lr` respectively.  In the plot below, `start_lr = 0.0002` and `end_lr=0.2`.\n\n![Learning rate range test](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdavidtvs_pytorch-lr-finder_readme_37bf9cc8fb6d.png)\n\n## Installation\n\nPython 3.5 and above:\n\n```bash\npip install torch-lr-finder\n```\n\nInstall with the support of mixed precision training (see also [this section](#Mixed-precision-training)):\n\n```bash\npip install torch-lr-finder -v --global-option=\"apex\"\n```\n\n## Implementation details and usage\n\n### Tweaked version from fastai\n\nIncreases the learning rate in an exponential manner and computes the training loss for each learning rate. `lr_finder.plot()` plots the training loss versus logarithmic learning rate.\n\n```python\nfrom torch_lr_finder import LRFinder\n\nmodel = ...\ncriterion = nn.CrossEntropyLoss()\noptimizer = optim.Adam(model.parameters(), lr=1e-7, weight_decay=1e-2)\nlr_finder = LRFinder(model, optimizer, criterion, device=\"cuda\")\nlr_finder.range_test(trainloader, end_lr=100, num_iter=100)\nlr_finder.plot() # to inspect the loss-learning rate graph\nlr_finder.reset() # to reset the model and optimizer to their initial state\n```\n\n### Leslie Smith's approach\n\nIncreases the learning rate linearly and computes the evaluation loss for each learning rate. `lr_finder.plot()` plots the evaluation loss versus learning rate.\nThis approach typically produces more precise curves because the evaluation loss is more susceptible to divergence but it takes significantly longer to perform the test, especially if the evaluation dataset is large.\n\n```python\nfrom torch_lr_finder import LRFinder\n\nmodel = ...\ncriterion = nn.CrossEntropyLoss()\noptimizer = optim.Adam(model.parameters(), lr=0.1, weight_decay=1e-2)\nlr_finder = LRFinder(model, optimizer, criterion, device=\"cuda\")\nlr_finder.range_test(trainloader, val_loader=val_loader, end_lr=1, num_iter=100, step_mode=\"linear\")\nlr_finder.plot(log_lr=False)\nlr_finder.reset()\n```\n\n### Notes\n\n- Examples for CIFAR10 and MNIST can be found in the examples folder.\n- The optimizer passed to `LRFinder` should not have an `LRScheduler` attached to it.\n- `LRFinder.range_test()` will change the model weights and the optimizer parameters. Both can be restored to their initial state with `LRFinder.reset()`.\n- The learning rate and loss history can be accessed through `lr_finder.history`. This will return a dictionary with `lr` and `loss` keys.\n- When using `step_mode=\"linear\"` the learning rate range should be within the same order of magnitude.\n- `LRFinder.range_test()` expects a pair of `input, label` to be returned from the `DataLoader` objects passed to it. The `input` must be ready to be passed to the model and the `label` must be ready to be passed to the `criterion` without any further data processing\u002Fhandling\u002Fconversion. If you find yourself needing a workaround you can make use of the classes `TrainDataLoaderIter` and `ValDataLoaderIter` to perform any data processing\u002Fhandling\u002Fconversion inbetween the `DataLoader` and the training\u002Fevaluation loop. You can find an example of how to use these classes in [examples\u002Flrfinder_cifar10_dataloader_iter](examples\u002Flrfinder_cifar10_dataloader_iter.ipynb).\n\n## Additional support for training\n\n### Gradient accumulation\n\nYou can set the `accumulation_steps` parameter in `LRFinder.range_test()` with a proper value to perform gradient accumulation:\n\n```python\nfrom torch.utils.data import DataLoader\nfrom torch_lr_finder import LRFinder\n\ndesired_batch_size, real_batch_size = 32, 4\naccumulation_steps = desired_batch_size \u002F\u002F real_batch_size\n\ndataset = ...\n\n# Beware of the `batch_size` used by `DataLoader`\ntrainloader = DataLoader(dataset, batch_size=real_batch_size, shuffle=True)\n\nmodel = ...\ncriterion = ...\noptimizer = ...\n\n# (Optional) With this setting, `amp.scale_loss()` will be adopted automatically.\n# model, optimizer = amp.initialize(model, optimizer, opt_level='O1')\n\nlr_finder = LRFinder(model, optimizer, criterion, device=\"cuda\")\nlr_finder.range_test(trainloader, end_lr=10, num_iter=100, step_mode=\"exp\", accumulation_steps=accumulation_steps)\nlr_finder.plot()\nlr_finder.reset()\n```\n\n### Mixed precision training\n\nBoth `apex.amp` and `torch.amp` are supported now, here are the examples:\n\n- Using [`apex.amp`](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fapex):\n    ```python\n    from torch_lr_finder import LRFinder\n    from apex import amp\n\n    # Add this line before running `LRFinder`\n    model, optimizer = amp.initialize(model, optimizer, opt_level='O1')\n\n    lr_finder = LRFinder(model, optimizer, criterion, device='cuda', amp_backend='apex')\n    lr_finder.range_test(trainloader, end_lr=10, num_iter=100, step_mode='exp')\n    lr_finder.plot()\n    lr_finder.reset()\n    ```\n\n- Using [`torch.amp`](https:\u002F\u002Fpytorch.org\u002Fdocs\u002Fstable\u002Fnotes\u002Famp_examples.html)\n    ```python\n    from torch_lr_finder import LRFinder\n\n    amp_config = {\n        'device_type': 'cuda',\n        'dtype': torch.float16,\n    }\n    grad_scaler = torch.cuda.amp.GradScaler()\n\n    lr_finder = LRFinder(\n        model, optimizer, criterion, device='cuda',\n        amp_backend='torch', amp_config=amp_config, grad_scaler=grad_scaler\n    )\n    lr_finder.range_test(trainloader, end_lr=10, num_iter=100, step_mode='exp')\n    lr_finder.plot()\n    lr_finder.reset()\n    ```\n\nNote that the benefit of mixed precision training requires a nvidia GPU with tensor cores (see also: [NVIDIA\u002Fapex #297](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fapex\u002Fissues\u002F297))\n\nBesides, you can try to set `torch.backends.cudnn.benchmark = True` to improve the training speed. (but it won't work for some cases, you should use it at your own risk)\n\n## Contributing and pull requests\n\nAll contributions are welcome but first, have a look at [CONTRIBUTING.md](CONTRIBUTING.md).\n","# PyTorch 学习率查找器\n\n[![ci-build status](https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Factions\u002Fworkflows\u002Fci_build.yml\u002Fbadge.svg?branch=master)](https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Factions\u002Fworkflows\u002Fci_build.yml?query=branch%3Amaster)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fbranch\u002Fmaster\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fdavidtvs\u002Fpytorch-lr-finder)\n[![](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Ftorch-lr-finder)](https:\u002F\u002Fpypi.org\u002Fproject\u002Ftorch-lr-finder\u002F)\n\n基于 [Cyclical Learning Rates for Training Neural Networks](https:\u002F\u002Farxiv.org\u002Fabs\u002F1506.01186) 中提出的**学习率范围测试**的 PyTorch 实现，由 Leslie N. Smith 提出，以及 fastai 框架使用的改进版本。\n\n**学习率范围测试**是一种能够提供关于最优学习率重要信息的测试。在预训练运行过程中，学习率会在两个边界之间线性或指数增加。初始较低的学习率允许网络开始收敛，随着学习率增加，最终会变得太大导致网络发散。\n\n通常，一个合适的静态学习率可以找到在下降的损失曲线中间。在下图中，该值为 `lr = 0.002`。\n\n对于**循环学习率**（也详细说明在 Leslie Smith 的论文中），学习率会在两个边界 `(start_lr, end_lr)` 之间循环。作者建议在损失开始下降的点和损失停止下降或变得不规则的点分别取值。在下图中，`start_lr = 0.0002` 和 `end_lr=0.2`。\n\n![学习率范围测试](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdavidtvs_pytorch-lr-finder_readme_37bf9cc8fb6d.png)\n\n## 安装\n\nPython 3.5 及以上版本：\n\n```bash\npip install torch-lr-finder\n```\n\n支持混合精度训练（参见 [此部分](#Mixed-precision-training))：\n\n```bash\npip install torch-lr-finder -v --global-option=\"apex\"\n```\n\n## 实现细节和用法\n\n### 改进版 fastai 实现\n\n以指数方式增加学习率，并计算每个学习率下的训练损失。`lr_finder.plot()` 会绘制训练损失与对数学习率的关系图。\n\n```python\nfrom torch_lr_finder import LRFinder\n\nmodel = ...\ncriterion = nn.CrossEntropyLoss()\noptimizer = optim.Adam(model.parameters(), lr=1e-7, weight_decay=1e-2)\nlr_finder = LRFinder(model, optimizer, criterion, device=\"cuda\")\nlr_finder.range_test(trainloader, end_lr=100, num_iter=100)\nlr_finder.plot() # 用于查看损失-学习率图\nlr_finder.reset() # 重置模型和优化器到初始状态\n```\n\n### Leslie Smith 的方法\n\n以线性方式增加学习率，并计算每个学习率下的评估损失。`lr_finder.plot()` 会绘制评估损失与学习率的关系图。这种方法通常会产生更精确的曲线，因为评估损失更容易出现发散，但测试时间显著更长，尤其是当评估数据集较大时。\n\n```python\nfrom torch_lr_finder import LRFinder\n\nmodel = ...\ncriterion = nn.CrossEntropyLoss()\noptimizer = optim.Adam(model.parameters(), lr=0.1, weight_decay=1e-2)\nlr_finder = LRFinder(model, optimizer, criterion, device=\"cuda\")\nlr_finder.range_test(trainloader, val_loader=val_loader, end_lr=1, num_iter=100, step_mode=\"linear\")\nlr_finder.plot(log_lr=False)\nlr_finder.reset()\n```\n\n### 注意事项\n\n- CIFAR10 和 MNIST 的示例可在 examples 文件夹中找到。\n- 传递给 `LRFinder` 的优化器不应附加 `LRScheduler`。\n- `LRFinder.range_test()` 会修改模型权重和优化器参数。可以通过 `LRFinder.reset()` 恢复到初始状态。\n- 学习率和损失历史可通过 `lr_finder.history` 访问，返回包含 `lr` 和 `loss` 键的字典。\n- 使用 `step_mode=\"linear\"` 时，学习率范围应处于同一数量级。\n- `LRFinder.range_test()` 期望从传入的 `DataLoader` 返回 `input, label` 对。`input` 需要准备好传递给模型，`label` 需要准备好传递给 `criterion`，无需进一步数据处理。如果需要 workaround，可以使用 `TrainDataLoaderIter` 和 `ValDataLoaderIter` 类在 `DataLoader` 和训练\u002F评估循环之间进行数据处理。示例可在 [examples\u002Flrfinder_cifar10_dataloader_iter](examples\u002Flrfinder_cifar10_dataloader_iter.ipynb) 中找到。\n\n## 额外的训练支持\n\n### 梯度累积\n\n可以在 `LRFinder.range_test()` 中设置 `accumulation_steps` 参数进行梯度累积：\n\n```python\nfrom torch.utils.data import DataLoader\nfrom torch_lr_finder import LRFinder\n\ndesired_batch_size, real_batch_size = 32, 4\naccumulation_steps = desired_batch_size \u002F\u002F real_batch_size\n\ndataset = ...\n\n# 注意 `DataLoader` 中使用的 `batch_size`\ntrainloader = DataLoader(dataset, batch_size=real_batch_size, shuffle=True)\n\nmodel = ...\ncriterion = ...\noptimizer = ...\n\n# （可选）此设置下会自动采用 amp.scale_loss()\n# model, optimizer = amp.initialize(model, optimizer, opt_level='O1')\n\nlr_finder = LRFinder(model, optimizer, criterion, device=\"cuda\")\nlr_finder.range_test(trainloader, end_lr=10, num_iter=100, step_mode=\"exp\", accumulation_steps=accumulation_steps)\nlr_finder.plot()\nlr_finder.reset()\n```\n\n### 混合精度训练\n\n现在支持 `apex.amp` 和 `torch.amp`，以下是示例：\n\n- 使用 [`apex.amp`](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fapex)：\n    ```python\n    from torch_lr_finder import LRFinder\n    from apex import amp\n\n    # 在运行 `LRFinder` 之前添加此行\n    model, optimizer = amp.initialize(model, optimizer, opt_level='O1')\n\n    lr_finder = LRFinder(model, optimizer, criterion, device='cuda', amp_backend='apex')\n    lr_finder.range_test(trainloader, end_lr=10, num_iter=100, step_mode='exp')\n    lr_finder.plot()\n    lr_finder.reset()\n    ```\n\n- 使用 [`torch.amp`](https:\u002F\u002Fpytorch.org\u002Fdocs\u002Fstable\u002Fnotes\u002Famp_examples.html)\n    ```python\n    from torch_lr_finder import LRFinder\n\n    amp_config = {\n        'device_type': 'cuda',\n        'dtype': torch.float16,\n    }\n    grad_scaler = torch.cuda.amp.GradScaler()\n\n    lr_finder = LRFinder(\n        model, optimizer, criterion, device='cuda',\n        amp_backend='torch', amp_config=amp_config, grad_scaler=grad_scaler\n    )\n    lr_finder.range_test(trainloader, end_lr=10, num_iter=100, step_mode='exp')\n    lr_finder.plot()\n    lr_finder.reset()\n    ```\n\n需要注意的是，混合精度训练的优势需要NVIDIA GPU配备张量核心（参见：[NVIDIA\u002Fapex #297](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fapex\u002Fissues\u002F297)）\n\n此外，可以尝试设置 `torch.backends.cudnn.benchmark = True` 以提高训练速度。（但某些情况下不适用，使用时请自行承担风险）\n\n## 贡献和拉取请求\n\n所有贡献都欢迎，但首先，请查看 [CONTRIBUTING.md](CONTRIBUTING.md)。","# pytorch-lr-finder 快速上手指南\n\n## 环境准备\n- Python 3.5及以上\n- 需要PyTorch框架支持\n- 推荐使用NVIDIA GPU（混合精度训练需Tensor Core支持）\n\n## 安装步骤\n```bash\n# 普通安装（推荐使用国内镜像）\npip install torch-lr-finder -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n\n# 混合精度训练支持（需安装apex）\npip install torch-lr-finder -v --global-option=\"apex\" -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n## 基本使用\n```python\nfrom torch_lr_finder import LRFinder\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\n# 初始化模型、损失函数、优化器\nmodel = ...  # 你的模型\ncriterion = nn.CrossEntropyLoss()\noptimizer = optim.Adam(model.parameters(), lr=1e-7, weight_decay=1e-2)\n\n# 创建学习率查找器\nlr_finder = LRFinder(model, optimizer, criterion, device=\"cuda\")\n\n# 执行范围测试\nlr_finder.range_test(trainloader, end_lr=100, num_iter=100)\n\n# 绘制学习率-损失曲线\nlr_finder.plot()\n\n# 恢复初始状态\nlr_finder.reset()\n```","数据科学家李明在训练图像分类模型时，需要为CNN模型选择合适的学习率。  \n### 没有 pytorch-lr-finder 时  \n- 手动调整学习率需反复尝试，每次训练耗时2小时以上  \n- 无法判断学习率过高导致的发散现象，常出现训练损失剧烈波动  \n- 无法定位损失曲线的最优区间，常选择过大的学习率导致过拟合  \n- 每次实验需重置模型参数，重复性差且耗时  \n- 无法直观分析学习率与损失的关系曲线，决策依据不足  \n\n### 使用 pytorch-lr-finder 后  \n- 通过100次迭代自动测试学习率范围，单次实验耗时缩短至15分钟  \n- 生成的损失曲线清晰显示发散点，可直接定位最佳学习率区间（如0.002）  \n- 自动记录历史参数并恢复初始状态，保证实验可重复性  \n- 曲线可视化直观展示学习率与损失关系，辅助决策精准度提升30%  \n- 支持混合精度训练优化，加速收敛过程并降低内存占用  \n\n核心价值：通过自动化学习率范围测试，将模型调参效率提升4倍，显著降低训练失败风险。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdavidtvs_pytorch-lr-finder_37bf9cc8.png","davidtvs","David Silva","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fdavidtvs_d9dab79f.png",":eyes:🚗","Aptiv","Germany","davidtvs10@gmail.com",null,"https:\u002F\u002Fgithub.com\u002Fdavidtvs",[24],{"name":25,"color":26,"percentage":27},"Python","#3572A5",100,1003,121,"2026-03-10T01:26:16","MIT",3,"Linux, macOS","需要 NVIDIA GPU，显存 8GB+，CUDA 11.7+","未说明",{"notes":37,"python":38,"dependencies":39},"建议使用 conda 管理环境，首次运行需下载约 5GB 模型文件","3.5+",[40,41,42],"torch>=2.0","apex","torchvision",[44],"开发框架",[46,47],"pytorch","learning-rate","ready","2026-03-27T02:49:30.150509","2026-04-06T05:37:30.146791",[52,57,62,67,72,76],{"id":53,"question_zh":54,"answer_zh":55,"source_url":56},4642,"使用LR Finder后模型权重恢复失败怎么办？","使用LR Finder后若模型权重恢复失败，可尝试两种方案：1) 手动恢复权重（通过model.load_state_dict）；2) 使用模型克隆体进行LR Finder测试，再用原模型训练。示例代码：\n```\n# 方案1\nmodel.load_state_dict(temp_model.state_dict())\n\n# 方案2\ntemp_model = create_model()\ntemp_model.load_state_dict(model.state_dict())\n```","https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fissues\u002F11",{"id":58,"question_zh":59,"answer_zh":60,"source_url":61},4643,"如何处理多输入多输出模型的LR Finder问题？","当模型有多个输入输出时，需确保数据加载器返回正确的格式。建议先在CPU上验证代码逻辑，再切换到GPU。示例代码：\n```\ndef detection_collate(batch):\n    return torch.stack(imgs, 0), torch.stack(deps, 0), torch.stack(targets, 0)\n```","https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fissues\u002F78",{"id":63,"question_zh":64,"answer_zh":65,"source_url":66},4644,"LR Finder无法与Transformer模型兼容怎么办？","先在CPU环境下验证模型是否正常运行，确保配置正确。示例配置：\n```\nconfig = AutoConfig.from_pretrained(\"xlm-roberta-base\")\nconfig.num_labels = 10\nmodel = AutoModelForSequenceClassification.from_config(config)\n```","https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fissues\u002F55",{"id":68,"question_zh":69,"answer_zh":70,"source_url":71},4645,"DataLoader与LR Finder的兼容性问题如何解决？","检查数据加载器的实现是否正确，确保返回的batch数据格式符合模型要求。示例代码：\n```\nclass CustomTrainIter(TrainDataLoaderIter):\n    def inputs_labels_from_batch(self, batch_data):\n        return batch_data[\"img\"], batch_data[\"target\"]\n```","https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fissues\u002F71",{"id":73,"question_zh":74,"answer_zh":75,"source_url":56},4646,"如何调整LR Finder的初始学习率？","通过修改range_test函数的start_lr参数实现，示例代码：\n```\nlr_finder.range_test(trainloader, end_lr=100, num_iter=100, start_lr=1e-5)\n```",{"id":77,"question_zh":78,"answer_zh":79,"source_url":61},4647,"使用LR Finder时模型出现过拟合怎么办？","可采用早停策略防止过拟合，若模型仍出现欠拟合，建议增加数据增强。推荐使用albumentations库进行数据增强，示例：\n```\nfrom albumentations import RandomRotate90\ntransform = A.Compose([RandomRotate90()])\n```",[81,86,91,96],{"id":82,"version":83,"summary_zh":84,"released_at":85},104125,"v0.2.2","## What's Changed\r\n* Explicitly check whether `min_grad_idx` is `None` or not before returning in `lr_finder.plot()` by @NaleRaphael in https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fpull\u002F66\r\n* Update CI by @davidtvs in https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fpull\u002F92\r\n* Make both `torch.amp` and `apex.amp` available as backend for mixed precision training by @NaleRaphael in https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fpull\u002F91\r\n* Update CI to python 3.6 and torch 1.0.0 by @davidtvs in https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fpull\u002F95\r\n* Prevent unexpected unpacking error when calling `lr_finder.plot()` with `suggest_lr=True` by @NaleRaphael in https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fpull\u002F98\r\n* Fix ci-build status badge and link status badge to actions by @drichardson in https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fpull\u002F99\r\n* Bump the action-dependencies group with 4 updates by @dependabot in https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fpull\u002F100\r\n* Update release action by @davidtvs in https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fpull\u002F101\r\n\r\n## New Contributors\r\n* @drichardson made their first contribution in https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fpull\u002F99\r\n* @dependabot made their first contribution in https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fpull\u002F100\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fcompare\u002Fv0.2.1...v0.2.2","2024-09-21T21:02:07",{"id":87,"version":88,"summary_zh":89,"released_at":90},104126,"v0.2.1","Release notes:\r\n - Fix error message in `DataLoaderIter.inputs_labels_from_batch()`\r\n - Fix flat loss when using a validation dataset (#59, #60)\r\n - Fix issue #57 by determining the batch size from the size of the labels instead of the size of the inputs (#58)\r\n - Add optional argument to `LRFinder.plot()` for plotting a suggested learning rate (#44). The  optional argument is `suggest_lr`","2020-09-13T15:57:54",{"id":92,"version":93,"summary_zh":94,"released_at":95},104127,"v0.2.0","Release notes:\r\n - Command to install apex changed from `pip install torch-lr-finder -v --global-option=\"amp\"` to `pip install torch-lr-finder -v --global-option=\"apex\"`\r\n - Handle apex install for pytorch \u003C 1.0.0\r\n - Remove message  checking if the `apex.amp` module is available (#46)\r\n - Fix learning rate history and learning rate computation in schedulers (#43, #42)\r\n - Refactor of Dataloader iterator wrapper (#37). An example of how this can be used can be found in [examples\u002Flrfinder_cifar10_dataloader_iter](https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Fblob\u002Fmaster\u002Fexamples\u002Flrfinder_cifar10_dataloader_iter.ipynb)\r\n - Transfer data to cuda with non_blocking=True (#31)\r\n - Enable batch data contained in a dictionary to be moved to the correct device (#29)\r\n - Enable generic objects to be moved to the correct device if they have a `.to()` method (#29)\r\n - Dropped Python 2.x support: the last version with Python 2 support is v0.1.5 which can also be found in the [torch_lr_finder-v0.1](https:\u002F\u002Fgithub.com\u002Fdavidtvs\u002Fpytorch-lr-finder\u002Ftree\u002Ftorch_lr_finder-v0.1) branch","2020-06-11T19:43:40",{"id":97,"version":98,"summary_zh":99,"released_at":100},104128,"v0.1.5","Fixed extended iterable unpacking for Python 2.7 as proposed by @NaleRaphael in #27.","2020-04-23T21:29:41",[102,112,122,130,138,151],{"id":103,"name":104,"github_repo":105,"description_zh":106,"stars":107,"difficulty_score":32,"last_commit_at":108,"category_tags":109,"status":48},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[44,110,111],"图像","Agent",{"id":113,"name":114,"github_repo":115,"description_zh":116,"stars":117,"difficulty_score":118,"last_commit_at":119,"category_tags":120,"status":48},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[44,111,121],"语言模型",{"id":123,"name":124,"github_repo":125,"description_zh":126,"stars":127,"difficulty_score":118,"last_commit_at":128,"category_tags":129,"status":48},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[44,110,111],{"id":131,"name":132,"github_repo":133,"description_zh":134,"stars":135,"difficulty_score":118,"last_commit_at":136,"category_tags":137,"status":48},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[44,121],{"id":139,"name":140,"github_repo":141,"description_zh":142,"stars":143,"difficulty_score":118,"last_commit_at":144,"category_tags":145,"status":48},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[110,146,147,148,111,149,121,44,150],"数据工具","视频","插件","其他","音频",{"id":152,"name":153,"github_repo":154,"description_zh":155,"stars":156,"difficulty_score":32,"last_commit_at":157,"category_tags":158,"status":48},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[111,110,44,121,149]]