[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-asyml--texar":3,"tool-asyml--texar":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 真正成长为懂上",159636,2,"2026-04-17T23:33:34",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[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},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"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":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":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":92,"forks":93,"last_commit_at":94,"license":95,"difficulty_score":96,"env_os":97,"env_gpu":98,"env_ram":97,"env_deps":99,"category_tags":105,"github_topics":106,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":121,"updated_at":122,"faqs":123,"releases":154},8796,"asyml\u002Ftexar","texar","Toolkit for Machine Learning, Natural Language Processing, and Text Generation, in TensorFlow.  This is part of the CASL project: http:\u002F\u002Fcasl-project.ai\u002F","Texar 是一款基于 TensorFlow 构建的开源工具包，专为机器学习、自然语言处理及文本生成任务设计。它旨在解决研究人员和开发者在模型原型设计与实验过程中面临的代码复用率低、架构搭建繁琐等痛点，提供了一套模块化且易于使用的组件库。\n\n无论是刚入门的新手还是资深专家，都能通过 Texar 快速构建从编码器 - 解码器、注意力机制到分层模型等各种复杂架构。其核心亮点在于同时支持 TensorFlow 和 PyTorch 两个版本，并保持高度一致的接口设计，让用户能兼顾 PyTorch 的变量共享习惯与 TensorFlow 的优秀因子化功能。此外，Texar 内置了 BERT、GPT-2、XLNet 等多种预训练模型，并统一了调用接口，极大简化了迁移学习与组合建模的流程。\n\n该工具完全兼容原生框架 API，支持用户灵活插入外部模块，并在多 GPU 分布式训练、强化学习及对抗学习等高级场景下表现出色。凭借清晰的文档和丰富的示例，Texar 成为学术界与工业界进行高效算法探索与系统开发的理想助手。","\u003Cdiv align=\"center\">\n   \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fasyml_texar_readme_1d24f820397a.png\">\u003Cbr>\u003Cbr>\n\u003C\u002Fdiv>\n \n-----------------\n\n\n[![pypi](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Ftexar.svg)](https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Ftexar)\n[![Build Status](https:\u002F\u002Ftravis-ci.org\u002Fasyml\u002Ftexar.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Fasyml\u002Ftexar)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fasyml\u002Ftexar\u002Fbranch\u002Fmaster\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fasyml\u002Ftexar)\n[![Documentation Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fasyml_texar_readme_13d664e1afd7.png)](https:\u002F\u002Ftexar.readthedocs.io\u002Fen\u002Flatest\u002F?badge=latest)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202.0-blue.svg)](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fblob\u002Fmaster\u002FLICENSE)\n \n\n**Texar** is a toolkit aiming to support a broad set of machine learning, especially natural language processing and text generation tasks. Texar provides a library of easy-to-use ML modules and functionalities for composing whatever models and algorithms. The tool is designed for both researchers and practitioners for fast prototyping and experimentation.\n\nTexar was originally developed and is \nactively contributed by [Petuum](https:\u002F\u002Fpetuum.com\u002F) and [CMU](https:\u002F\u002Fwww.cmu.edu\u002F) in collaboration with other institutes.\nA mirror of this repository is maintained by [Petuum Open Source](https:\u002F\u002Fgithub.com\u002Fpetuum).\n\n### Key Features\n* **Two Versions, (Mostly) Same Interfaces**. Texar-TensorFlow (this repo) and **[Texar-PyTorch](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar-pytorch)** have mostly the same interfaces. Both further combine the best design of TF and PyTorch:\n  - Interfaces and variable sharing in *PyTorch convention*\n  - Excellent factorization and rich functionalities in *TF convention*.\n* **Rich Pre-trained Models, Rich Usage with Uniform Interfaces**. BERT, GPT2, XLNet, etc, for encoding, classification, generation, and composing complex models with other Texar components!\n* **Fully Customizable** at multiple abstraction level -- both novice-friendly and expert-friendly. \n  - Free to plug in whatever external modules, since Texar is fully compatible with the native TF\u002FPyTorch APIs. \n* **Versatile** to support broad tasks, models, algorithms, data processing, evaluation, etc. \n   - encoder(s) to decoder(s), sequential- and self-attentions, memory, hierarchical models, classifiers... \n   - maximum likelihood learning, reinforcement learning, adversarial learning, probabilistic modeling, ... \n* **Modularized** for maximal re-use and clean APIs, based on principled decomposition of *Learning-Inference-Model Architecture*. \n* **Distributed** model training with multiple GPUs.\n* Clean, detailed [documentation](https:\u002F\u002Ftexar.readthedocs.io) and rich [examples](.\u002Fexamples).\n\n\n\u003Cdiv align=\"center\">\n   \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fasyml_texar_readme_2a10f60d8a82.png\">\u003Cbr>\u003Cbr>\n\u003C\u002Fdiv> \n\n### Library API Example\nBuilds an encoder-decoder model, with maximum likelihood learning:\n```python\nimport texar.tf as tx\n\n# Data \ndata = tx.data.PairedTextData(hparams=hparams_data) # a dict of hyperparameters \niterator = tx.data.DataIterator(data)\nbatch = iterator.get_next()                         # get a data mini-batch\n\n# Model architecture\nembedder = tx.modules.WordEmbedder(data.target_vocab.size, hparams=hparams_emb)\nencoder = tx.modules.TransformerEncoder(hparams=hparams_enc)\noutputs_enc = encoder(inputs=embedder(batch['source_text_ids']),  # call as a function\n                      sequence_length=batch['source_length'])\n                      \ndecoder = tx.modules.TransformerDecoder(\n    output_layer=tf.transpose(embedder.embedding) # tie input embedding w\u002F output layer\n    hparams=hparams_decoder)\noutputs, _, _ = decoder(memory=output_enc, \n                        memory_sequence_length=batch['source_length'],\n                        inputs=embedder(batch['target_text_ids']),\n                        sequence_length=batch['target_length']-1,\n                        decoding_strategy='greedy_train')    # teacher-forcing decoding\n                        \n# Loss for maximum likelihood learning\nloss = tx.losses.sequence_sparse_softmax_cross_entropy(\n    labels=batch['target_text_ids'][:, 1:],\n    logits=outputs.logits,\n    sequence_length=batch['target_length']-1)  # automatic sequence masks\n\n# Beam search decoding\noutputs_bs, _, _ = tx.modules.beam_search_decode(\n    decoder,\n    embedding=embedder,\n    start_tokens=[data.target_vocab.bos_token_id]*num_samples,\n    end_token=data.target_vocab.eos_token_id)\n```\nThe same model, but with adversarial learning:\n```python\nhelper = tx.modules.GumbelSoftmaxTraingHelper( # Gumbel-softmax decoding\n    start_tokens=[BOS]*batch_size, end_token=EOS, embedding=embedder)\noutputs, _ = decoder(helper=helper)            # automatic re-use of the decoder variables\n\ndiscriminator = tx.modules.BertClassifier(hparams=hparams_bert)        # pre-trained model\n\nG_loss, D_loss = tx.losses.binary_adversarial_losses(\n    real_data=data['target_text_ids'][:, 1:],\n    fake_data=outputs.sample_id,\n    discriminator_fn=discriminator)\n```\nThe same model, but with RL policy gradient learning:\n```python\nagent = tx.agents.SeqPGAgent(samples=outputs.sample_id,\n                             logits=outputs.logits,\n                             sequence_length=batch['target_length']-1,\n                             hparams=config_model.agent)\n```\nMany more examples are available [here](.\u002Fexamples)\n  \n### Installation\n\n**(Note: Texar>0.2.3 requires Python 3.6 or 3.7. To use with older Python versions, please use Texar\u003C=0.2.3)**\n\nTexar requires:\n\n* `tensorflow >= 1.10.0 (but \u003C 2.0.0)`. Follow the [tensorflow official instructions](https:\u002F\u002Fwww.tensorflow.org\u002Finstall) to install the appropriate version\n* `tensorflow_probability >= 0.3.0 (but \u003C 0.8.0)`. Follow the [tensorflow_probability official instractions](https:\u002F\u002Fwww.tensorflow.org\u002Fprobability\u002Finstall) to install.\n\nAfter `tensorflow` and `tensorflow_probability` are installed, install Texar from PyPI: \n```bash\npip install texar\n```\n\nTo use cutting-edge features or develop locally, install from source: \n```\ngit clone https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar.git\ncd texar\npip install .\n```\n\n### Getting Started\n* [Examples](.\u002Fexamples)\n* [Documentation](https:\u002F\u002Ftexar.readthedocs.io)\n\n### Reference\nIf you use Texar, please cite the [tech report](https:\u002F\u002Farxiv.org\u002Fabs\u002F1809.00794) with the following BibTex entry:\n```\nTexar: A Modularized, Versatile, and Extensible Toolkit for Text Generation\nZhiting Hu, Haoran Shi, Bowen Tan, Wentao Wang, Zichao Yang, Tiancheng Zhao, Junxian He, Lianhui Qin, Di Wang, Xuezhe Ma, Zhengzhong Liu, Xiaodan Liang, Wanrong Zhu, Devendra Sachan and Eric Xing\nACL 2019\n\n@inproceedings{hu2019texar,\n  title={Texar: A Modularized, Versatile, and Extensible Toolkit for Text Generation},\n  author={Hu, Zhiting and Shi, Haoran and Tan, Bowen and Wang, Wentao and Yang, Zichao and Zhao, Tiancheng and He, Junxian and Qin, Lianhui and Wang, Di and others},\n  booktitle={ACL 2019, System Demonstrations},\n  year={2019}\n}\n```\n\n### License\n[Apache License 2.0](.\u002FLICENSE)\n\n### Companies and Universities Supporting Texar\n\u003Cp float=\"left\">\n   \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fasyml_texar_readme_d9b77b4b1669.png\" width=\"200\" align=\"top\">\n   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n   \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fasyml_texar_readme_5a16ed9b4429.png\", width=\"200\" align=\"top\">\n\u003C\u002Fp>\n","\u003Cdiv align=\"center\">\n   \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fasyml_texar_readme_1d24f820397a.png\">\u003Cbr>\u003Cbr>\n\u003C\u002Fdiv>\n \n-----------------\n\n\n[![pypi](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Ftexar.svg)](https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Ftexar)\n[![Build Status](https:\u002F\u002Ftravis-ci.org\u002Fasyml\u002Ftexar.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Fasyml\u002Ftexar)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fasyml\u002Ftexar\u002Fbranch\u002Fmaster\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fasyml\u002Ftexar)\n[![Documentation Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fasyml_texar_readme_13d664e1afd7.png)](https:\u002F\u002Ftexar.readthedocs.io\u002Fen\u002Flatest\u002F?badge=latest)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202.0-blue.svg)](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fblob\u002Fmaster\u002FLICENSE)\n \n\n**Texar** 是一个旨在支持广泛机器学习任务的工具包，尤其适用于自然语言处理和文本生成任务。Texar 提供了一个易于使用的机器学习模块库和功能集，可用于构建各种模型和算法。该工具专为研究人员和从业者设计，以实现快速原型开发和实验。\n\nTexar 最初由 [Petuum](https:\u002F\u002Fpetuum.com\u002F) 和 [CMU](https:\u002F\u002Fwww.cmu.edu\u002F) 与其他机构合作开发，并持续得到贡献。此仓库的镜像由 [Petuum Open Source](https:\u002F\u002Fgithub.com\u002Fpetuum) 维护。\n\n### 核心特性\n* **两个版本，接口基本一致**。Texar-TensorFlow（本仓库）和 **[Texar-PyTorch](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar-pytorch)** 的接口几乎完全相同。两者进一步结合了 TensorFlow 和 PyTorch 的最佳设计：\n  - 接口和变量共享遵循 *PyTorch 风格*\n  - 极佳的模块化设计和丰富的功能遵循 *TensorFlow 风格*。\n* **丰富的预训练模型，统一接口下的多样化使用**。BERT、GPT2、XLNet 等模型可用于编码、分类、生成，以及与其他 Texar 组件组合构建复杂模型！\n* **高度可定制性**，支持多种抽象层次——既适合新手，也适合专家。\n  - 可自由接入任何外部模块，因为 Texar 完全兼容原生 TensorFlow\u002FPyTorch API。\n* **多功能性**，支持广泛的任务、模型、算法、数据处理、评估等。\n   - 编码器到解码器，序列注意力和自注意力机制，记忆网络，层次化模型，分类器……\n   - 最大似然学习、强化学习、对抗学习、概率建模……\n* **模块化设计**，基于“学习-推理-模型架构”的原则性分解，实现最大程度的代码复用和清晰的 API。\n* **分布式训练**，支持多 GPU 训练。\n* 清晰详尽的 [文档](https:\u002F\u002Ftexar.readthedocs.io) 和丰富的 [示例](.\u002Fexamples)。\n\n\u003Cdiv align=\"center\">\n   \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fasyml_texar_readme_2a10f60d8a82.png\">\u003Cbr>\u003Cbr>\n\u003C\u002Fdiv> \n\n### 库 API 示例\n构建一个编码器-解码器模型，并采用最大似然学习：\n```python\nimport texar.tf as tx\n\n# 数据 \ndata = tx.data.PairedTextData(hparams=hparams_data) # 超参数字典 \niterator = tx.data.DataIterator(data)\nbatch = iterator.get_next()                         # 获取一个数据小批量\n\n# 模型架构\nembedder = tx.modules.WordEmbedder(data.target_vocab.size, hparams=hparams_emb)\nencoder = tx.modules.TransformerEncoder(hparams=hparams_enc)\noutputs_enc = encoder(inputs=embedder(batch['source_text_ids']),  # 作为函数调用\n                      sequence_length=batch['source_length'])\n                      \ndecoder = tx.modules.TransformerDecoder(\n    output_layer=tf.transpose(embedder.embedding) # 将输入嵌入与输出层绑定\n    hparams=hparams_decoder)\noutputs, _, _ = decoder(memory=output_enc, \n                        memory_sequence_length=batch['source_length'],\n                        inputs=embedder(batch['target_text_ids']),\n                        sequence_length=batch['target_length']-1,\n                        decoding_strategy='greedy_train')    # 教师强制解码\n                        \n# 最大似然学习的损失\nloss = tx.losses.sequence_sparse_softmax_cross_entropy(\n    labels=batch['target_text_ids'][:, 1:],\n    logits=outputs.logits,\n    sequence_length=batch['target_length']-1)  # 自动序列掩码\n\n# 束搜索解码\noutputs_bs, _, _ = tx.modules.beam_search_decode(\n    decoder,\n    embedding=embedder,\n    start_tokens=[data.target_vocab.bos_token_id]*num_samples,\n    end_token=data.target_vocab.eos_token_id)\n```\n同样的模型，但采用对抗学习：\n```python\nhelper = tx.modules.GumbelSoftmaxTraingHelper( # Gumbel-softmax 解码\n    start_tokens=[BOS]*batch_size, end_token=EOS, embedding=embedder)\noutputs, _ = decoder(helper=helper)            # 自动重用解码器变量\n\ndiscriminator = tx.modules.BertClassifier(hparams=hparams_bert)        # 预训练模型\n\nG_loss, D_loss = tx.losses.binary_adversarial_losses(\n    real_data=data['target_text_ids'][:, 1:],\n    fake_data=outputs.sample_id,\n    discriminator_fn=discriminator)\n```\n同样的模型，但采用强化学习策略梯度方法：\n```python\nagent = tx.agents.SeqPGAgent(samples=outputs.sample_id,\n                             logits=outputs.logits,\n                             sequence_length=batch['target_length']-1,\n                             hparams=config_model.agent)\n```\n更多示例请参见 [这里](.\u002Fexamples)\n\n### 安装\n\n**(注意：Texar>0.2.3 需要 Python 3.6 或 3.7。若需使用较旧的 Python 版本，请使用 Texar≤0.2.3)**\n\nTexar 需要：\n\n* `tensorflow >= 1.10.0 (但 \u003C 2.0.0)`。请按照 [TensorFlow 官方安装指南](https:\u002F\u002Fwww.tensorflow.org\u002Finstall) 安装合适的版本。\n* `tensorflow_probability >= 0.3.0 (但 \u003C 0.8.0)`。请按照 [tensorflow_probability 官方安装指南](https:\u002F\u002Fwww.tensorflow.org\u002Fprobability\u002Finstall) 安装。\n\n在安装好 `tensorflow` 和 `tensorflow_probability` 后，即可从 PyPI 安装 Texar：\n```bash\npip install texar\n```\n\n若需使用最新功能或进行本地开发，可从源码安装：\n```\ngit clone https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar.git\ncd texar\npip install .\n```\n\n### 入门\n* [示例](.\u002Fexamples)\n* [文档](https:\u002F\u002Ftexar.readthedocs.io)\n\n### 参考文献\n如果您使用 Texar，请引用以下技术报告，并使用提供的 BibTeX 条目：\n```\nTexar: 用于文本生成的模块化、多功能且可扩展工具包\nZhiting Hu, Haoran Shi, Bowen Tan, Wentao Wang, Zichao Yang, Tiancheng Zhao, Junxian He, Lianhui Qin, Di Wang, Xuezhe Ma, Zhengzhong Liu, Xiaodan Liang, Wanrong Zhu, Devendra Sachan 和 Eric Xing\nACL 2019\n\n@inproceedings{hu2019texar,\n  title={Texar: A Modularized, Versatile, and Extensible Toolkit for Text Generation},\n  author={Hu, Zhiting and Shi, Haoran and Tan, Bowen and Wang, Wentao and Yang, Zichao and Zhao, Tiancheng and He, Junxian and Qin, Lianhui and Wang, Di and others},\n  booktitle={ACL 2019, System Demonstrations},\n  year={2019}\n}\n```\n\n### 许可证\n[Apache License 2.0](.\u002FLICENSE)\n\n### 支持 Texar 的公司和大学\n\u003Cp float=\"left\">\n   \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fasyml_texar_readme_d9b77b4b1669.png\" width=\"200\" align=\"top\">\n   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n   \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fasyml_texar_readme_5a16ed9b4429.png\", width=\"200\" align=\"top\">\n\u003C\u002Fp>","# Texar 快速上手指南\n\nTexar 是一个旨在支持广泛机器学习任务（尤其是自然语言处理和文本生成）的工具包。它提供了易于使用的模块库，适用于研究人员和从业者进行快速原型设计和实验。本项目主要基于 TensorFlow 构建（另有 Texar-PyTorch 版本）。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**: Linux, macOS 或 Windows\n*   **Python 版本**: \n    *   Texar > 0.2.3 需要 **Python 3.6** 或 **3.7**。\n    *   若需使用更旧的 Python 版本，请使用 Texar \u003C= 0.2.3。\n*   **前置依赖**:\n    *   `tensorflow`: 版本需 >= 1.10.0 且 \u003C 2.0.0\n    *   `tensorflow_probability`: 版本需 >= 0.3.0 且 \u003C 0.8.0\n\n> **提示**：国内用户建议使用清华源或阿里源加速依赖安装。\n\n## 安装步骤\n\n### 1. 安装基础依赖\n首先安装指定版本的 TensorFlow 和 TensorFlow Probability。您可以使用国内镜像源加速：\n\n```bash\npip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple \"tensorflow>=1.10.0,\u003C2.0.0\"\npip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple \"tensorflow_probability>=0.3.0,\u003C0.8.0\"\n```\n\n### 2. 安装 Texar\n\n**方式一：通过 PyPI 安装（推荐稳定版）**\n```bash\npip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple texar\n```\n\n**方式二：从源码安装（获取最新特性）**\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar.git\ncd texar\npip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple .\n```\n\n## 基本使用\n\nTexar 采用模块化设计，支持快速构建编码器 - 解码器（Encoder-Decoder）模型。以下是一个最简单的示例，展示如何构建一个基于 Transformer 的序列到序列模型并进行最大似然训练。\n\n### 示例：构建 Encoder-Decoder 模型\n\n```python\nimport texar.tf as tx\nimport tensorflow as tf\n\n# 1. 数据准备\n# hparams_data 为超参数字典，需预先定义\ndata = tx.data.PairedTextData(hparams=hparams_data) \niterator = tx.data.DataIterator(data)\nbatch = iterator.get_next()                         # 获取一个小批量数据\n\n# 2. 模型架构搭建\n# 词嵌入层\nembedder = tx.modules.WordEmbedder(data.target_vocab.size, hparams=hparams_emb)\n\n# 编码器 (Transformer Encoder)\nencoder = tx.modules.TransformerEncoder(hparams=hparams_enc)\noutputs_enc = encoder(\n    inputs=embedder(batch['source_text_ids']),      # 作为函数调用\n    sequence_length=batch['source_length'])\n                      \n# 解码器 (Transformer Decoder)\ndecoder = tx.modules.TransformerDecoder(\n    output_layer=tf.transpose(embedder.embedding),  # 绑定输入嵌入与输出层权重\n    hparams=hparams_decoder)\n\n# 前向传播 (Teacher-forcing 模式)\noutputs, _, _ = decoder(\n    memory=outputs_enc, \n    memory_sequence_length=batch['source_length'],\n    inputs=embedder(batch['target_text_ids']),\n    sequence_length=batch['target_length']-1,\n    decoding_strategy='greedy_train')    \n    \n# 3. 定义损失函数 (最大似然学习)\nloss = tx.losses.sequence_sparse_softmax_cross_entropy(\n    labels=batch['target_text_ids'][:, 1:],\n    logits=outputs.logits,\n    sequence_length=batch['target_length']-1)  # 自动处理序列掩码\n\n# 4. 推理阶段 (束搜索 Beam Search)\noutputs_bs, _, _ = tx.modules.beam_search_decode(\n    decoder,\n    embedding=embedder,\n    start_tokens=[data.target_vocab.bos_token_id]*num_samples,\n    end_token=data.target_vocab.eos_token_id)\n```\n\n### 灵活切换学习策略\nTexar 的强大之处在于只需少量代码即可切换不同的学习算法。例如，将上述模型改为**对抗学习**或**强化学习**：\n\n**对抗学习示例：**\n```python\n# 使用 Gumbel-softmax 进行解码\nhelper = tx.modules.GumbelSoftmaxTraingHelper(\n    start_tokens=[BOS]*batch_size, end_token=EOS, embedding=embedder)\noutputs, _ = decoder(helper=helper)            \n\n# 加载预训练判别器 (如 BERT)\ndiscriminator = tx.modules.BertClassifier(hparams=hparams_bert)        \n\n# 计算对抗损失\nG_loss, D_loss = tx.losses.binary_adversarial_losses(\n    real_data=data['target_text_ids'][:, 1:],\n    fake_data=outputs.sample_id,\n    discriminator_fn=discriminator)\n```\n\n**强化学习示例：**\n```python\n# 定义策略梯度 Agent\nagent = tx.agents.SeqPGAgent(\n    samples=outputs.sample_id,\n    logits=outputs.logits,\n    sequence_length=batch['target_length']-1,\n    hparams=config_model.agent)\n```\n\n更多详细示例请参考官方 [examples](.\u002Fexamples) 目录或 [文档](https:\u002F\u002Ftexar.readthedocs.io)。","某电商公司的算法团队正紧急开发一个智能客服系统，需要快速构建一个基于 Transformer 架构的序列到序列（Seq2Seq）模型，以实现用户咨询的自动回复生成。\n\n### 没有 texar 时\n- **代码重复率高**：开发者需从零手写数据加载、Embedding 层、Transformer 编码器\u002F解码器及注意力机制，大量样板代码导致开发周期长达数周。\n- **模块耦合严重**：数据处理、模型定义与训练逻辑混杂在一起，若要切换不同的解码策略（如从贪婪搜索改为束搜索），往往需要重构核心代码。\n- **预模型集成困难**：想要引入 BERT 或 GPT-2 等预训练模型提升效果时，需手动处理复杂的权重加载与接口对齐，极易出错。\n- **实验迭代缓慢**：由于缺乏统一的超参数管理接口，每次调整网络结构或学习率都需要修改多处代码，难以进行快速的对比实验。\n\n### 使用 texar 后\n- **搭建效率倍增**：利用 texar 内置的 `TransformerEncoder` 和 `TransformerDecoder` 等模块化组件，仅需几十行代码即可组装出完整的生成模型，将原型开发时间缩短至几天。\n- **架构灵活解耦**：遵循“学习 - 推理 - 架构”分离的设计原则，团队可轻松通过配置字典切换解码策略或替换注意力模块，无需改动主逻辑。\n- **预训练模型即插即用**：texar 提供统一接口直接调用 BERT、GPT-2 等主流预训练模型，无缝融入现有编码或生成流程，显著提升了冷启动阶段的回复质量。\n- **实验管理规范化**：通过标准化的超参数对象（hparams）管理所有配置，研究人员能高效地并行运行多组实验，快速锁定最优模型结构。\n\ntexar 通过高度模块化且统一的接口设计，将复杂的 NLP 模型构建转化为简单的积木式组合，极大降低了从算法研究到工程落地的门槛。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fasyml_texar_1d24f820.png","asyml","ASYML","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fasyml_c29323b3.png","Machine Learning as Machine Assembly, part of the CASL project https:\u002F\u002Fwww.casl-project.ai\u002F",null,"asyml.io","https:\u002F\u002Fgithub.com\u002Fasyml",[80,84,88],{"name":81,"color":82,"percentage":83},"Python","#3572A5",99.6,{"name":85,"color":86,"percentage":87},"Perl","#0298c3",0.3,{"name":89,"color":90,"percentage":91},"Shell","#89e051",0.1,2391,368,"2026-04-14T14:28:51","Apache-2.0",4,"未说明","支持多 GPU 分布式训练，具体型号、显存及 CUDA 版本取决于所安装的 TensorFlow 版本要求，文中未明确指定",{"notes":100,"python":101,"dependencies":102},"该工具为 Texar-TensorFlow 版本（另有 Texar-PyTorch 版本）。安装前需先根据官方指引安装指定版本的 TensorFlow 和 TensorFlow Probability。支持通过源码安装以获取最新功能。兼容原生 TF API，可插入外部模块。","3.6 或 3.7 (注：Texar>0.2.3 版本要求；若使用旧版 Python 需安装 Texar\u003C=0.2.3)",[103,104],"tensorflow>=1.10.0,\u003C2.0.0","tensorflow_probability>=0.3.0,\u003C0.8.0",[14,16,35],[107,108,109,110,111,112,113,114,64,115,116,117,118,119,120],"machine-learning","natural-language-processing","tensorflow","deep-learning","text-generation","python","machine-translation","dialog-systems","bert","gpt-2","xlnet","text-data","data-processing","casl-project","2026-03-27T02:49:30.150509","2026-04-18T09:20:50.390599",[124,129,134,139,144,149],{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},39461,"如何通过 pip 安装 texar.tf 模块？遇到 'No module named texar.tf' 错误怎么办？","如果您通过 pip 安装后遇到 'ModuleNotFoundError: No module named texar.tf'，请尝试直接从 GitHub 克隆仓库运行示例，因为某些模块可能在 pip 包中未完全包含或路径配置不同。此外，如果运行示例时出现数据文件缺失错误（如 'vocab.de; No such file or directory'），请检查当前目录下是否存在数据文件夹，可以使用 'ls .\u002Fdata\u002Fiwslt14\u002Fvocab.de' 命令确认文件路径是否正确。","https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fissues\u002F198",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},39462,"在使用 hierarchical_dialog 示例时，如何处理自定义数据集的 utterance 数量与配置不匹配的问题？","如果您的数据集 utterance 数量与示例默认配置（如 max_utterance_cnt = 9）不一致，导致形状不匹配错误，您可以自定义 'config_data.py' 文件以适配您的数据。请参考 'examples\u002Fhierarchical_dialog\u002Fsw_loader.py' 了解 utterance 生成逻辑，并根据实际数据调整 'config_data.max_utterance_cnt' 参数，确保其与数据批次中的 utterance 计数一致。","https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fissues\u002F193",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},39463,"使用 beam_search_decode 进行验证时，遇到 TensorArray 形状不兼容错误（如 [23,256] vs [32,256]）如何解决？","该错误通常由 'allow_smaller_final_batch' 设置引起，导致最后一个批次的动态维度与预期静态维度冲突。解决方案是避免在 'padded_batch_and_drop_remainder' 转换后强制保持恒定批次大小。虽然可以直接将维度设置为动态，但更推荐的做法是注意 'allow_smaller_final_batch=False' 的使用场景。维护者已修复了 'tx.data.DataIterator' 随机选择数据集导致的 inconsistencies，现在会始终按名称排序选择第一个数据集，但仍需谨慎处理批次大小设置。","https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fissues\u002F23",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},39464,"BERT + Transformer Decoder 模型在推理时对所有输入产生相同输出，可能是什么原因？","这可能是因为 BERT 编码器参数在训练过程中被意外更新，导致解码器无法获得有效的上下文表示。解决方案是在训练操作中排除 BERT 变量，仅优化非 BERT 部分。代码示例：\nallvars = tf.get_trainable_variables()\nnonBert = [v for v in allvars if 'bert' not in v]\ntrain_op = tx.core.get_train_op(mle_loss, learning_rate=learning_rate, variables=nonBert, global_step=global_step, hparams=opt)\n或者尝试对编码器输出使用 'tf.stop_gradient(encoder_output)' 来冻结梯度。","https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fissues\u002F79",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},39465,"调用 model_utils.init_bert_checkpoint 时出现 ValueError：作用域映射不匹配（bert\u002Fposition_embeddings vs bert\u002Fembeddings\u002Fposition_embeddings），如何解决？","此错误通常是由于 Texar 版本更新后 BERT 检查点的作用域命名规则发生变化所致。虽然具体修复步骤未在评论中详细列出，但用户反馈表明问题已解决。建议检查您使用的 Texar 版本是否与 BERT 检查点兼容，或参考官方文档确认最新的作用域映射规则。如有必要，可手动调整检查点加载时的作用域前缀映射。","https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fissues\u002F127",{"id":150,"question_zh":151,"answer_zh":152,"source_url":153},39466,"_mlp_transform 函数在处理 [batch_size, max_time, dim] 输入时是否存在变换矩阵共享问题？","是的，当前 '_mlp_transform' 实现会将输入重塑为 [batch_size, max_time * dim] 并应用单一变换矩阵，这意味着不同时间步的向量使用了不同的变换子矩阵，而非共享同一矩阵。对于需要相同时间步向量使用相同变换矩阵的场景，当前实现可能不符合预期。维护者已确认该问题，并计划通过修复文档字符串来澄清行为，未来可能会修改实现以支持正确的变换逻辑。","https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fissues\u002F185",[155,160,165,170,175,180],{"id":156,"version":157,"summary_zh":158,"released_at":159},315410,"v0.2.4","### 新特性\n\n* 仅支持 Python 3.6 和 3.7，放弃对旧版本 Python 的支持。([#211](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F211))\n* 添加分词器，包括预训练模型的分词器（`BERTTokenizer`、`XLNetTokenizer` 等）。([#225](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F225))\n* 添加 GPT-2 模块（`GPT2Encoder`、`GPT2Decoder`、`GPT2Classifier` 等）。([#228](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F228))\n\n### 功能改进\n\n* 更新嵌入模块的 `dropout_strategy=='item'`，以支持 TensorFlow v1.15。([#231](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F231))\n* 更新 `.gitignore` 文件，并为所有示例添加 `.gitignore` 文件。([#233](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F233))\n* 根据 flake8 规范优化代码风格。([#234](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F234))\n* 添加 GPT-2 XL 预训练检查点。([#243](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F243))\n\n### 修复\n\n* 修复 `examples\u002Ftransformer\u002Fscripts\u002Fwmt14_en_de.sh` 脚本，使其能够自动创建输出目录。([#238](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F238))\n* 修复 `texar.tf.modules.decoders.dynamic_decode` 中的变量作用域问题。([#246](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F246))","2019-11-19T03:54:40",{"id":161,"version":162,"summary_zh":163,"released_at":164},315411,"v0.2.3","### 新特性\n\n* Texar TensorFlow 现在通过 `import texar.tf as tx` 导入。([#197](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F197))\n* 添加预训练模块 \\[[文档](https:\u002F\u002Ftexar.readthedocs.io\u002Fen\u002Flatest\u002Fcode\u002Fmodules.html#pre-trained)\\]，例如 BERT、XLNet 等。([#206](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F206))\n* 添加新的张量形状相关工具函数，例如 [reduce_with_weights](https:\u002F\u002Ftexar.readthedocs.io\u002Fen\u002Flatest\u002Fcode\u002Futils.html#reduce-with-weights)、[varlength\\_\\*](https:\u002F\u002Ftexar.readthedocs.io\u002Fen\u002Flatest\u002Fcode\u002Futils.html#varlength-concat)。([#201](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F201))\n\n### 功能改进\n\n### 修复\n\n* 修复连接器 `_mlp_transform` 的文档字符串。([#192](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F192))\n* 修复在达到最大解码长度时 `dynamic_decode` 出现的越界错误。([#208](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F208))","2019-09-26T05:53:26",{"id":166,"version":167,"summary_zh":168,"released_at":169},315412,"v0.2.2","### 新特性\n\n* 支持从 [PyPI](https:\u002F\u002Fpypi.org\u002Fproject\u002Ftexar\u002F) 安装。([#186](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F186))\n* 更新依赖，要求 TensorFlow 版本 ≥ 1.10.0。([#186](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F186))\n\n### 功能改进\n\n* 使用惰性导入，以兼容 [texar-pytorch](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar-pytorch)。([#183](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F183))\n\n### 修复\n\n* 修复或关闭所有警告（主要是 TensorFlow 的弃用警告）。([#186](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F186))","2019-08-05T20:45:29",{"id":171,"version":172,"summary_zh":173,"released_at":174},315413,"v0.2.1","### 新特性\n\n* 在 [examples\u002Fgpt-2](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Ftree\u002Fmaster\u002Fexamples\u002Fgpt-2) 中添加对 GPT-2 345M 模型的支持。([#156](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F156))\n* 添加 BERT 模块，包括 `texar.modules.BERTEncoder`（[文档](https:\u002F\u002Ftexar.readthedocs.io\u002Fen\u002Flatest\u002Fcode\u002Fmodules.html#texar.modules.BertEncoder)）和 `texar.modules.BERTClassifier`（[文档](https:\u002F\u002Ftexar.readthedocs.io\u002Fen\u002Flatest\u002Fcode\u002Fmodules.html#bertclassifierv)）。([#167](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F167))\n\n### 功能改进\n\n* 重构 `TransformerEncoder` 和 `TransformerDecoder`，将位置嵌入从模块中分离出来。([#126](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F126))\n* 允许在解码器构造函数的 `output_layer` 中传入一个 Tensor——用于实现输出层与输入嵌入矩阵之间的权重共享。([#126](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F126))\n* 将 `TransformerDecoder` 的构造函数接口调整为与 `RNN 解码器` 的构造函数接口完全一致。([#126](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F126))\n* 重构解码器的 `Helper` 类，以支持接受两个参数的 `embedding_fn`（从而支持位置嵌入）。([#126](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F126))\n* 重构 `SinusoidsPositionEmbedder`，使其能够处理无限大或负数的位置索引。([#176](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F176))\n\n### 修复\n\n* 修复 `texar.losses.reduce_batch_time` 在 `sequence` 的 dtype 不是 `tf.float32` 时的行为。([#143](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fissues\u002F143))\n* 修复 `texar.losses.reduce_dimensions` 在 `average_axes` 或 `sum_axes` 为 `int` 时的问题。([#141](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F141))\n* 修复 [GPT-2](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Ftree\u002Fmaster\u002Fexamples\u002Fgpt-2) 的分词加载路径。([#165](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F165))\n* 修复 [examples\u002Fvae_text](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Ftree\u002Fmaster\u002Fexamples\u002Fvae_text) 中的 EOS 错误。([#168](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F168))\n* 修复 transformer 示例中的 [bleu_tool.py](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fblob\u002Fmaster\u002Fexamples\u002Ftransformer\u002Fbleu_tool.py)，当 `translation_length` 为 0 时的问题。([#176](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F176))\n* 修复 `StochasticConnector` 和 `ReparameterizedStochasticConnector` 在 `transform=False` 时的行为。([#179](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F179))","2019-07-28T23:03:14",{"id":176,"version":177,"summary_zh":178,"released_at":179},315414,"v0.2.0","### 新特性\n\n* `TFRecordData`: 一个新的数据模块，用于读取和处理 TFRecord 数据，支持图像数据、特征数据等。([#107](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F107))\n* `GPT-2`: OpenAI 预训练语言模型。([#91](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F91)，[示例](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Ftree\u002Fmaster\u002Fexamples\u002Fgpt-2))\n* `TopKSampleEmbeddingHelper`：用于执行 top_k 随机采样解码。([baa09ff](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fcommit\u002Fbaa09ff0ec898996d7be2535e73bedd1e92c1fb2))\n\n### 功能改进\n\n* 使用 `TFRecordData` 数据模块重构了 [`BERT` 示例](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Ftree\u002Fmaster\u002Fexamples\u002Fbert)。\n* `TransformerDecoder` 支持 `helper` 参数，用于指定解码策略。([#76](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F76))\n\n### 修复\n\n* 修复了 [`examples\u002Fseqgan`](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Ftree\u002Fmaster\u002Fexamples\u002Fseqgan) 中的变量收集错误。([#110](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F110))\n* 修复了在使用 `output_layer=tf.identity` 时调用 `beam_search_decode` 产生的错误。([#77](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F77))\n* 修复了 Read the Docs 的编译错误。([#85](https:\u002F\u002Fgithub.com\u002Fasyml\u002Ftexar\u002Fpull\u002F85))","2019-04-09T20:27:48",{"id":181,"version":182,"summary_zh":183,"released_at":184},315415,"v0.1.0","## Texar v0.1.0\n\n初始发布","2019-02-06T20:27:24"]