[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-sail-sg--Adan":3,"tool-sail-sg--Adan":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},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",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},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",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},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",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},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",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":79,"owner_company":80,"owner_location":80,"owner_email":80,"owner_twitter":80,"owner_website":81,"owner_url":82,"languages":83,"stars":100,"forks":101,"last_commit_at":102,"license":103,"difficulty_score":23,"env_os":104,"env_gpu":105,"env_ram":106,"env_deps":107,"category_tags":118,"github_topics":119,"view_count":10,"oss_zip_url":80,"oss_zip_packed_at":80,"status":16,"created_at":139,"updated_at":140,"faqs":141,"releases":172},930,"sail-sg\u002FAdan","Adan","Adan: Adaptive Nesterov Momentum Algorithm for Faster Optimizing Deep Models","Adan 是一种专为深度学习模型优化设计的自适应优化算法，全称为 Adaptive Nesterov Momentum Algorithm。它通过改进梯度更新的方式，显著提升了训练速度和效率，特别是在大规模深度模型（如语言模型、视觉模型等）中表现出色。相比传统的优化器（如 Adam 或 SGD），Adan 在收敛速度和最终性能上都有明显优势。\n\nAdan 主要解决了深度学习模型训练过程中优化效率低下的问题，尤其是在处理复杂任务（如文本生成 3D 模型、扩散模型等）时，传统优化器可能需要大量调参或更长的训练时间。Adan 通过引入自适应动量机制和梯度裁剪等技术，不仅提高了优化的稳定性，还减少了内存占用，使得训练过程更加高效。\n\n这款优化器非常适合从事深度学习研究的研究人员和开发者使用，尤其是那些专注于计算机视觉、自然语言处理和生成式 AI 的用户。如果你正在训练大型模型（如 GPT-2 或 MoE），或者希望在有限资源下获得更快的训练效果，Adan 将是一个非常实用的选择。\n\n技术亮点方面，Adan 提供了 FusedAdan 版本，进一步降低了内存消耗；同时，它已经被多个主流框架（如 ","Adan 是一种专为深度学习模型优化设计的自适应优化算法，全称为 Adaptive Nesterov Momentum Algorithm。它通过改进梯度更新的方式，显著提升了训练速度和效率，特别是在大规模深度模型（如语言模型、视觉模型等）中表现出色。相比传统的优化器（如 Adam 或 SGD），Adan 在收敛速度和最终性能上都有明显优势。\n\nAdan 主要解决了深度学习模型训练过程中优化效率低下的问题，尤其是在处理复杂任务（如文本生成 3D 模型、扩散模型等）时，传统优化器可能需要大量调参或更长的训练时间。Adan 通过引入自适应动量机制和梯度裁剪等技术，不仅提高了优化的稳定性，还减少了内存占用，使得训练过程更加高效。\n\n这款优化器非常适合从事深度学习研究的研究人员和开发者使用，尤其是那些专注于计算机视觉、自然语言处理和生成式 AI 的用户。如果你正在训练大型模型（如 GPT-2 或 MoE），或者希望在有限资源下获得更快的训练效果，Adan 将是一个非常实用的选择。\n\n技术亮点方面，Adan 提供了 FusedAdan 版本，进一步降低了内存消耗；同时，它已经被多个主流框架（如 PyTorch、NVIDIA NeMo 和 Huggingface Timm）支持，开箱即用，方便集成到现有项目中。无论是学术研究还是工业应用，Adan 都能为你的模型训练带来显著提升。","# Adan: Adaptive Nesterov Momentum Algorithm for Faster Optimizing Deep Models\n\nThis is an official PyTorch implementation of **Adan**. See the paper [here](https:\u002F\u002Farxiv.org\u002Fabs\u002F2208.06677). If you find our adan helpful or heuristic to your projects, please cite this paper and also star this repository. Thanks!\n\n```tex\n@article{xie2024adan,\n  title={Adan: Adaptive Nesterov Momentum Algorithm for Faster Optimizing Deep Models},\n  author={Xie, Xingyu and Zhou, Pan and Li, Huan and Lin, Zhouchen and Yan, Shuicheng},\n  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},\n  year={2024},\n  publisher={IEEE}\n}\n```\n\n## Supported Projects\n- Riemannian version of Adan (Radan), included in [Manify](https:\u002F\u002Fgithub.com\u002Fpchlenski\u002Fmanify) — a non-Euclidean machine learning library.\n- Adan is supported in the framework [NeMo](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNeMo\u002Fblob\u002Fmain\u002Fnemo\u002Fcore\u002Foptim\u002Fadan.py) from [NVIDIA](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNeMo).\n- Adan is the default optimizer for the High-Fidelity Text-to-3D Generation Project. See more details [Consistent3D](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FConsistent3D).\n- Adan is the default optimizer for Masked Diffusion Transformer V2. See more details [MDT V2](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FMDT).\n- Adan is supported in the Project [D-Adaptation](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fdadaptation) from [Meta AI](https:\u002F\u002Fgithub.com\u002Ffacebookresearch).\n- Adan will be supported in the Project [Paddle](https:\u002F\u002Fgithub.com\u002FPaddlePaddle\u002FPaddle\u002Fpull\u002F55048#commits-pushed-563d32c) from [Baidu(百度飞浆)](https:\u002F\u002Fgithub.com\u002FPaddlePaddle\u002FPaddle).\n- Adan is supported in [Timm](https:\u002F\u002Fgithub.com\u002Frwightman\u002Fpytorch-image-models) from [Huggingface](https:\u002F\u002Fgithub.com\u002Fhuggingface)\n- Adan is the default optimizer in the text-to-3D [DreamFusion Project](https:\u002F\u002Fgithub.com\u002Fashawkey\u002Fstable-dreamfusion). See more results [here](.\u002Fdreamfusion\u002F).\n- Adan is supported in the [MMClassification](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmclassification\u002Ftree\u002Fdev-1.x) of the [OpenMMLab](https:\u002F\u002Fopenmmlab.com\u002F) project. The log and example of using Adan to train ViT-B is [here](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmclassification\u002Fpull\u002F1180).\n- TF's implementation (third party) refers to [DenisVorotyntsev\u002FAdan](https:\u002F\u002Fgithub.com\u002FDenisVorotyntsev\u002FAdan).\n- JAX's version (third party) is implemented and also supported in [Deepmind\u002Foptax](https:\u002F\u002Fgithub.com\u002Fdeepmind\u002Foptax).\n\n  \n## News\n- :fire::fire::fire: Results on large language models, like **MoE and GPT2**, are released.\n- FusedAdan with less memory footprint is released.\n\n\n______________________________________________________________________\n\n## Installation\n\n```\npython3 -m pip install git+https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan.git\n```\nFusedAdan is installed by default. If you want to use the original Adan, please install it by:\n```\ngit clone https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan.git\ncd Adan\npython3 setup.py install --unfused\n```\n\n## Usage\n\nFor your convenience to use Adan, we briefly provide some intuitive instructions below, then provide some general experimental tips, and finally provide more details (e.g., specific commands and hyper-parameters) for each experiment in the paper.\n\n#### 1) Two steps to use Adan\n\n**Step 1.** Add Adan-dependent hyper-parameters by adding the following hyper-parameters to the config:\n\n```python\nparser.add_argument('--max-grad-norm', type=float, default=0.0, help='if the l2 norm is large than this hyper-parameter, then we clip the gradient  (default: 0.0, no gradient clip)')\nparser.add_argument('--weight-decay', type=float, default=0.02,  help='weight decay, similar one used in AdamW (default: 0.02)')\nparser.add_argument('--opt-eps', default=None, type=float, metavar='EPSILON', help='optimizer epsilon to avoid the bad case where second-order moment is zero (default: None, use opt default 1e-8 in adan)')\nparser.add_argument('--opt-betas', default=None, type=float, nargs='+', metavar='BETA', help='optimizer betas in Adan (default: None, use opt default [0.98, 0.92, 0.99] in Adan)')\nparser.add_argument('--no-prox', action='store_true', default=False, help='whether perform weight decay like AdamW (default=False)')\n```\n\n`opt-betas`: To keep consistent with our usage habits, the $\\beta$'s in the paper are actually the $(1-\\beta)$'s in the code.\n\n`foreach (bool)`: If `True`, Adan will use the `torch._foreach` implementation. It is faster but uses slightly more memory.\n\n`no-prox`: It determines the update rule of parameters with weight decay. By default, Adan updates the parameters in the way presented in Algorithm 1 in the paper:\n\n$$\\boldsymbol{\\theta}\\_{k+1} = ( 1+\\lambda \\eta)^{-1} \\left[\\boldsymbol{\\theta}\\_k - \\boldsymbol{\\eta}\\_k \\circ (\\mathbf{m}\\_k+(1-{\\color{blue}\\beta_2})\\mathbf{v}_k)\\right]$$\n\nBut one can also update the parameter like Adamw:\n\n$$\\boldsymbol{\\theta}\\_{k+1} = ( 1-\\lambda \\eta)\\boldsymbol{\\theta}\\_k - \\boldsymbol{\\eta}\\_k \\circ (\\mathbf{m}\\_k+(1-{\\color{blue}\\beta_2})\\mathbf{v}\\_k).$$\n\n**Step 2.** Create the Adan optimizer as follows. In this step, we can directly replace the vanilla optimizer by using the following command:\n\n```python\nfrom adan import Adan\noptimizer = Adan(param, lr=args.lr, weight_decay=args.weight_decay, betas=args.opt_betas, eps = args.opt_eps, max_grad_norm=args.max_grad_norm, no_prox=args.no_prox)\n```\n\n#### 2) Tips for Experiments\n\n- To make Adan simple, in all experiments except Table 12 in the paper, we do not use the restart strategy in Adan. But Table 12 shows that the restart strategy can further slightly improve the performance of Adan.\n- Adan often allows one to use a large peak learning rate which often fails other optimizers, e.g., Adam and AdamW. For example, in all experiments except for the MAE pre-training and LSTM, the learning rate used by Adan is **5-10 times** larger than that in Adam\u002FAdamW.\n- Adan is relatively robust to `beta1`, `beta2,` and `beta3`, especially for `beta2`. If you want better performance, you can first tune `beta3` and then `beta1`.\n- Adan has a slightly higher GPU memory cost than Adam\u002FAdamW on a single node. However, this problem can be solved using the [ZeroRedundancyOptimizer](https:\u002F\u002Fpytorch.org\u002Ftutorials\u002Frecipes\u002Fzero_redundancy_optimizer.html), which shares optimizer states across distributed data-parallel processes to reduce per-process memory footprint. Specifically, when using the `ZeroRedundancyOptimizer` on more than two GPUs, **Adan and Adam consume almost the same amount of memory.**\n\n#### 3) More extra detailed steps&results\n\nPlease refer to the following links for detailed steps. In these detailed steps, we even include the **docker images** for reproducibility.\n\n- [Instruction](.\u002FCV\u002Ftimm\u002F) for **\u003Cu>ViTs\u003C\u002Fu>**, **\u003Cu>ResNets\u003C\u002Fu>**, and **\u003Cu>ConvNext\u003C\u002Fu>**.\n- [Instruction](.\u002FCV\u002FMAE\u002F) for **\u003Cu>MAE\u003C\u002Fu>**.\n- [Instruction](.\u002FNLP\u002FBERT\u002F) for **\u003Cu>BERT\u003C\u002Fu>**.\n- [Instruction](.\u002FNLP\u002FTransformer-XL\u002F) for **\u003Cu>Transformer-XL\u003C\u002Fu>**.\n- [Instruction](.\u002Fgpt2\u002F) for **\u003Cu>GPT2\u003C\u002Fu>**\n- [Resutls](.\u002Fdreamfusion\u002F) for **\u003Cu> text-to-3D DreamFusion\u003C\u002Fu>**.\n\n## Results for Various Tasks\n\n### Results on Large Language Models\n\n#### Mixture of Experts (MoE)\nTo investigate the efficacy of the Adan optimizer for LLMs, we conducted pre-training experiments using [MoE models](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2406.06563). The experiments utilized the [RedPajama-v2 dataset](https:\u002F\u002Fgithub.com\u002Ftogethercomputer\u002FRedPajama-Data) with three configurations, each consisting of 8 experts: **8x0.1B** (totaling 0.5B trainable parameters), **8x0.3B** (2B trainable parameters), and **8x0.6B** (4B trainable parameters). These models were trained with sampled data comprising **10B, 30B, 100B, and 300B tokens**, respectively.\n\n| Model Size |   8x0.1B  |   8x0.1B  |   8x0.1B  |   8x0.3B  |   8x0.3B  |   8x0.3B  |   8x0.6B  |\n|:----------:|:---------:|:---------:|:---------:|:---------:|:---------:|:---------:|:---------:|\n| Token Size |    10B    |    30B    |    100B   |    30B    |    100B   |    300B   |    300B   |\n|    AdamW   |   2.722   |   2.550   |   2.427   |   2.362   |   2.218   |   2.070   |   2.023   |\n|    Adan    | **2.697** | **2.513** | **2.404** | **2.349** | **2.206** | **2.045** | **2.010** |\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsail-sg_Adan_readme_5a31fe2077a3.png\" width=\"58%\" \u002F>\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsail-sg_Adan_readme_6a0c068ae253.png\" width=\"40%\" \u002F>\n\u003C\u002Fp>\n\n#### GPT2-345m\n\nWe provide the config and log for GPT2-345m pre-trained on the dataset that comes from [BigCode](https:\u002F\u002Fwww.bigcode-project.org\u002F) and evaluated on the [HumanEval](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fhuman-eval) dataset by zero-shot learning. [HumanEval](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fhuman-eval) is used to measure functional correctness for synthesizing programs from docstrings. It consists of 164 original programming problems, assessing language comprehension, algorithms, and simple mathematics, with some comparable to simple software interview questions. We set ` Temperature = 0.8` during evaluation.\n\n|                  | Steps | pass@1 | pass@10 | pass@100 |                                  Download                                  |\n| ---------------- | :---: | :----: | :-----: | :------: | :------------------------------------------------------------------------: |\n| GPT2-345m (Adam) | 300k  | 0.0840 |  0.209  |  0.360   | [log&config](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Ffiles\u002F10362486\u002Fgpt2-adam.log) |\n| GPT2-345m (Adan) | 150k  | 0.0843 |  0.221  |  0.377   | [log&config](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Ffiles\u002F10362485\u002Fgpt2-adan.log) |\n\n\u003Cu>**Adan obtains comparable results with only half cost**\u003C\u002Fu>.\n\n### Results on vision tasks\n\nFor your convenience to use Adan, we provide the configs and log files for the experiments on ImageNet-1k.\n\n| Model         |  Epoch  | Training Setting | Acc. (%) |                               Config                                | Batch Size |                                    Download                                     |\n| ------------- | :-----: | :--------------: | :------: | :-----------------------------------------------------------------: | :--------: | :-----------------------------------------------------------------------------: |\n| ViT-S         |   150   |        I         |   80.1   |   [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fargs_vit-s_150-I.yaml)   |    2048    |      [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fsummary_vit-s_150-I.csv)\u002Fmodel       |\n| ViT-S         |   150   |        II        |   79.6   |    [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fargs_vit-s_150.yaml)    |    2048    |       [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fsummary_vit-s_150.csv)\u002Fmodel        |\n| ViT-S         |   300   |        I         |   81.1   |   [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fargs_vit-s_300-I.yaml)   |    2048    |      [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fsummary_vit-s_300-I.csv)\u002Fmodel       |\n| ViT-S         |   300   |        II        |   80.7   |    [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fargs_vit-s_300.yaml)    |    2048    |       [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fsummary_vit-s_300.csv)\u002Fmodel        |\n| ViT-B         |   150   |        II        |   81.7   |    [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fbase\u002Fargs_vit-B_150.yaml)     |    2048    |        [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fbase\u002Fsummary_vit-B_150.csv)\u002Fmodel        |\n| ViT-B         |   300   |        II        |   82.6   |   [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fbase\u002Fargs_vit-B_300_T.yaml)    |    2048    |       [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fbase\u002Fsummary_vit-B_300_T.csv)\u002Fmodel       |\n| ResNet-50     |   100   |        I         |   78.1   |  [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fargs_res50_100.yaml)   |    2048    |      [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fsummary_res50_100.csv)\u002Fmodel      |\n| ResNet-50     |   200   |        I         |   79.7   |  [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fargs_res50_200.yaml)   |    2048    |      [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fsummary_res50_200.csv)\u002Fmodel      |\n| ResNet-50     |   300   |        I         |   80.2   |  [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fargs_res50_300.yaml)   |    2048    |      [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fsummary_res50_300.csv)\u002Fmodel      |\n| ResNet-101    |   100   |        I         |   80.0   | [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fargs_res101_100.yaml)  |    2048    |     [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fsummary_res101_100.csv)\u002Fmodel     |\n| ResNet-101    |   200   |        I         |   81.6   | [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fargs_res101_200.yaml)  |    2048    |     [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fsummary_res101_200.csv)\u002Fmodel     |\n| ResNet-101    |   300   |        I         |   81.9   | [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fargs_res101_300.yaml)  |    2048    |     [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fsummary_res101_300.csv)\u002Fmodel     |\n| ConvNext-tiny |   150   |        II        |   81.7   | [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FConvNext\u002Fsmall\u002Fargs_cvnext_150.yaml) |    2048    |    [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FConvNext\u002Fsmall\u002Fsummary_cvnext_150.csv)\u002F\u002Fmodel    |\n| ConvNext-tiny |   300   |        II        |   82.4   | [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FConvNext\u002Fsmall\u002Fargs_cvnext_300.yaml) |    2048    |    [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FConvNext\u002Fsmall\u002Fsummary_cvnext_300.csv)\u002Fmodel     |\n| MAE-small     | 800+100 |       ---        |   83.8   |                    [config](.\u002FCV\u002FMAE\u002FREADME.md)                     | 4096\u002F2048  | [log-pretrain](.\u002FCV\u002FMAE\u002Fexp_results\u002FMAE\u002Fbase\u002Flog_base_pretrain.txt)\u002F[log-finetune](.\u002FCV\u002FMAE\u002Fexp_results\u002FMAE\u002Fbase\u002Flog_base_ft.txt)\u002Fmodel |\n| MAE-Large     | 800+50  |       ---        |   85.9   |                    [config](.\u002FCV\u002FMAE\u002FREADME.md)                     | 4096\u002F2048  | [log-pretrain](.\u002FCV\u002FMAE\u002Fexp_results\u002FMAE\u002Flarge\u002Flog_large_pretrain.txt)\u002F[log-finetune](.\u002FCV\u002FMAE\u002Fexp_results\u002FMAE\u002Flarge\u002Flog_large_ft.txt)\u002Fmodel |\n\n### Results on NLP tasks\n\n#### BERT-base\n\nWe give the configs and log files of the BERT-base model pre-trained on the Bookcorpus and Wikipedia datasets and fine-tuned on GLUE tasks. Note that we provide the config, log file, and detailed [instructions](.\u002FNLP\u002FBERT\u002FREADME.md) for BERT-base in the folder `.\u002FNLP\u002FBERT`.\n\n| Pretraining |                         Config                         | Batch Size |                             Log                             | Model |\n| ----------- | :----------------------------------------------------: | :--------: | :---------------------------------------------------------: | :---: |\n| Adan        | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Fpretraining\u002Fbert-adan.yaml) |    256     | [log](.\u002FNLP\u002FBERT\u002Fexp_results\u002Fpretrain\u002Fhydra_train-adan.log) | model |\n\n| Fine-tuning on GLUE-Task | Metric                       |  Result   |                         Config                         |\n| ------------------------ | :--------------------------- | :-------: | :----------------------------------------------------: |\n| CoLA                     | Matthew's corr.              |   64.6    | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fcola-adan.yaml)  |\n| SST-2                    | Accuracy                     |   93.2    | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fsst_2-adan.yaml) |\n| STS-B                    | Person corr.                 |   89.3    | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fsts_b-adan.yaml) |\n| QQP                      | Accuracy                     |   91.2    |  [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fqqp-adan.yaml)  |\n| MNLI                     | Matched acc.\u002FMismatched acc. | 85.7\u002F85.6 | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fmnli-adan.yaml)  |\n| QNLI                     | Accuracy                     |   91.3    | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fqnli-adan.yaml)  |\n| RTE                      | Accuracy                     |   73.3    |  [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Frte-adan.yaml)  |\n\nFor fine-tuning on GLUE-Task, see the total batch size in their corresponding configure files.\n\n#### Transformer-XL-base\n\nWe provide the config and log for Transformer-XL-base trained on the WikiText-103 dataset. The total batch size for this experiment is `60*4`.\n\n|                     | Steps | Test PPL |                          Download                           |\n| ------------------- | :---: | :------: | :---------------------------------------------------------: |\n| Baseline (Adam)     | 200k  |   24.2   | [log&config](.\u002FNLP\u002FTransformer-XL\u002Fexp_results\u002Flog-adam.txt) |\n| Transformer-XL-base |  50k  |   26.2   | [log&config](.\u002FNLP\u002FTransformer-XL\u002Fexp_results\u002Flog-50k.txt)  |\n| Transformer-XL-base | 100k  |   24.2   | [log&config](.\u002FNLP\u002FTransformer-XL\u002Fexp_results\u002Flog-100k.txt) |\n| Transformer-XL-base | 200k  |   23.5   | [log&config](.\u002FNLP\u002FTransformer-XL\u002Fexp_results\u002Flog-200k.txt) |\n\n### Results on Large Language Models\n\n#### GPT2-345m\n\nWe provide the config and log for GPT2-345m pre-trained on the dataset that comes from [BigCode](https:\u002F\u002Fwww.bigcode-project.org\u002F) and evaluated on the [HumanEval](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fhuman-eval) dataset by zero-shot learning. [HumanEval](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fhuman-eval) is used to measure functional correctness for synthesizing programs from docstrings. It consists of 164 original programming problems, assessing language comprehension, algorithms, and simple mathematics, with some comparable to simple software interview questions. We set ` Temperature = 0.8` during evaluation.\n\n|                  | Steps | pass@1 | pass@10 | pass@100 |                                  Download                                  |\n| ---------------- | :---: | :----: | :-----: | :------: | :------------------------------------------------------------------------: |\n| GPT2-345m (Adam) | 300k  | 0.0840 |  0.209  |  0.360   | [log&config](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Ffiles\u002F10362486\u002Fgpt2-adam.log) |\n| GPT2-345m (Adan) | 150k  | 0.0843 |  0.221  |  0.377   | [log&config](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Ffiles\u002F10362485\u002Fgpt2-adan.log) |\n\n\u003Cu>**Adan obtains comparable results with only half cost**\u003C\u002Fu>.\n\n### Results on Diffusion Models\n\nWe show the results of the text-to-3D task supported by the [DreamFusion Project](https:\u002F\u002Fgithub.com\u002Fashawkey\u002Fstable-dreamfusion). More visualization results could be founded [here](.\u002Fdreamfusion\u002F).\nExamples generated from text prompt `Sydney opera house, aerial view` with Adam and Adan:\n\n[![Video 1](https:\u002F\u002Fuser-images.githubusercontent.com\u002Fpath_to_video_preview_image.jpg)](https:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014601-da430196-021d-4f6b-962b-8441feff5d02.mp4)\n\n[![Video 2](https:\u002F\u002Fuser-images.githubusercontent.com\u002Fpath_to_video_preview_image.jpg)](https:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014594-3b5c05e3-9018-4a39-b5db-d6f2fc111cce.mp4)\n\n\n## Memory and Efficiency\nA brief comparison of peak memory and wall duration for the optimizer is as follows. The duration time is the total time of 200 `optimizer.step()`. We further compare Adam and FusedAdan in great detail on GPT-2. See more results [here](.\u002Ffused_adan\u002FREADME.md).\n\n| Model      | Model Size (MB) | Adam Peak (MB) | Adan Peak (MB) | FusedAdan Peak (MB) | Adam Time (ms) | Adan Time (ms) | FusedAdan Time (ms) |\n| :--------- | :-------------: | :------------: | :------------: | :-----------------: | :------------: | :------------: | :-----------------: |\n| ResNet-50  |       25        |      7142      |      7195      |        7176         |      9.0       |      4.2       |         1.9         |\n| ResNet-101 |       44        |     10055      |     10215      |        10160        |      17.5      |      7.0       |         3.4         |\n| ViT-B      |       86        |      9755      |      9758      |        9758         |      8.9       |      12.3      |         4.3         |\n| Swin-B     |       87        |     16118      |     16202      |        16173        |      17.9      |      12.8      |         4.9         |\n| ConvNext-B |       88        |     17353      |     17389      |        17377        |      19.1      |      15.6      |         5.0         |\n| Swin-L     |       196       |     24299      |     24316      |        24310        |      17.5      |      28.1      |        10.1         |\n| ConvNext-L |       197       |     26025      |     26055      |        26044        |      18.6      |      31.1      |        10.2         |\n| ViT-L      |       304       |     25652      |     25658      |        25656        |      18.0      |      43.2      |        15.1         |\n| GPT-2      |       758       |     25096      |     25406      |        25100        |      49.9      |     107.7      |        37.4         |\n| GPT-2      |      1313       |     34357      |     38595      |        34363        |      81.8      |     186.0      |        64.4         |\n","# Adan: 用于更快优化深度模型的自适应 Nesterov 动量算法\n\n这是 **Adan** 的官方 PyTorch 实现。请在此处查看论文 [here](https:\u002F\u002Farxiv.org\u002Fabs\u002F2208.06677)。如果你觉得我们的 Adan 对你的项目有帮助或启发，请引用这篇论文并为本仓库点亮星星。谢谢！\n\n```tex\n@article{xie2024adan,\n  title={Adan: Adaptive Nesterov Momentum Algorithm for Faster Optimizing Deep Models},\n  author={Xie, Xingyu and Zhou, Pan and Li, Huan and Lin, Zhouchen and Yan, Shuicheng},\n  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},\n  year={2024},\n  publisher={IEEE}\n}\n```\n\n## 支持的项目\n- Adan 的黎曼版本（Radan），包含在 [Manify](https:\u002F\u002Fgithub.com\u002Fpchlenski\u002Fmanify) 中 —— 一个非欧几里得机器学习库。\n- Adan 在 [NVIDIA](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNeMo) 提供的框架 [NeMo](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FNeMo\u002Fblob\u002Fmain\u002Fnemo\u002Fcore\u002Foptim\u002Fadan.py) 中得到支持。\n- Adan 是高保真文本到3D生成项目的默认优化器。更多详情请参见 [Consistent3D](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FConsistent3D)。\n- Adan 是 Masked Diffusion Transformer V2 的默认优化器。更多详情请参见 [MDT V2](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FMDT)。\n- Adan 在 [Meta AI](https:\u002F\u002Fgithub.com\u002Ffacebookresearch) 提供的项目 [D-Adaptation](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fdadaptation) 中得到支持。\n- Adan 将在 [百度飞桨](https:\u002F\u002Fgithub.com\u002FPaddlePaddle\u002FPaddle) 提供的项目 [Paddle](https:\u002F\u002Fgithub.com\u002FPaddlePaddle\u002FPaddle\u002Fpull\u002F55048#commits-pushed-563d32c) 中得到支持。\n- Adan 在 [Huggingface](https:\u002F\u002Fgithub.com\u002Fhuggingface) 提供的 [Timm](https:\u002F\u002Fgithub.com\u002Frwightman\u002Fpytorch-image-models) 中得到支持。\n- Adan 是文本到3D项目 [DreamFusion Project](https:\u002F\u002Fgithub.com\u002Fashawkey\u002Fstable-dreamfusion) 的默认优化器。更多结果请参见 [这里](.\u002Fdreamfusion\u002F)。\n- Adan 在 [OpenMMLab](https:\u002F\u002Fopenmmlab.com\u002F) 项目中的 [MMClassification](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmclassification\u002Ftree\u002Fdev-1.x) 中得到支持。使用 Adan 训练 ViT-B 的日志和示例请参见 [这里](https:\u002F\u002Fgithub.com\u002Fopen-mmlab\u002Fmmclassification\u002Fpull\u002F1180)。\n- TF 的实现（第三方）请参考 [DenisVorotyntsev\u002FAdan](https:\u002F\u002Fgithub.com\u002FDenisVorotyntsev\u002FAdan)。\n- JAX 版本（第三方）已在 [Deepmind\u002Foptax](https:\u002F\u002Fgithub.com\u002Fdeepmind\u002Foptax) 中实现并得到支持。\n\n  \n## 新闻\n- :fire::fire::fire: 针对大型语言模型（如 **MoE 和 GPT2**）的结果已发布。\n- 内存占用更少的 FusedAdan 已发布。\n\n\n______________________________________________________________________\n\n## 安装\n\n```\npython3 -m pip install git+https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan.git\n```\n默认情况下会安装 FusedAdan。如果你想使用原始的 Adan，请通过以下方式安装：\n```\ngit clone https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan.git\ncd Adan\npython3 setup.py install --unfused\n```\n\n## 使用方法\n\n为了方便你使用 Adan，我们简要提供了一些直观的说明，然后给出一些通用的实验技巧，最后为论文中的每个实验提供了更多详细信息（例如，具体命令和超参数）。\n\n#### 1) 使用 Adan 的两个步骤\n\n**步骤 1.** 添加 Adan 相关的超参数，将以下超参数添加到配置中：\n\n```python\nparser.add_argument('--max-grad-norm', type=float, default=0.0, help='如果 l2 范数大于此超参数，则裁剪梯度 (默认值: 0.0，不裁剪梯度)')\nparser.add_argument('--weight-decay', type=float, default=0.02,  help='权重衰减，类似于 AdamW 中使用的 (默认值: 0.02)')\nparser.add_argument('--opt-eps', default=None, type=float, metavar='EPSILON', help='优化器 epsilon，避免二阶矩为零的不良情况 (默认值: None，使用 Adan 中的默认值 1e-8)')\nparser.add_argument('--opt-betas', default=None, type=float, nargs='+', metavar='BETA', help='Adan 中的优化器 betas (默认值: None，使用 Adan 中的默认值 [0.98, 0.92, 0.99])')\nparser.add_argument('--no-prox', action='store_true', default=False, help='是否像 AdamW 一样执行权重衰减 (默认值=False)')\n```\n\n`opt-betas`: 为了与我们的使用习惯保持一致，论文中的 $\\beta$ 实际上是代码中的 $(1-\\beta)$。\n\n`foreach (bool)`: 如果为 `True`，Adan 将使用 `torch._foreach` 实现。它更快但会稍微增加内存使用。\n\n`no-prox`: 它决定了带权重衰减的参数更新规则。默认情况下，Adan 按照论文中算法 1 的方式更新参数：\n\n$$\\boldsymbol{\\theta}\\_{k+1} = ( 1+\\lambda \\eta)^{-1} \\left[\\boldsymbol{\\theta}\\_k - \\boldsymbol{\\eta}\\_k \\circ (\\mathbf{m}\\_k+(1-{\\color{blue}\\beta_2})\\mathbf{v}_k)\\right]$$\n\n但也可以像 AdamW 一样更新参数：\n\n$$\\boldsymbol{\\theta}\\_{k+1} = ( 1-\\lambda \\eta)\\boldsymbol{\\theta}\\_k - \\boldsymbol{\\eta}\\_k \\circ (\\mathbf{m}\\_k+(1-{\\color{blue}\\beta_2})\\mathbf{v}\\_k).$$\n\n**步骤 2.** 按如下方式创建 Adan 优化器。在这一步中，我们可以直接用以下命令替换普通的优化器：\n\n```python\nfrom adan import Adan\noptimizer = Adan(param, lr=args.lr, weight_decay=args.weight_decay, betas=args.opt_betas, eps = args.opt_eps, max_grad_norm=args.max_grad_norm, no_prox=args.no_prox)\n```\n\n#### 2) 实验技巧\n\n- 为了简化 Adan，在论文中除表 12 外的所有实验中，我们都没有使用 Adan 的重启策略。但表 12 显示，重启策略可以进一步略微提升 Adan 的性能。\n- Adan 通常允许使用较大的峰值学习率，而其他优化器（如 Adam 和 AdamW）往往无法做到这一点。例如，在所有实验中，除了 MAE 预训练和 LSTM，Adan 使用的学习率比 Adam\u002FAdamW **高出 5-10 倍**。\n- Adan 对 `beta1`、`beta2` 和 `beta3` 相对鲁棒，尤其是对 `beta2`。如果你想要更好的性能，可以先调整 `beta3`，然后再调整 `beta1`。\n- 在单节点上，Adan 的 GPU 内存消耗略高于 Adam\u002FAdamW。然而，这个问题可以通过使用 [ZeroRedundancyOptimizer](https:\u002F\u002Fpytorch.org\u002Ftutorials\u002Frecipes\u002Fzero_redundancy_optimizer.html) 来解决，该工具会在分布式数据并行进程中共享优化器状态以减少每进程的内存占用。具体来说，当在两个以上的 GPU 上使用 `ZeroRedundancyOptimizer` 时，**Adan 和 Adam 几乎消耗相同的内存量。**\n\n#### 3) 更多详细步骤和结果\n\n请参考以下链接获取详细步骤。在这些详细步骤中，我们甚至包括了用于可重复性的 **docker 镜像**。\n\n- [ViTs](.\u002FCV\u002Ftimm\u002F)、[ResNets](.\u002FCV\u002Ftimm\u002F) 和 [ConvNext](.\u002FCV\u002Ftimm\u002F) 的 [说明](.\u002FCV\u002Ftimm\u002F)。\n- [MAE](.\u002FCV\u002FMAE\u002F) 的 [说明](.\u002FCV\u002FMAE\u002F)。\n- [BERT](.\u002FNLP\u002FBERT\u002F) 的 [说明](.\u002FNLP\u002FBERT\u002F)。\n- [Transformer-XL](.\u002FNLP\u002FTransformer-XL\u002F) 的 [说明](.\u002FNLP\u002FTransformer-XL\u002F)。\n- [GPT2](.\u002Fgpt2\u002F) 的 [说明](.\u002Fgpt2\u002F)。\n- [文本到3D DreamFusion](.\u002Fdreamfusion\u002F) 的 [结果](.\u002Fdreamfusion\u002F)。\n\n## 各项任务的结果\n\n### 大型语言模型的结果\n\n#### 专家混合模型 (MoE)\n为了研究 Adan 优化器在大型语言模型（LLMs）中的有效性，我们使用 [MoE 模型](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2406.06563) 进行了预训练实验。实验使用了 [RedPajama-v2 数据集](https:\u002F\u002Fgithub.com\u002Ftogethercomputer\u002FRedPajama-Data)，并设置了三种配置，每种配置包含 8 个专家：**8x0.1B**（总计 0.5B 可训练参数）、**8x0.3B**（2B 可训练参数）和 **8x0.6B**（4B 可训练参数）。这些模型分别使用采样数据进行训练，数据量分别为 **10B、30B、100B 和 300B 个 token**。\n\n| 模型规模 |   8x0.1B  |   8x0.1B  |   8x0.1B  |   8x0.3B  |   8x0.3B  |   8x0.3B  |   8x0.6B  |\n|:--------:|:---------:|:---------:|:---------:|:---------:|:---------:|:---------:|:---------:|\n| Token 数量 |    10B    |    30B    |    100B   |    30B    |    100B   |    300B   |    300B   |\n|   AdamW   |   2.722   |   2.550   |   2.427   |   2.362   |   2.218   |   2.070   |   2.023   |\n|   Adan    | **2.697** | **2.513** | **2.404** | **2.349** | **2.206** | **2.045** | **2.010** |\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsail-sg_Adan_readme_5a31fe2077a3.png\" width=\"58%\" \u002F>\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsail-sg_Adan_readme_6a0c068ae253.png\" width=\"40%\" \u002F>\n\u003C\u002Fp>\n\n#### GPT2-345m\n\n我们提供了基于来自 [BigCode](https:\u002F\u002Fwww.bigcode-project.org\u002F) 的数据集对 GPT2-345m 进行预训练的配置和日志，并通过零样本学习在 [HumanEval](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fhuman-eval) 数据集上进行了评估。[HumanEval](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fhuman-eval) 用于衡量从函数文档字符串合成程序的功能正确性。它包含 164 个原创编程问题，评估语言理解、算法和简单数学能力，其中一些问题类似于简单的软件面试题。我们在评估过程中设置 `Temperature = 0.8`。\n\n|                  | 步数 | pass@1 | pass@10 | pass@100 |                                  下载                                  |\n| ---------------- | :---: | :----: | :-----: | :------: | :--------------------------------------------------------------------: |\n| GPT2-345m (Adam) | 300k  | 0.0840 |  0.209  |  0.360   | [log&config](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Ffiles\u002F10362486\u002Fgpt2-adam.log) |\n| GPT2-345m (Adan) | 150k  | 0.0843 |  0.221  |  0.377   | [log&config](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Ffiles\u002F10362485\u002Fgpt2-adan.log) |\n\n\u003Cu>**Adan 在仅一半成本的情况下获得了可比的结果**\u003C\u002Fu>。\n\n### 视觉任务的结果\n\n为了方便您使用 Adan，我们提供了在 ImageNet-1k 上进行实验的配置和日志文件。\n\n| 模型         |  轮次  | 训练设置 | 准确率 (%) |                               配置                                | 批量大小 |                                    下载                                     |\n| ------------- | :-----: | :------: | :--------: | :--------------------------------------------------------------: | :------: | :--------------------------------------------------------------------------: |\n| ViT-S         |   150   |    I     |    80.1    |   [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fargs_vit-s_150-I.yaml)   |   2048   |      [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fsummary_vit-s_150-I.csv)\u002Fmodel       |\n| ViT-S         |   150   |    II    |    79.6    |    [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fargs_vit-s_150.yaml)    |   2048   |       [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fsummary_vit-s_150.csv)\u002Fmodel        |\n| ViT-S         |   300   |    I     |    81.1    |   [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fargs_vit-s_300-I.yaml)   |   2048   |      [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fsummary_vit-s_300-I.csv)\u002Fmodel       |\n| ViT-S         |   300   |    II    |    80.7    |    [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fargs_vit-s_300.yaml)    |   2048   |       [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fsmall\u002Fsummary_vit-s_300.csv)\u002Fmodel        |\n| ViT-B         |   150   |    II    |    81.7    |    [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fbase\u002Fargs_vit-B_150.yaml)     |   2048   |        [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fbase\u002Fsummary_vit-B_150.csv)\u002Fmodel        |\n| ViT-B         |   300   |    II    |    82.6    |   [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fbase\u002Fargs_vit-B_300_T.yaml)    |   2048   |       [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FViT\u002Fbase\u002Fsummary_vit-B_300_T.csv)\u002Fmodel       |\n| ResNet-50     |   100   |    I     |    78.1    |  [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fargs_res50_100.yaml)   |   2048   |      [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fsummary_res50_100.csv)\u002Fmodel      |\n| ResNet-50     |   200   |    I     |    79.7    |  [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fargs_res50_200.yaml)   |   2048   |      [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fsummary_res50_200.csv)\u002Fmodel      |\n| ResNet-50     |   300   |    I     |    80.2    |  [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fargs_res50_300.yaml)   |   2048   |      [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes50\u002Fsummary_res50_300.csv)\u002Fmodel      |\n| ResNet-101    |   100   |    I     |    80.0    | [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fargs_res101_100.yaml)  |   2048   |     [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fsummary_res101_100.csv)\u002Fmodel     |\n| ResNet-101    |   200   |    I     |    81.6    | [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fargs_res101_200.yaml)  |   2048   |     [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fsummary_res101_200.csv)\u002Fmodel     |\n| ResNet-101    |   300   |    I     |    81.9    | [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fargs_res101_300.yaml)  |   2048   |     [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FResNet\u002FRes101\u002Fsummary_res101_300.csv)\u002Fmodel     |\n| ConvNext-tiny |   150   |    II    |    81.7    | [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FConvNext\u002Fsmall\u002Fargs_cvnext_150.yaml) |   2048   |    [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FConvNext\u002Fsmall\u002Fsummary_cvnext_150.csv)\u002F\u002Fmodel    |\n| ConvNext-tiny |   300   |    II    |    82.4    | [config](.\u002FCV\u002Ftimm\u002Fexp_results\u002FConvNext\u002Fsmall\u002Fargs_cvnext_300.yaml) |   2048   |    [log](.\u002FCV\u002Ftimm\u002Fexp_results\u002FConvNext\u002Fsmall\u002Fsummary_cvnext_300.csv)\u002Fmodel     |\n| MAE-small     | 800+100 |   ---    |    83.8    |                    [config](.\u002FCV\u002FMAE\u002FREADME.md)                     | 4096\u002F2048| [log-pretrain](.\u002FCV\u002FMAE\u002Fexp_results\u002FMAE\u002Fbase\u002Flog_base_pretrain.txt)\u002F[log-finetune](.\u002FCV\u002FMAE\u002Fexp_results\u002FMAE\u002Fbase\u002Flog_base_ft.txt)\u002Fmodel |\n| MAE-Large     | 800+50  |   ---    |    85.9    |                    [config](.\u002FCV\u002FMAE\u002FREADME.md)                     | 4096\u002F2048| [log-pretrain](.\u002FCV\u002FMAE\u002Fexp_results\u002FMAE\u002Flarge\u002Flog_large_pretrain.txt)\u002F[log-finetune](.\u002FCV\u002FMAE\u002Fexp_results\u002FMAE\u002Flarge\u002Flog_large_ft.txt)\u002Fmodel |\n\n### NLP 任务结果\n\n#### BERT-base\n\n我们提供了在 Bookcorpus 和 Wikipedia 数据集上预训练并在 GLUE 任务上微调的 BERT-base 模型的配置文件和日志文件。请注意，我们在文件夹 `.\u002FNLP\u002FBERT` 中为 BERT-base 提供了配置、日志文件以及详细的[说明](.\u002FNLP\u002FBERT\u002FREADME.md)。\n\n| 预训练 |                         配置                         | 批量大小 |                             日志                             | 模型 |\n| ------ | :-------------------------------------------------: | :------: | :----------------------------------------------------------: | :--: |\n| Adan   | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Fpretraining\u002Fbert-adan.yaml) |    256   | [log](.\u002FNLP\u002FBERT\u002Fexp_results\u002Fpretrain\u002Fhydra_train-adan.log) | model |\n\n| 在 GLUE 任务上的微调 | 指标                       |  结果   |                         配置                         |\n| -------------------- | :------------------------- | :-----: | :-------------------------------------------------: |\n| CoLA                 | Matthew's 相关系数         |   64.6  | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fcola-adan.yaml)  |\n| SST-2                | 准确率                     |   93.2  | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fsst_2-adan.yaml) |\n| STS-B                | Pearson 相关系数           |   89.3  | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fsts_b-adan.yaml) |\n| QQP                  | 准确率                     |   91.2  |  [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fqqp-adan.yaml)  |\n| MNLI                 | 匹配准确率\u002F不匹配准确率    | 85.7\u002F85.6 | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fmnli-adan.yaml)  |\n| QNLI                 | 准确率                     |   91.3  | [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Fqnli-adan.yaml)  |\n| RTE                  | 准确率                     |   73.3  |  [config](.\u002FNLP\u002FBERT\u002Fconfig\u002Ffinetuning\u002Frte-adan.yaml)  |\n\n关于 GLUE 任务的微调，请参阅其对应配置文件中的总批量大小。\n\n#### Transformer-XL-base\n\n我们提供了在 WikiText-103 数据集上训练的 Transformer-XL-base 的配置和日志。该实验的总批量大小为 `60*4`。\n\n|                     | 步数 | 测试困惑度 |                          下载                           |\n| ------------------- | :--: | :--------: | :-----------------------------------------------------: |\n| 基线 (Adam)         | 200k |    24.2    | [log&config](.\u002FNLP\u002FTransformer-XL\u002Fexp_results\u002Flog-adam.txt) |\n| Transformer-XL-base |  50k |    26.2    | [log&config](.\u002FNLP\u002FTransformer-XL\u002Fexp_results\u002Flog-50k.txt)  |\n| Transformer-XL-base | 100k |    24.2    | [log&config](.\u002FNLP\u002FTransformer-XL\u002Fexp_results\u002Flog-100k.txt) |\n| Transformer-XL-base | 200k |    23.5    | [log&config](.\u002FNLP\u002FTransformer-XL\u002Fexp_results\u002Flog-200k.txt) |\n\n### 大型语言模型的结果\n\n#### GPT2-345m\n\n我们提供了在来自 [BigCode](https:\u002F\u002Fwww.bigcode-project.org\u002F) 的数据集上预训练并在 [HumanEval](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fhuman-eval) 数据集上通过零样本学习评估的 GPT2-345m 的配置和日志。[HumanEval](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fhuman-eval) 用于衡量从文档字符串合成程序的功能正确性。它包含 164 个原创编程问题，评估语言理解、算法和简单数学，其中一些可与简单的软件面试问题相媲美。我们在评估期间设置 `Temperature = 0.8`。\n\n|                  | 步数 | pass@1 | pass@10 | pass@100 |                                  下载                                  |\n| ---------------- | :--: | :----: | :-----: | :------: | :--------------------------------------------------------------------: |\n| GPT2-345m (Adam) | 300k | 0.0840 |  0.209  |  0.360   | [log&config](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Ffiles\u002F10362486\u002Fgpt2-adam.log) |\n| GPT2-345m (Adan) | 150k | 0.0843 |  0.221  |  0.377   | [log&config](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Ffiles\u002F10362485\u002Fgpt2-adan.log) |\n\n\u003Cu>**Adan 以一半的成本获得了相当的结果**\u003C\u002Fu>。\n\n### 扩散模型的结果\n\n我们展示了由 [DreamFusion 项目](https:\u002F\u002Fgithub.com\u002Fashawkey\u002Fstable-dreamfusion) 支持的文本到 3D 任务的结果。更多可视化结果可以在这里找到 [here](.\u002Fdreamfusion\u002F)。\n使用 Adam 和 Adan 从文本提示 `Sydney opera house, aerial view` 生成的示例：\n\n[![视频 1](https:\u002F\u002Fuser-images.githubusercontent.com\u002Fpath_to_video_preview_image.jpg)](https:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014601-da430196-021d-4f6b-962b-8441feff5d02.mp4)\n\n[![视频 2](https:\u002F\u002Fuser-images.githubusercontent.com\u002Fpath_to_video_preview_image.jpg)](https:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014594-3b5c05e3-9018-4a39-b5db-d6f2fc111cce.mp4)\n\n\n## 内存和效率\n优化器的峰值内存和运行时间的简要比较如下。持续时间是 200 次 `optimizer.step()` 的总时间。我们进一步详细比较了 Adam 和 FusedAdan 在 GPT-2 上的表现。更多结果请参见 [这里](.\u002Ffused_adan\u002FREADME.md)。\n\n| 模型      | 模型大小 (MB) | Adam 峰值 (MB) | Adan 峰值 (MB) | FusedAdan 峰值 (MB) | Adam 时间 (ms) | Adan 时间 (ms) | FusedAdan 时间 (ms) |\n| :-------- | :-----------: | :------------: | :------------: | :-----------------: | :------------: | :------------: | :-----------------: |\n| ResNet-50 |       25      |      7142      |      7195      |        7176         |      9.0       |      4.2       |         1.9         |\n| ResNet-101|       44      |     10055      |     10215      |        10160        |      17.5      |      7.0       |         3.4         |\n| ViT-B     |       86      |      9755      |      9758      |        9758         |      8.9       |      12.3      |         4.3         |\n| Swin-B    |       87      |     16118      |     16202      |        16173        |      17.9      |      12.8      |         4.9         |\n| ConvNext-B|       88      |     17353      |     17389      |        17377        |      19.1      |      15.6      |         5.0         |\n| Swin-L    |       196     |     24299      |     24316      |        24310        |      17.5      |      28.1      |        10.1         |\n| ConvNext-L|       197     |     26025      |     26055      |        26044        |      18.6      |      31.1      |        10.2         |\n| ViT-L     |       304     |     25652      |     25658      |        25656        |      18.0      |      43.2      |        15.1         |\n| GPT-2     |       758     |     25096      |     25406      |        25100        |      49.9      |     107.7      |        37.4         |\n| GPT-2     |      1313     |     34357      |     38595      |        34363        |      81.8      |     186.0      |        64.4         |","# Adan 快速上手指南\n\nAdan 是一种基于自适应 Nesterov 动量算法的优化器，专为加速深度模型训练而设计。以下是快速上手指南。\n\n---\n\n## 环境准备\n\n### 系统要求\n- Python 3.7 或更高版本\n- PyTorch 1.10 或更高版本\n- 支持 Linux、macOS 和 Windows（推荐在 Linux 上使用）\n\n### 前置依赖\n确保已安装以下依赖：\n```bash\npip install torch\n```\n\n如果需要国内镜像源加速安装，可以使用以下命令：\n```bash\npip install torch -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n---\n\n## 安装步骤\n\n通过以下命令安装 Adan：\n\n```bash\npython3 -m pip install git+https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan.git\n```\n\n如果需要使用原始版本的 Adan（非 Fused 版本），请执行以下步骤：\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan.git\ncd Adan\npython3 setup.py install --unfused\n```\n\n---\n\n## 基本使用\n\n### 最简单的使用示例\n\n#### 步骤 1：添加 Adan 相关超参数\n在配置文件中添加以下超参数：\n\n```python\nparser.add_argument('--max-grad-norm', type=float, default=0.0, help='如果梯度的 L2 范数大于此值，则进行梯度裁剪 (默认: 0.0，不裁剪)')\nparser.add_argument('--weight-decay', type=float, default=0.02, help='权重衰减，默认值与 AdamW 类似 (默认: 0.02)')\nparser.add_argument('--opt-eps', default=None, type=float, metavar='EPSILON', help='优化器 epsilon，避免二阶矩为零的情况 (默认: None，使用 Adan 默认值 1e-8)')\nparser.add_argument('--opt-betas', default=None, type=float, nargs='+', metavar='BETA', help='Adan 中的优化器 betas (默认: None，使用 Adan 默认值 [0.98, 0.92, 0.99])')\nparser.add_argument('--no-prox', action='store_true', default=False, help='是否以 AdamW 的方式执行权重衰减 (默认: False)')\n```\n\n#### 步骤 2：创建 Adan 优化器\n将现有的优化器替换为 Adan：\n\n```python\nfrom adan import Adan\n\noptimizer = Adan(\n    param, \n    lr=args.lr, \n    weight_decay=args.weight_decay, \n    betas=args.opt_betas, \n    eps=args.opt_eps, \n    max_grad_norm=args.max_grad_norm, \n    no_prox=args.no_prox\n)\n```\n\n---\n\n以上是 Adan 的基本使用方法。更多详细配置和实验结果，请参考官方文档或相关链接。","一位深度学习工程师正在开发一个基于 Transformer 的文本生成模型，用于智能客服系统。为了提升模型性能，他需要训练一个超大规模的语言模型，但遇到了优化效率和收敛速度的瓶颈。\n\n### 没有 Adan 时\n- 使用传统优化器（如 AdamW）时，模型在训练初期收敛速度较慢，导致需要更多的时间来调整超参数。\n- 在处理超大规模模型时，显存占用过高，容易出现内存不足的问题，限制了批量大小的选择。\n- 模型在复杂任务上的最终性能未能达到预期，可能是因为优化器对梯度更新不够精细，导致局部最优解。\n- 训练过程中梯度裁剪和权重衰减等操作需要手动调整，增加了调试的工作量。\n- 面对 MoE（混合专家模型）等特殊架构时，优化器的表现不稳定，进一步拖慢了开发进度。\n\n### 使用 Adan 后\n- Adan 的自适应 Nesterov 动量算法显著加快了模型的收敛速度，减少了训练初期的调参需求。\n- FusedAdan 版本降低了显存占用，使得工程师能够使用更大的批量大小，从而提高训练效率。\n- 更精细的梯度更新机制帮助模型在复杂任务上取得了更高的性能，达到了预期目标。\n- 内置的梯度裁剪和权重衰减功能减少了手动配置的工作量，让工程师可以专注于模型设计。\n- Adan 对 MoE 和 GPT2 等架构的支持更加稳定，确保了优化过程的一致性和可靠性。\n\n通过 Adan，工程师不仅大幅缩短了模型训练时间，还提升了最终性能，为智能客服系统的上线提供了有力保障。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsail-sg_Adan_5a31fe20.png","sail-sg","Sea AI Lab","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fsail-sg_c01d6e2a.png","",null,"https:\u002F\u002Fsail.sea.com","https:\u002F\u002Fgithub.com\u002Fsail-sg",[84,88,92,96],{"name":85,"color":86,"percentage":87},"Python","#3572A5",87.8,{"name":89,"color":90,"percentage":91},"Cuda","#3A4E3A",7.1,{"name":93,"color":94,"percentage":95},"C++","#f34b7d",4.2,{"name":97,"color":98,"percentage":99},"Shell","#89e051",0.9,813,71,"2026-04-03T00:13:18","Apache-2.0","Linux, macOS, Windows","需要 GPU，显存大小未说明，CUDA 版本未说明","未说明",{"notes":108,"python":109,"dependencies":110},"建议使用 ZeroRedundancyOptimizer 优化多 GPU 内存使用；部分实验提供 Docker 镜像以确保可复现性；FusedAdan 默认安装，若需原始版本需手动指定。","3.8+",[111,112,113,114,115,116,117],"torch>=1.12","optax","timm","transformers","nemo","mmclassification","paddlepaddle",[26,13,14],[120,121,122,123,124,125,126,127,113,128,129,130,131,132,133,134,135,136,137,138],"adan","bert-model","convnext","deep-learning","fairseq","mae","optimizer","resnet","vit","transformer-xl","artificial-intelligence","diffusion","dreamfusion","gpt2","pytorch","cuda-programming","llm-training","llms","moe","2026-03-27T02:49:30.150509","2026-04-06T08:39:57.678242",[142,147,152,157,162,167],{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},4076,"为什么 Adan 没有类似 SGD 的实现或实验？","Adan 的主要贡献是将梯度差分项引入自适应优化器，从而将 Adam 转换为 Adan。关于 Nesterov 动量的实现细节可以参考论文《On the importance of initialization and momentum in deep learning》。","https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Fissues\u002F14",{"id":148,"question_zh":149,"answer_zh":150,"source_url":151},4075,"如何在没有设置 CUDA_HOME 环境变量的情况下安装？","可以通过运行 `conda install -c nvidia cuda-nvcc` 来解决此问题。另外，也可以克隆代码库并使用 `python setup.py install --unfused` 命令进行安装。","https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Fissues\u002F28",{"id":153,"question_zh":154,"answer_zh":155,"source_url":156},4077,"Adan 是否在论文中使用了学习率衰减？初始学习率是否敏感？","Adan 对初始学习率较为敏感。与 Adam 相比，Adan 引入了梯度差分项，因此可以使用更大的学习率。此外，EMA（指数移动平均）在某些框架中对结果影响较小，但在 MMCls 中较为敏感。","https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Fissues\u002F29",{"id":158,"question_zh":159,"answer_zh":160,"source_url":161},4078,"是否有 TensorFlow\u002FKeras 版本的实现？","社区用户实现了一个基于 TensorFlow 2.3+ 的版本，可以在 https:\u002F\u002Fgithub.com\u002FDenisVorotyntsev\u002FAdan 找到。官方也在计划推出基于 Keras 2.0+ 的实现。","https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Fissues\u002F6",{"id":163,"question_zh":164,"answer_zh":165,"source_url":166},4079,"Adan 在视觉密集预测任务中的表现如何？","对于视觉密集预测任务，建议增加 warmup 步数并调整最小学习率（min_lr）。此外，较低的学习率或更长的 warmup 可能更适合此类任务。","https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Fissues\u002F21",{"id":168,"question_zh":169,"answer_zh":170,"source_url":171},4080,"训练 YOLOv5 模型时出现 NaN，如何解决？","可以尝试以下超参数配置：`lr = 1e-3, betas=(0.98, 0.92, 0.99), eps=1.0e-08, weight_decay=0.02`。通常，自适应优化器的学习率应比 SGD 小 10-100 倍。","https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Fissues\u002F20",[173],{"id":174,"version":175,"summary_zh":176,"released_at":177},113188,"dreamfusion-demo","\r\n\r\n\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014532-6dec1554-c552-4fc5-92c4-cf9954d844cb.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014542-47f19116-9fb9-4e65-ad08-522d1c97ba11.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014545-2515b2be-bff8-4e7c-9718-0ee0210c98e9.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014548-160c7416-d74f-48aa-b3dc-bfd55e809b62.mp4\r\n\r\nD\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014554-b7f696dd-8635-4d75-81c3-218dd0231c76.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014561-7a943df3-ed8f-4c1a-b51f-8ca5bccf1819.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014566-ae9c6f72-2bbf-4e4b-8f15-27851464a620.mp4\r\n\r\nF\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014571-af207d24-1119-4b34-a31d-5250046cc426.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014575-db8b9b1b-7e81-4a27-ba36-2ef74c00f0bc.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014579-4db62a55-fd05-4616-9793-5af5fea81c62.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014584-aa038ea9-58ae-422f-a128-e885d7d7ab08.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014591-82d6e57e-bc9f-4b38-8d23-9b156a35334c.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014594-3b5c05e3-9018-4a39-b5db-d6f2fc111cce.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014601-da430196-021d-4f6b-962b-8441feff5d02.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014603-82564238-cf5b-4ffa-b7a3-175bd565e5ce.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014605-3860b816-cc1c-4367-b96e-406cd375240a.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014610-67817157-fe9e-4ace-a188-e84d88bf0f66.mp4\r\n\r\n\r\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F10042844\u002F211014613-6373253d-7a37-4b66-ac1b-d04bb7819c01.mp4\r\n\r\n[gpt2-adan.log](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Ffiles\u002F10362485\u002Fgpt2-adan.log)\r\n[gpt2-adam.log](https:\u002F\u002Fgithub.com\u002Fsail-sg\u002FAdan\u002Ffiles\u002F10362486\u002Fgpt2-adam.log)\r\n","2023-01-06T12:46:38"]