[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-fbcotter--pytorch_wavelets":3,"tool-fbcotter--pytorch_wavelets":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},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",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},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 真正成长为懂上",142651,2,"2026-04-06T23:34:12",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":78,"owner_website":79,"owner_url":80,"languages":81,"stars":94,"forks":95,"last_commit_at":96,"license":97,"difficulty_score":32,"env_os":98,"env_gpu":99,"env_ram":100,"env_deps":101,"category_tags":106,"github_topics":107,"view_count":32,"oss_zip_url":78,"oss_zip_packed_at":78,"status":17,"created_at":113,"updated_at":114,"faqs":115,"releases":145},4825,"fbcotter\u002Fpytorch_wavelets","pytorch_wavelets","Pytorch implementation of 2D Discrete Wavelet (DWT) and Dual Tree Complex Wavelet Transforms (DTCWT) and a DTCWT based ScatterNet","pytorch_wavelets 是一个专为 PyTorch 框架设计的开源库，旨在高效实现二维离散小波变换（DWT）和双树复小波变换（DTCWT），并支持基于 DTCWT 的散射网络（ScatterNet）。它主要解决了传统小波变换工具难以直接融入深度学习流水线、无法利用 GPU 加速以及不支持自动求导的痛点，让研究人员能够轻松将多尺度频域分析嵌入神经网络中。\n\n该工具特别适合从事计算机视觉、信号处理及深度学习算法研究的开发者与科研人员。其核心亮点在于完全兼容 PyTorch 的\"NCHW\"数据格式，支持批量多通道图像处理的反向传播，并能直接在 CUDA 上运行，显著提升计算效率。值得一提的是，其内置的散射网络层在保持精度的同时，速度比同类方案快约十倍。此外，最新版本还扩展了对一维信号的支持，并提供了多种填充模式，使其在处理各类时序数据和图像任务时更加灵活便捷。","2D Wavelet Transforms in Pytorch\n================================\n\n|build-status| |docs| |doi|\n\n.. |build-status| image:: https:\u002F\u002Ftravis-ci.org\u002Ffbcotter\u002Fpytorch_wavelets.png?branch=master\n    :alt: build status\n    :scale: 100%\n    :target: https:\u002F\u002Ftravis-ci.org\u002Ffbcotter\u002Fpytorch_wavelets\n\n.. |docs| image:: https:\u002F\u002Freadthedocs.org\u002Fprojects\u002Fpytorch-wavelets\u002Fbadge\u002F?version=latest\n    :target: https:\u002F\u002Fpytorch-wavelets.readthedocs.io\u002Fen\u002Flatest\u002F?badge=latest\n    :alt: Documentation Status\n\n.. |doi| image:: https:\u002F\u002Fzenodo.org\u002Fbadge\u002F146817005.svg\n   :target: https:\u002F\u002Fzenodo.org\u002Fbadge\u002Flatestdoi\u002F146817005\n   \nThe full documentation is also available `here`__.\n\n__ http:\u002F\u002Fpytorch-wavelets.readthedocs.io\u002F\n\nThis package provides support for computing the 2D discrete wavelet and \nthe 2d dual-tree complex wavelet transforms, their inverses, and passing \ngradients through both using pytorch.\n\nThe implementation is designed to be used with batches of multichannel images.\nWe use the standard pytorch implementation of having 'NCHW' data format.\n\nWe also have added layers to do the 2-D DTCWT based scatternet. This is similar\nto the Morlet based scatternet in `KymatIO`__, but is roughly 10 times faster.\n\nIf you use this repo, please cite my PhD thesis, chapter 3: https:\u002F\u002Fdoi.org\u002F10.17863\u002FCAM.53748.\n\n__ https:\u002F\u002Fgithub.com\u002Fkymatio\u002Fkymatio\n\nNew in version 1.3.0\n~~~~~~~~~~~~~~~~~~~~\n\n- Added 1D DWT support\n\n.. code:: python\n\n    import torch\n    from pytorch_wavelets import DWT1DForward, DWT1DInverse  # or simply DWT1D, IDWT1D\n    dwt = DWT1DForward(wave='db6', J=3)\n    X = torch.randn(10, 5, 100)\n    yl, yh = dwt(X)\n    print(yl.shape)\n    >>> torch.Size([10, 5, 22])\n    print(yh[0].shape)\n    >>> torch.Size([10, 5, 55])\n    print(yh[1].shape)\n    >>> torch.Size([10, 5, 33])\n    print(yh[2].shape)\n    >>> torch.Size([10, 5, 22])\n    idwt = DWT1DInverse(wave='db6')\n    x = idwt((yl, yh))\n\nNew in version 1.2.0\n~~~~~~~~~~~~~~~~~~~~\n\n- Added a DTCWT based ScatterNet\n\n.. code:: python\n\n    import torch\n    from pytorch_wavelets import ScatLayer\n    scat = ScatLayer()\n    X = torch.randn(10,5,64,64)\n    # A first order scatternet with 6 orientations and one lowpass channels\n    # gives 7 times the input channel dimension\n    Z = scat(X)\n    print(Z.shape)\n    >>> torch.Size([10, 35, 32, 32])\n    # A second order scatternet with 6 orientations and one lowpass channels\n    # gives 7^2 times the input channel dimension\n    scat2 = torch.nn.Sequential(ScatLayer(), ScatLayer())\n    Z = scat2(X)\n    print(Z.shape)\n    >>> torch.Size([10, 245, 16, 16])\n    # We also have a slightly more specialized, but slower, second order scatternet\n    from pytorch_wavelets import ScatLayerj2\n    scat2a = ScatLayerj2()\n    Z = scat2a(X)\n    print(Z.shape)\n    >>> torch.Size([10, 245, 16, 16])\n    # These all of course work with cuda\n    scat2a.cuda()\n    Z = scat2a(X.cuda())\n\nNew in version 1.1.0\n~~~~~~~~~~~~~~~~~~~~\n\n- Fixed memory problem with dwt \n- Fixed the backend code for the dtcwt calculation - much cleaner now but similar performance\n- Both dtcwt and dwt should be more memory efficient\u002Faware now. \n- Removed need to specify number of scales for DTCWTInverse\n\nNew in version 1.0.0\n~~~~~~~~~~~~~~~~~~~~\nVersion 1.0.0 has now added support for separable DWT calculation, and more\npadding schemes, such as symmetric, zero and periodization.\n\nAlso, no longer need to specify the number of channels when creating the wavelet\ntransform classes.\n\nSpeed Tests\n~~~~~~~~~~~\nWe compare doing the dtcwt with the python package and doing the dwt with\nPyWavelets to doing both in pytorch_wavelets, using a GTX1080. The numpy methods\nwere run on a 14 core Xeon Phi machine using intel's parallel python. For the\ndtwcwt we use the `near_sym_a` filters for the first scale and the `qshift_a`\nfilters for subsequent scales. For the dwt we use the `db4` filters.\n\nFor a fixed input size, but varying the number of scales (from 1 to 4) we have\nthe following speeds (averaged over 5 runs):\n\n.. raw:: html\n\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffbcotter_pytorch_wavelets_readme_dec026c47f2b.png\" width=\"700px\">\n\nFor an input size with height and width 512 by 512, we also vary the batch size\nfor a 3 scale transform. The resulting speeds were:\n\n.. raw:: html\n\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffbcotter_pytorch_wavelets_readme_639d00ee6e47.png\" width=\"700px\">\n\nInstallation\n````````````\nThe easiest way to install ``pytorch_wavelets`` is to clone the repo and pip install\nit. Later versions will be released on PyPi but the docs need to updated first::\n\n    $ git clone https:\u002F\u002Fgithub.com\u002Ffbcotter\u002Fpytorch_wavelets\n    $ cd pytorch_wavelets\n    $ pip install .\n\n(Although the `develop` command may be more useful if you intend to perform any\nsignificant modification to the library.) A test suite is provided so that you\nmay verify the code works on your system::\n\n    $ pip install -r tests\u002Frequirements.txt\n    $ pytest tests\u002F\n\nExample Use\n```````````\nFor the DWT - note that the highpass output has an extra dimension, in which we\nstack the (lh, hl, hh) coefficients.  Also note that the Yh output has the\nfinest detail coefficients first, and the coarsest last (the opposite to\nPyWavelets).\n\n.. code:: python\n\n    import torch\n    from pytorch_wavelets import DWTForward, DWTInverse\n    xfm = DWTForward(J=3, wave='db3', mode='zero')\n    X = torch.randn(10,5,64,64)\n    Yl, Yh = xfm(X) \n    print(Yl.shape)\n    >>> torch.Size([10, 5, 12, 12])\n    print(Yh[0].shape) \n    >>> torch.Size([10, 5, 3, 34, 34])\n    print(Yh[1].shape)\n    >>> torch.Size([10, 5, 3, 19, 19])\n    print(Yh[2].shape)\n    >>> torch.Size([10, 5, 3, 12, 12])\n    ifm = DWTInverse(wave='db3', mode='zero')\n    Y = ifm((Yl, Yh))\n\nFor the DTCWT:\n\n.. code:: python\n\n    import torch\n    from pytorch_wavelets import DTCWTForward, DTCWTInverse\n    xfm = DTCWTForward(J=3, biort='near_sym_b', qshift='qshift_b')\n    X = torch.randn(10,5,64,64)\n    Yl, Yh = xfm(X) \n    print(Yl.shape)\n    >>> torch.Size([10, 5, 16, 16])\n    print(Yh[0].shape) \n    >>> torch.Size([10, 5, 6, 32, 32, 2])\n    print(Yh[1].shape)\n    >>> torch.Size([10, 5, 6, 16, 16, 2])\n    print(Yh[2].shape)\n    >>> torch.Size([10, 5, 6, 8, 8, 2])\n    ifm = DTCWTInverse(biort='near_sym_b', qshift='qshift_b')\n    Y = ifm((Yl, Yh))\n\nSome initial notes:\n\n- Yh returned is a tuple. There are 2 extra dimensions - the first comes between\n  the channel dimension of the input and the row dimension. This is the\n  6 orientations of the DTCWT. The second is the final dimension, which is the\n  real an imaginary parts (complex numbers are not native to pytorch)\n\nRunning on the GPU\n~~~~~~~~~~~~~~~~~~\nThis should come as no surprise to pytorch users. The DWT and DTCWT transforms support\ncuda calling:\n\n.. code:: python\n\n    import torch\n    from pytorch_wavelets import DTCWTForward, DTCWTInverse\n    xfm = DTCWTForward(J=3, biort='near_sym_b', qshift='qshift_b').cuda()\n    X = torch.randn(10,5,64,64).cuda()\n    Yl, Yh = xfm(X) \n    ifm = DTCWTInverse(biort='near_sym_b', qshift='qshift_b').cuda()\n    Y = ifm((Yl, Yh))\n\nThe automated tests cannot test the gpu functionality, but do check cpu running.\nTo test whether the repo is working on your gpu, you can download the repo,\nensure you have pytorch with cuda enabled (the tests will check to see if\n:code:`torch.cuda.is_available()` returns true), and run:\n\n.. code:: \n\n    pip install -r tests\u002Frequirements.txt\n    pytest tests\u002F\n\nFrom the base of the repo.\n\nBackpropagation\n~~~~~~~~~~~~~~~\nIt is possible to pass gradients through the forward and backward transforms.\nAll you need to do is ensure that the input to each has the required_grad\nattribute set to true.\n\n\n\nProvenance\n~~~~~~~~~~\nBased on the Dual-Tree Complex Wavelet Transform Pack for MATLAB by Nick\nKingsbury, Cambridge University. The original README can be found in\nORIGINAL_README.txt.  This file outlines the conditions of use of the original\nMATLAB toolbox.\n\nFurther information on the DT CWT can be obtained from papers\ndownloadable from my website (given below). The best tutorial is in\nthe 1999 Royal Society Paper. In particular this explains the conversion\nbetween 'real' quad-number subimages and pairs of complex subimages. \nThe Q-shift filters are explained in the ICIP 2000 paper and in more detail\nin the May 2001 paper for the Journal on Applied and Computational \nHarmonic Analysis.\n\nThis code is copyright and is supplied free of charge for research\npurposes only. In return for supplying the code, all I ask is that, if\nyou use the algorithms, you give due reference to this work in any\npapers that you write and that you let me know if you find any good\napplications for the DT CWT. If the applications are good, I would be\nvery interested in collaboration. I accept no liability arising from use\nof these algorithms.\n\nNick Kingsbury, \nCambridge University, June 2003.\n\nDr N G Kingsbury,\nDept. of Engineering, University of Cambridge,\nTrumpington St., Cambridge CB2 1PZ, UK., or\nTrinity College, Cambridge CB2 1TQ, UK.\nPhone: (0 or +44) 1223 338514 \u002F 332647;  Home: 1954 211152;\nFax: 1223 338564 \u002F 332662;  E-mail: ngk@eng.cam.ac.uk\nWeb home page: http:\u002F\u002Fwww.eng.cam.ac.uk\u002F~ngk\u002F\n\n.. vim:sw=4:sts=4:et\n","PyTorch 中的 2D 小波变换\n================================\n\n|build-status| |docs| |doi|\n\n.. |build-status| image:: https:\u002F\u002Ftravis-ci.org\u002Ffbcotter\u002Fpytorch_wavelets.png?branch=master\n    :alt: 构建状态\n    :scale: 100%\n    :target: https:\u002F\u002Ftravis-ci.org\u002Ffbcotter\u002Fpytorch_wavelets\n\n.. |docs| image:: https:\u002F\u002Freadthedocs.org\u002Fprojects\u002Fpytorch-wavelets\u002Fbadge\u002F?version=latest\n    :target: https:\u002F\u002Fpytorch-wavelets.readthedocs.io\u002Fen\u002Flatest\u002F?badge=latest\n    :alt: 文档状态\n\n.. |doi| image:: https:\u002F\u002Fzenodo.org\u002Fbadge\u002F146817005.svg\n   :target: https:\u002F\u002Fzenodo.org\u002Fbadge\u002Flatestdoi\u002F146817005\n\n完整的文档也可以在 `这里`__ 查看。\n\n__ http:\u002F\u002Fpytorch-wavelets.readthedocs.io\u002F\n\n这个包提供了计算二维离散小波变换和二维双树复小波变换及其逆变换的支持，并且可以在 PyTorch 中对这两种变换进行梯度传递。\n\n该实现设计用于处理多通道图像的批量数据。我们使用 PyTorch 标准的 'NCHW' 数据格式。\n\n此外，我们还添加了基于 2D DTCWT 的散射网络层。这与 `KymatIO`__ 中基于 Morlet 的散射网络类似，但速度大约快 10 倍。\n\n如果您使用此仓库，请引用我的博士论文第 3 章：https:\u002F\u002Fdoi.org\u002F10.17863\u002FCAM.53748。\n\n__ https:\u002F\u002Fgithub.com\u002Fkymatio\u002Fkymatio\n\n版本 1.3.0 新增内容\n~~~~~~~~~~~~~~~~~~~~\n\n- 添加了 1D DWT 支持\n\n.. code:: python\n\n    import torch\n    from pytorch_wavelets import DWT1DForward, DWT1DInverse  # 或者直接使用 DWT1D, IDWT1D\n    dwt = DWT1DForward(wave='db6', J=3)\n    X = torch.randn(10, 5, 100)\n    yl, yh = dwt(X)\n    print(yl.shape)\n    >>> torch.Size([10, 5, 22])\n    print(yh[0].shape)\n    >>> torch.Size([10, 5, 55])\n    print(yh[1].shape)\n    >>> torch.Size([10, 5, 33])\n    print(yh[2].shape)\n    >>> torch.Size([10, 5, 22])\n    idwt = DWT1DInverse(wave='db6')\n    x = idwt((yl, yh))\n\n版本 1.2.0 新增内容\n~~~~~~~~~~~~~~~~~~~~\n\n- 添加了一个基于 DTCWT 的散射网络\n\n.. code:: python\n\n    import torch\n    from pytorch_wavelets import ScatLayer\n    scat = ScatLayer()\n    X = torch.randn(10,5,64,64)\n    # 一阶散射网络有 6 种方向和一个低通通道\n    # 输出通道数是输入通道数的 7 倍\n    Z = scat(X)\n    print(Z.shape)\n    >>> torch.Size([10, 35, 32, 32])\n    # 二阶散射网络同样有 6 种方向和一个低通通道\n    # 输出通道数是输入通道数的 7^2 倍\n    scat2 = torch.nn.Sequential(ScatLayer(), ScatLayer())\n    Z = scat2(X)\n    print(Z.shape)\n    >>> torch.Size([10, 245, 16, 16])\n    # 我们还有一个稍微更专业但速度较慢的二阶散射网络\n    from pytorch_wavelets import ScatLayerj2\n    scat2a = ScatLayerj2()\n    Z = scat2a(X)\n    print(Z.shape)\n    >>> torch.Size([10, 245, 16, 16])\n    # 当然，这些都可以在 CUDA 上运行\n    scat2a.cuda()\n    Z = scat2a(X.cuda())\n\n版本 1.1.0 新增内容\n~~~~~~~~~~~~~~~~~~~~\n\n- 修复了 DWT 的内存问题\n- 修复了 DTCWT 计算的后端代码——现在更加简洁，但性能相似\n- DTCWT 和 DWT 现在都更加节省内存或对内存更敏感。\n- 移除了指定 DTCWTInverse 的尺度数量的需求。\n\n版本 1.0.0 新增内容\n~~~~~~~~~~~~~~~~~~~~\n\n版本 1.0.0 现在增加了对可分离 DWT 计算的支持，以及更多的填充方式，如对称、零填充和周期化。\n\n此外，在创建小波变换类时不再需要指定通道数。\n\n速度测试\n~~~~~~~~~~~\n我们将使用 Python 包进行 DTCWT 计算和使用 PyWavelets 进行 DWT 计算的速度，与在 pytorch_wavelets 中同时进行这两项计算的速度进行了比较，使用的硬件是 GTX1080。NumPy 方法是在一台拥有 14 核 Xeon Phi 处理器的机器上，通过 Intel 的并行 Python 库运行的。对于 DTCWT，我们在第一尺度使用 `near_sym_a` 滤波器，在后续尺度使用 `qshift_a` 滤波器。对于 DWT，我们使用 `db4` 滤波器。\n\n对于固定输入大小，但改变尺度数量（从 1 到 4），我们得到了以下速度（平均 5 次运行的结果）：\n\n.. raw:: html\n\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffbcotter_pytorch_wavelets_readme_dec026c47f2b.png\" width=\"700px\">\n\n对于高度和宽度均为 512 的输入，我们还改变了 3 尺度变换的批次大小。得到的速度如下：\n\n.. raw:: html\n\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffbcotter_pytorch_wavelets_readme_639d00ee6e47.png\" width=\"700px\">\n\n安装\n````````````\n安装 ``pytorch_wavelets`` 最简单的方式是克隆仓库并使用 pip 安装。未来的版本将会发布到 PyPI，但在此之前需要先更新文档::\n\n    $ git clone https:\u002F\u002Fgithub.com\u002Ffbcotter\u002Fpytorch_wavelets\n    $ cd pytorch_wavelets\n    $ pip install .\n\n（不过，如果您打算对该库进行重大修改，使用 `develop` 命令可能会更有用。）我们提供了一个测试套件，以便您验证代码是否能在您的系统上正常工作::\n\n    $ pip install -r tests\u002Frequirements.txt\n    $ pytest tests\u002F\n\n示例用法\n```````````\n对于 DWT——请注意，高通输出有一个额外的维度，其中我们堆叠了 (lh, hl, hh) 系数。另外请注意，Yh 输出中，最精细的细节系数排在前面，而最粗糙的排在最后（与 PyWavelets 相反）。\n\n.. code:: python\n\n    import torch\n    from pytorch_wavelets import DWTForward, DWTInverse\n    xfm = DWTForward(J=3, wave='db3', mode='zero')\n    X = torch.randn(10,5,64,64)\n    Yl, Yh = xfm(X) \n    print(Yl.shape)\n    >>> torch.Size([10, 5, 12, 12])\n    print(Yh[0].shape) \n    >>> torch.Size([10, 5, 3, 34, 34])\n    print(Yh[1].shape)\n    >>> torch.Size([10, 5, 3, 19, 19])\n    print(Yh[2].shape)\n    >>> torch.Size([10, 5, 3, 12, 12])\n    ifm = DWTInverse(wave='db3', mode='zero')\n    Y = ifm((Yl, Yh))\n\n对于 DTCWT：\n\n.. code:: python\n\n    import torch\n    from pytorch_wavelets import DTCWTForward, DTCWTInverse\n    xfm = DTCWTForward(J=3, biort='near_sym_b', qshift='qshift_b')\n    X = torch.randn(10,5,64,64)\n    Yl, Yh = xfm(X) \n    print(Yl.shape)\n    >>> torch.Size([10, 5, 16, 16])\n    print(Yh[0].shape) \n    >>> torch.Size([10, 5, 6, 32, 32, 2])\n    print(Yh[1].shape)\n    >>> torch.Size([10, 5, 6, 16, 16, 2])\n    print(Yh[2].shape)\n    >>> torch.Size([10, 5, 6, 8, 8, 2])\n    ifm = DTCWTInverse(biort='near_sym_b', qshift='qshift_b')\n    Y = ifm((Yl, Yh))\n\n一些初步说明：\n\n- 返回的 Yh 是一个元组。有两个额外的维度——第一个位于输入的通道维度和行维度之间，这是 DTCWT 的 6 个方向；第二个是最后一个维度，表示复数的实部和虚部（PyTorch 不原生支持复数）。\n\n在 GPU 上运行\n~~~~~~~~~~~~~~~~~~\n这对 PyTorch 用户来说并不意外。DWT 和 DTCWT 变换都支持 CUDA 调用：\n\n.. code:: python\n\n    import torch\n    from pytorch_wavelets import DTCWTForward, DTCWTInverse\n    xfm = DTCWTForward(J=3, biort='near_sym_b', qshift='qshift_b').cuda()\n    X = torch.randn(10,5,64,64).cuda()\n    Yl, Yh = xfm(X) \n    ifm = DTCWTInverse(biort='near_sym_b', qshift='qshift_b').cuda()\n    Y = ifm((Yl, Yh))\n\n自动化测试无法测试 GPU 功能，但会检查 CPU 的运行情况。\n要测试该仓库是否能在你的 GPU 上正常工作，你可以先下载该仓库，\n确保已安装支持 CUDA 的 PyTorch（测试会检查 :code:`torch.cuda.is_available()` 是否返回 True），\n然后执行以下命令：\n\n.. code:: \n\n    pip install -r tests\u002Frequirements.txt\n    pytest tests\u002F\n\n从仓库的根目录下运行。\n\n反向传播\n~~~~~~~~~~~~~~~\n可以在前向和后向变换中传递梯度。你只需确保每个变换的输入都设置了\n:code:`requires_grad` 属性为 True 即可。\n\n\n\n出处\n~~~~~~~~~~\n本项目基于剑桥大学 Nick Kingsbury 开发的 MATLAB 双树复小波变换工具包。\n原始的 README 文件位于 ORIGINAL_README.txt 中，其中详细说明了该 MATLAB 工具箱的使用条款。\n\n有关双树复小波变换的更多信息，可从我的网站上下载相关论文（见下方链接）。\n其中，1999 年发表于英国皇家学会的论文是最佳教程，尤其解释了如何在“实数”四分量子图像与复数子图像对之间进行转换。\nQ 移位滤波器的相关内容则在 2000 年 ICIP 会议论文以及 2001 年 5 月发表于《应用与计算调和分析》期刊的论文中有更详细的阐述。\n\n本代码受版权保护，仅免费提供用于科研目的。作为交换，我唯一的要求是：如果你使用了这些算法，请在撰写论文时适当引用本工作，并在我发现双树复小波变换有良好应用时通知我。如果这些应用确实有价值，我非常愿意开展合作。对于因使用这些算法而产生的任何后果，我概不负责。\n\nNick Kingsbury,\n剑桥大学，2003年6月。\n\nDr N G Kingsbury,\n剑桥大学工程系，\nTrumpington St., Cambridge CB2 1PZ, UK，或\n剑桥大学三一学院，CB2 1TQ, UK。\n电话：(0 或 +44) 1223 338514 \u002F 332647；家庭：1954 211152；\n传真：1223 338564 \u002F 332662；电子邮件：ngk@eng.cam.ac.uk\n个人主页：http:\u002F\u002Fwww.eng.cam.ac.uk\u002F~ngk\u002F\n\n.. vim:sw=4:sts=4:et","# pytorch_wavelets 快速上手指南\n\n`pytorch_wavelets` 是一个基于 PyTorch 的高效工具库，支持二维离散小波变换（DWT）、二维双树复小波变换（DTCWT）及其逆变换。该库专为批量多通道图像处理设计，支持 GPU 加速和自动梯度回传，适用于深度学习中的特征提取与信号处理任务。\n\n## 环境准备\n\n*   **操作系统**：Linux, macOS, Windows\n*   **Python 版本**：建议 Python 3.6+\n*   **核心依赖**：\n    *   PyTorch (需安装与您的 CUDA 版本匹配的 PyTorch)\n    *   NumPy\n*   **硬件要求**：\n    *   CPU：通用支持\n    *   GPU：可选，若需加速请确保已安装支持 CUDA 的 PyTorch 版本 (`torch.cuda.is_available()` 返回 True)\n\n> **国内用户提示**：建议配置清华或阿里镜像源以加速依赖下载。\n> ```bash\n> pip config set global.index-url https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n## 安装步骤\n\n目前最稳定的安装方式是通过 GitHub 源码安装：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Ffbcotter\u002Fpytorch_wavelets\ncd pytorch_wavelets\npip install .\n```\n\n如果您计划修改源码或进行开发，建议使用开发模式安装：\n\n```bash\npip install -e .\n```\n\n**验证安装**（可选）：\n安装测试依赖并运行测试套件以确保环境正常：\n```bash\npip install -r tests\u002Frequirements.txt\npytest tests\u002F\n```\n\n## 基本使用\n\n### 1. 二维离散小波变换 (2D DWT)\n\n适用于标准图像多尺度分解。注意高频系数输出包含额外维度，按 `(lh, hl, hh)` 堆叠。\n\n```python\nimport torch\nfrom pytorch_wavelets import DWTForward, DWTInverse\n\n# 初始化变换：分解层数 J=3, 小波基 'db3', 填充模式 'zero'\nxfm = DWTForward(J=3, wave='db3', mode='zero')\n\n# 输入张量格式：[Batch, Channel, Height, Width] (NCHW)\nX = torch.randn(10, 5, 64, 64)\n\n# 执行前向变换\nYl, Yh = xfm(X) \n\n# Yl: 低频近似系数\nprint(Yl.shape) \n# >>> torch.Size([10, 5, 12, 12])\n\n# Yh: 高频细节系数列表 (从细到粗)\n# 维度含义：[N, C, 3(方向), H, W]\nprint(Yh[0].shape) \n# >>> torch.Size([10, 5, 3, 34, 34])\n\n# 执行逆变换恢复图像\nifm = DWTInverse(wave='db3', mode='zero')\nX_reconstructed = ifm((Yl, Yh))\n```\n\n### 2. 二维双树复小波变换 (2D DTCWT)\n\n提供平移不变性和更好的方向选择性。输出包含实部和虚部。\n\n```python\nimport torch\nfrom pytorch_wavelets import DTCWTForward, DTCWTInverse\n\n# 初始化变换\nxfm = DTCWTForward(J=3, biort='near_sym_b', qshift='qshift_b')\n\nX = torch.randn(10, 5, 64, 64)\nYl, Yh = xfm(X) \n\n# Yh 维度含义：[N, C, 6(方向), H, W, 2(实部\u002F虚部)]\nprint(Yh[0].shape) \n# >>> torch.Size([10, 5, 6, 32, 32, 2])\n\n# 逆变换\nifm = DTCWTInverse(biort='near_sym_b', qshift='qshift_b')\nX_reconstructed = ifm((Yl, Yh))\n```\n\n### 3. GPU 加速与梯度回传\n\n该库原生支持 CUDA 和 PyTorch 自动求导机制。\n\n**GPU 使用示例：**\n只需将模型和数据移至 CUDA 设备即可。\n\n```python\nxfm = DTCWTForward(J=3, biort='near_sym_b', qshift='qshift_b').cuda()\nX = torch.randn(10, 5, 64, 64).cuda()\nYl, Yh = xfm(X)\n```\n\n**梯度回传示例：**\n确保输入张量设置 `requires_grad=True` 即可在反向传播中计算梯度。\n\n```python\nX = torch.randn(10, 5, 64, 64, requires_grad=True)\nxfm = DWTForward(J=1, wave='db1')\nYl, Yh = xfm(X)\nloss = Yl.sum()\nloss.backward() # 可正常计算梯度\n```","某医疗影像实验室正在开发基于深度学习的早期肺结节检测系统，需要在模型中集成多尺度纹理特征提取模块以提升微小病灶的识别率。\n\n### 没有 pytorch_wavelets 时\n- **训练流程割裂**：传统小波变换依赖 CPU 端的 NumPy 或 PyWavelets 库，无法在 GPU 上直接运算，导致数据必须在 CPU 与 GPU 间频繁拷贝，严重拖慢训练速度。\n- **无法端到端优化**：由于外部小波计算不支持自动求导，特征提取部分无法参与反向传播，模型只能固定预提取的特征，限制了整体性能的上限。\n- **批处理效率低下**：现有方案难以高效处理 NCHW 格式的批量医学图像，开发者需编写复杂的循环代码逐张处理，显存利用率低且代码维护困难。\n- **复数小波实现复杂**：若需使用对偶树复小波（DTCWT）获取平移不变性，手动实现或其原有 Python 版本速度极慢，难以满足实时性要求。\n\n### 使用 pytorch_wavelets 后\n- **全链路 GPU 加速**：pytorch_wavelets 原生支持 CUDA，将 2D 离散小波及 DTCWT 完全融入计算图，消除了数据搬运开销，训练吞吐量提升约 10 倍。\n- **支持梯度回传**：工具内置的可微分算子允许梯度直接穿过小波层，使网络能自适应学习最优的小波分解策略，显著提升了结节检测的敏感度。\n- **原生批量处理**：完美适配 PyTorch 的 NCHW 数据格式，一行代码即可对整批 CT 切片进行多层级分解，大幅简化了数据预处理流水线。\n- **高效散射网络**：利用其提供的 DTCWT 散射网络层（ScatterNet），在保持平移不变性的同时，以远高于传统 Kymatio 库的速度完成高阶特征提取。\n\npytorch_wavelets 通过将经典信号处理算法无缝融入深度学习框架，实现了从“离线特征工程”到“在线可微分特征学习”的范式转变。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffbcotter_pytorch_wavelets_dec026c4.png","fbcotter","Fergal Cotter","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ffbcotter_cf830464.jpg","Senior Researcher at Wayve AI. Signal Processing PhD graduate from Cambridge. I like wavelets and neural nets!","Wayve AI","London, United Kingdom",null,"https:\u002F\u002Ffergalcotter.com","https:\u002F\u002Fgithub.com\u002Ffbcotter",[82,86,90],{"name":83,"color":84,"percentage":85},"Python","#3572A5",60.2,{"name":87,"color":88,"percentage":89},"Jupyter Notebook","#DA5B0B",39.7,{"name":91,"color":92,"percentage":93},"Shell","#89e051",0.1,1165,160,"2026-04-03T18:23:16","NOASSERTION","未说明","非必需。支持 NVIDIA GPU (CUDA)，README 测试环境使用 GTX1080。需安装支持 CUDA 的 PyTorch 版本以启用 GPU 加速。","未说明 (提及已优化内存效率，修复了内存问题)",{"notes":102,"python":98,"dependencies":103},"该库主要用于计算 2D 离散小波变换 (DWT) 和双树复小波变换 (DTCWT)。数据格式遵循 PyTorch 标准的 'NCHW'。若需运行测试套件，需额外安装 pytest 及相关测试依赖。代码支持反向传播梯度计算。",[104,105],"torch","numpy",[14],[108,109,110,111,112],"pytorch","wavelet","wavelet-transform","filterbank","dtcwt","2026-03-27T02:49:30.150509","2026-04-07T11:42:36.501165",[116,121,126,131,136,141],{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},21931,"DWT 和 IDWT 模块是否支持微分（可导），能否用于反向传播？","是的，DWT（离散小波变换）和 IDWT（逆离散小波变换）模块是可微分的，可以直接使用 `.backward()` 等方法进行反向传播。您可以像普通神经网络层一样使用它们。例如，可以构建一个包含 DWT、卷积层处理不同频带、再经 IDWT 重建的网络层：\n```python\nfrom pytorch_wavelets import DWT, IDWT\nimport torch.nn as nn\n\nclass Layer(nn.Module):\n    def __init__(self, C, F):\n        super().__init__()\n        self.dwt = DWT(J=1, wave='haar')\n        self.ll_gain = nn.Conv2d(C, F, 3, padding=1)\n        self.lh_gain = nn.Conv2d(C, F, 3, padding=1)\n        self.hl_gain = nn.Conv2d(C, F, 3, padding=1)\n        self.hh_gain = nn.Conv2d(C, F, 3, padding=1)\n        self.idwt = IDWT(wave='haar')\n\n    def forward(self, x):\n        yl, yh = self.dwt(x)\n        yl = self.ll_gain(yl)\n        lh = self.lh_gain(yh[0][:,:,0])\n        hl = self.hl_gain(yh[0][:,:,1])\n        hh = self.hh_gain(yh[0][:,:,2])\n        yh = (torch.stack((lh, hl, hh), dim=2), )\n        y = self.idwt((yl, yh))\n        return y\n```","https:\u002F\u002Fgithub.com\u002Ffbcotter\u002Fpytorch_wavelets\u002Fissues\u002F1",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},21932,"如何使用该库实现图像的上采样（Upsampling）和下采样（Downsampling）？","可以通过结合填充（padding）、IDWT 和 DWT 来实现。对于上采样，需要先对输入图像进行零填充以匹配目标尺寸，然后应用 IDWT；对于下采样，直接应用 DWT 即可。具体步骤如下：\n1. 初始化变换：`idwt = IDWT(wave='sym6', mode='zero')` 和 `dwt = DWT(J=1, wave='sym6', mode='zero')`。\n2. 上采样：假设输入 `x` 形状为 `[1, 3, 128, 128]`，目标是 `[1, 3, 256, 256]`。需先填充 `x` 使其符合 IDWT 的预期形状（例如 133x133），然后执行 `upsampled = idwt((torch.nn.functional.pad(x, (2, 3, 2, 3)), [None, ]))`。\n3. 下采样：对处理后的图像直接调用 `dwt` 即可得到下采样结果。注意填充是为了处理卷积带来的边界效应。","https:\u002F\u002Fgithub.com\u002Ffbcotter\u002Fpytorch_wavelets\u002Fissues\u002F24",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},21933,"在多 GPU 环境下使用 DataParallel 时报错怎么办？","这是一个已知问题，通常是因为滤波器张量没有正确移动到对应的 GPU 设备上。解决方法是在前向传播过程中，显式地将滤波器列表 `self.h` 中的每个张量移动到输入数据所在的设备上。修改代码如下：\n```python\n# 在 transform2d.py 或相关 forward 函数中\nself.h = [t.to(ll.device) for t in self.h]\ny = lowlevel.afb2d(ll, self.h, self.mode)\n```\n确保所有参与计算的张量都在同一设备上即可解决 `Assertion ... checkGPU failed` 错误。","https:\u002F\u002Fgithub.com\u002Ffbcotter\u002Fpytorch_wavelets\u002Fissues\u002F2",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},21934,"如何在学术论文中引用这个库？","作者建议引用其博士论文，其中第 3 章详细描述了相关工作。引用链接为：https:\u002F\u002Fdoi.org\u002F10.17863\u002FCAM.53748。此外，作者也为该仓库创建了 DOI，您也可以直接引用仓库本身。","https:\u002F\u002Fgithub.com\u002Ffbcotter\u002Fpytorch_wavelets\u002Fissues\u002F8",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},21935,"当前库是否支持一维离散小波变换（1D DWT）？","目前该库主要设计用于处理 4D 张量（针对 2D 图像）。虽然官方尚未原生支持 1D DWT，但用户可以通过简单的维度重塑（reshaping）来适配现有接口。另外，有用户指出利用多分辨率方法，仅使用两个简单的步长卷积（strided convolutions，一个用于细节，一个用于低通）即可在 PyTorch 中轻松实现 1D-DWT。维护者表示可能会在未来添加对 1D DWT 的原生支持。","https:\u002F\u002Fgithub.com\u002Ffbcotter\u002Fpytorch_wavelets\u002Fissues\u002F6",{"id":142,"question_zh":143,"answer_zh":144,"source_url":120},21936,"代码中为什么要对滤波系数（ll, lh, hl, hh）进行翻转操作（[::-1, ::-1]）？","这是为了符合小波变换的数学定义。在离散小波变换的实现中，重构滤波器通常是分解滤波器的时间反转版本。代码中使用 `[::-1, ::-1]` 对滤波器进行翻转，是为了确保正变换和逆变换能够正确配对，从而完美重建信号。具体的数学原理可以参考相关的信号处理文档或小波理论教材，库的文档中也对此有所说明。",[146],{"id":147,"version":148,"summary_zh":78,"released_at":149},131135,"1.1.0","2019-10-03T21:36:40"]