[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-cair--TsetlinMachine":3,"tool-cair--TsetlinMachine":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 真正成长为懂上",160784,2,"2026-04-19T11:32:54",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[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":77,"owner_twitter":76,"owner_website":78,"owner_url":79,"languages":80,"stars":89,"forks":90,"last_commit_at":91,"license":92,"difficulty_score":93,"env_os":94,"env_gpu":95,"env_ram":95,"env_deps":96,"category_tags":102,"github_topics":103,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":112,"updated_at":113,"faqs":114,"releases":142},9825,"cair\u002FTsetlinMachine","TsetlinMachine","Code and datasets for the Tsetlin Machine","Tsetlin Machine 是一个专注于实现“策特林机”算法的开源项目，提供了完整的代码实现与配套数据集。它旨在解决复杂的模式识别问题，特别是那些既需要高精度又要求结果可解释性的场景。与传统深度学习模型常被视为“黑盒”不同，Tsetlin Machine 通过集体协作的“策特林自动机”，将分类决策转化为由布尔逻辑构成的命题公式。这意味着它的判断过程清晰透明，人类可以直接理解其背后的逻辑规则（例如“当特征 A 存在且特征 B 不存在时，判定为某类”）。\n\n该项目不仅涵盖了基础的双分类功能，还支持多分类任务，并包含如噪声异或（Noisy XOR）等演示案例，帮助用户快速上手。其独特的技术亮点在于利用简单的逻辑子句组合来处理复杂数据，在保证计算效率的同时，天然具备极强的可解释性。\n\nTsetlin Machine 非常适合人工智能研究人员、算法开发者以及对模型透明度有严格要求的数据科学家使用。如果你正在探索可解释人工智能（XAI）领域，或者需要在医疗、金融等对决策逻辑有严格审计需求的场景中部署模型，这个项目将提供坚实的理论实现与工程支持。","# Tsetlin Machine\n![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fmicrosoft\u002Finterpret.svg?style=flat-square) ![Maintenance](https:\u002F\u002Fimg.shields.io\u002Fmaintenance\u002Fyes\u002F2026?style=flat-square)\n\nCode and datasets for the Tsetlin Machine. Implements the Tsetlin Machine from https:\u002F\u002Farxiv.org\u002Fabs\u002F1804.01508, including the multiclass version. The Tsetlin Machine solves complex pattern recognition problems with easy-to-interpret propositional formulas, composed by a collective of Tsetlin Automata.\n\n\u003Cp align=\"center\">\n  \u003Cimg width=\"75%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_cfcce137c54f.png\">\n\u003C\u002Fp>\n\n## Contents\n\n- [Basics](#basics)\n  - [Classification](#classification)\n  - [Learning](#learning)\n  - [Learning Behaviour](#learning-behaviour)\n- [Noisy XOR Demo](#noisy-xor-demo)\n- [Requirements](#requirements)\n- [Other Implementations](#other-implementations)\n- [Other Architectures](#other-architectures)\n- [Hardware](#hardware)\n- [Books](#books)\n- [Conferences](#conferences)\n- [Videos](#videos)\n- [Tutorials](#tutorials)\n- [Acknowledgements](#acknowledgements)\n- [Tsetlin Machine Papers](#tsetlin-machine-papers)\n- [Licence](#licence)\n\n## Basics\n\n### Classification\n\n\u003Cp align=\"left\">\nA basic Tsetlin Machine takes a vector \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_25d39ee3e06d.png\" border=\"0\" valign=\"middle\"\u002F> of Boolean features as input, to be classified into one of two classes, \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F> or \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F>. Together with their negated counterparts, \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_ab4ad3f56934.png\" border=\"0\" valign=\"middle\"\u002F>, the features form a literal set \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_20544493688e.png\" border=\"0\" valign=\"middle\"\u002F>.\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\nA Tsetlin Machine pattern is formulated as a conjunctive clause \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png\" border=\"0\" valign=\"middle\"\u002F>, formed by ANDing a subset \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_4ea6a6d3f06c.png\" border=\"0\" valign=\"middle\"\u002F> of the literal set:\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png (X)=\\bigwedge_{{{l}} {\\in} L_j} l = \\prod_{{{l}} {\\in} L_j} l\" border=\"0\" valign=\"middle\"\u002F>.\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\nFor example, the clause \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)=x_1\\land{\\lnot}x_2=x_1 \\bar{x}_2\" border=\"0\" valign=\"middle\"\u002F> consists of the literals \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_d7c352e0f0a4.png\" border=\"0\" valign=\"middle\"\u002F> and outputs \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_f5ba4007a1cb.png\" border=\"0\" valign=\"middle\"\u002F> iff \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_984ea16ef20e.png\" border=\"0\" valign=\"middle\"\u002F> and \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_6d2f4dc3baa3.png\" border=\"0\" valign=\"middle\"\u002F>.\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\nThe number of clauses employed is a user-configurable parameter \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_16d4045ec18c.png\" border=\"0\"\u002F>. Half of the clauses are assigned positive polarity. The other half is assigned negative polarity. The clause outputs, in turn, are combined into a classification decision through summation and thresholding using the unit step function \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_81a2864ee986.png\" border=\"0\" valign=\"middle\"\u002F>:\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_7023a8919e30.png\" border=\"0\" valign=\"middle\"\u002F>.\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\nIn other words, classification is based on a majority vote, with the positive clauses voting for \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F>\n and the negative for \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F>. The classifier\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_2707554a835c.png\" border=\"0\" valign=\"middle\"\u002F>,\n\u003C\u002Fp>\nfor instance, captures the XOR-relation.\n\u003C\u002Fp>\n\n### Learning\n\n\u003Cp align=\"left\">\nA clause \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)\" border=\"0\" valign=\"middle\"\u002F> is composed by a team of Tsetlin Automata, each Tsetlin Automaton deciding to \u003Ci>Include\u003C\u002Fi> or \u003Ci>Exclude\u003C\u002Fi> a specific literal \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_0b0145da6600.png\" border=\"0\" valign=\"middle\"\u002F> in the clause (see figure above). Learning which literals to include is based on reinforcement: Type I feedback produces frequent patterns, while Type II feedback increases the discrimination power of the patterns.\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\nA Tsetlin Machine learns on-line, processing one training example \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_6dafcf7aa188.png\" border=\"0\" valign=\"middle\"\u002F> at a time.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg width=\"52%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_3a054495b515.png\">\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\n\u003Cb>Type I feedback\u003C\u002Fb> is given stochastically to clauses with positive polarity when \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F> and to clauses with negative polarity when \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F>. An afflicted clause, in turn, reinforces each of its Tsetlin Automata based on: (i) the clause output \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)\" border=\"0\" valign=\"middle\"\u002F>; (ii) the action of the targeted Tsetlin Automaton - \u003Ci>Include\u003C\u002Fi> or \u003Ci>Exclude\u003C\u002Fi>; and (iii) the value of the literal \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_0b0145da6600.png\" border=\"0\" valign=\"middle\"\u002F> assigned to the automaton. As shown in Table 1, two rules govern Type I feedback, given independently to each Tsetlin Automaton of the clause:\n\u003C\u002Fp>\n\n* \u003Ci>Include\u003C\u002Fi> is rewarded and \u003Ci>Exclude\u003C\u002Fi> is penalized with probability \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_f5a0f6d8e478.png\" border=\"0\" valign=\"middle\"\u002F> whenever \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)=1\" border=\"0\" valign=\"middle\"\u002F> \u003Cb>and\u003C\u002Fb> \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_ae2d69408bc0.png\" border=\"0\" valign=\"middle\"\u002F>. This reinforcement is strong (triggers with high probability) and makes the clause remember and refine the pattern it recognizes in \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_cf2ca0a97f0a.png\" border=\"0\" valign=\"middle\"\u002F>. \n* \u003Ci>Include\u003C\u002Fi> is penalized and \u003Ci>Exclude\u003C\u002Fi> is rewarded with probability \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_6eba47898db3.png\" border=\"0\" valign=\"middle\"\u002F> if \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)=0\" border=\"0\" valign=\"middle\"\u002F> \u003Cb>or\u003C\u002Fb> \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_1d862abffaf7.png\" border=\"0\" valign=\"middle\"\u002F>. This reinforcement is weak (triggers with low probability) and coarsens infrequent patterns, making them frequent.\n\n\u003Cp>\nAbove, \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_82dbbff6e127.png\" border=\"0\" valign=\"middle\"\u002F> is a hyperparameter that controls the frequency of the patterns produced.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg width=\"52%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_a2b2103ab6fb.png\">\n\u003C\u002Fp>\n\n\u003Cp>\n\u003Cb>Type II feedback\u003C\u002Fb> is given stochastically to clauses with positive polarity when \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F> and to clauses with negative polarity when \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F>. Again, an affected clause reinforces each of its Tsetlin Automata based on: (i) the clause output \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)\" border=\"0\" valign=\"middle\"\u002F>; (ii) the action of the targeted Tsetlin Automaton - \u003Ci>Include\u003C\u002Fi> or \u003Ci>Exclude\u003C\u002Fi>; and (iii) the value of the literal \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_0b0145da6600.png\" border=\"0\" valign=\"middle\"\u002F> assigned to the automaton. As captured by Table 2, Type II feedback penalizes \u003Ci>Exclude\u003C\u002Fi> whenever \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)=1\" border=\"0\" valign=\"middle\"\u002F> \u003Cb>and\u003C\u002Fb> \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_1ffcb347fbbf.png\" border=\"0\" valign=\"middle\"\u002F>. This feedback is strong and produces candidate literals for discriminating between \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F> and \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_59ab40cd85f0.png\" border=\"0\" valign=\"middle\"\u002F>.\n\u003C\u002Fp>\n\n\u003Cp>\n\u003Cb>Resource allocation\u003C\u002Fb> dynamics ensure that clauses distribute themselves across the frequent patterns, rather than missing some and overconcentrating on others. That is, for any input \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_cf2ca0a97f0a.png\" border=\"0\" valign=\"middle\"\u002F>, the probability of reinforcing a clause gradually drops to zero as the clause output sum\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_24aa82ee11ef.png\" border=\"0\" valign=\"middle\"\u002F>\n\u003C\u002Fp>\n\u003Cp>\napproaches a user-set target \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_5066b1a2807f.png\" border=\"0\" valign=\"middle\"\u002F> for \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F> (\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c09bfafdbec3.png\" border=\"0\" valign=\"middle\"\u002F> for \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F>). To exemplify, the below plot shows the probability of reinforcing a clause when \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F> and \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_5066b1a2807f.png=2\" border=\"0\" valign=\"middle\"\u002F> for different clause output sums \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_612b3377a2f3.png\" border=\"0\" valign=\"middle\"\u002F>:\n\u003Cp\u002F>\n\u003Cp align=\"center\">\n  \u003Cimg width=\"60%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_1c72a45be38c.png\">\n\u003C\u002Fp>\n\u003Cp>\nIf a clause is not reinforced, it does not give feedback to its Tsetlin Automata, and these are thus left unchanged.  In the extreme, when the voting sum \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_612b3377a2f3.png\" border=\"0\" valign=\"middle\"\u002F> equals or exceeds the target \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_5066b1a2807f.png\" border=\"0\" valign=\"middle\"\u002F> (the Tsetlin Machine has successfully recognized the input \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_cf2ca0a97f0a.png\" border=\"0\" valign=\"middle\"\u002F>), no clauses are reinforced. Accordingly, they are free to learn new patterns, naturally balancing the pattern representation resources.\n\u003C\u002Fp>\n\n\u003Cp>\nSee https:\u002F\u002Farxiv.org\u002Fabs\u002F1804.01508 for details. \n\u003C\u002Fp>\n\n### Learning Behaviour\nThe below figure depicts average learning progress (over 50 runs) of the Tsetlin Machine on a binarized, but otherwise unenhanced version of the MNIST dataset (https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMNIST_database). See also https:\u002F\u002Fgithub.com\u002Fcair\u002Ffast-tsetlin-machine-with-mnist-demo.\n\n\u003Cp align=\"center\">\n  \u003Cimg width=\"75%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_60e880c024c6.png\">\n\u003C\u002Fp>\n\nAs seen in the figure, both test and training accuracy increase almost monotonically across the epochs. Even while accuracy on the training data approaches 99.9%, accuracy on the test data continues to increase as well, hitting 98.2% after 400 epochs. This is quite different from what occurs with backpropagation on a neural network, where accuracy on test data starts to drop at some point due to overfitting, without proper regularization mechanisms.\n\n## Noisy XOR Demo\n\n```bash\n.\u002FNoisyXORDemo.py\n\nAccuracy on test data (no noise): 1.0\nAccuracy on training data (40% noise): 0.603\n\nPrediction: x1 = 1, x2 = 0, ... -> y =  1\nPrediction: x1 = 0, x2 = 1, ... -> y =  1\nPrediction: x1 = 0, x2 = 0, ... -> y =  0\nPrediction: x1 = 1, x2 = 1, ... -> y =  0\n```\n\n## Requirements\n\n- Python 2.7.x https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F\n- Numpy http:\u002F\u002Fwww.numpy.org\u002F\n- Cython http:\u002F\u002Fcython.org\u002F\n\n## Other Implementations\n\n* Tsetlin Machine Unified - One Codebase to Rule Them All. Implements the Tsetlin Machine, Coalesced Tsetlin Machine, Convolutional Tsetlin Machine, Regression Tsetlin Machine, and Weighted Tsetlin Machine, with support for continuous features, drop clause, Type III Feedback, focused negative sampling, multi-task classifier, autoencoder, literal budget, and one-vs-one multi-class classifier. TMU is written in Python with wrappers for C and CUDA-based clause evaluation and updating, https:\u002F\u002Fgithub.com\u002Fcair\u002Ftmu, https:\u002F\u002Fpypi.org\u002Fproject\u002Ftmu\u002F\n* Massively Parallel and Asynchronous Architecture for Logic-based AI. Implements the Tsetlin Machine, Convolutional Tsetlin Machine, Regression Tsetlin Machine, and Weighted Tsetlin Machine, with support for continuous features, https:\u002F\u002Fgithub.com\u002Fcair\u002FPyTsetlinMachineCUDA, https:\u002F\u002Fpypi.org\u002Fproject\u002FPyTsetlinMachineCUDA\u002F\n* High-level Tsetlin Machine Python API with fast C-extensions. Implements the Tsetlin Machine, Convolutional Tsetlin Machine, Regression Tsetlin Machine, Weighted Tsetlin Machine, and Embedding Tsetlin Machine, with support for continuous features, multi-granular clauses, and clause indexing, https:\u002F\u002Fgithub.com\u002Fcair\u002FpyTsetlinMachine, https:\u002F\u002Fpypi.org\u002Fproject\u002FpyTsetlinMachine\u002F\n* Multi-threaded implementation of the Tsetlin Machine, Convolutional Tsetlin Machine, Regression Tsetlin Machine, and Weighted Tsetlin Machine, with support for continuous features and multi-granular clauses, https:\u002F\u002Fgithub.com\u002Fcair\u002FpyTsetlinMachineParallel, https:\u002F\u002Fpypi.org\u002Fproject\u002FpyTsetlinMachineParallel\u002F\n* High-performance Tsetlin Machine implementation in Julia with batching and low-level parallelization (52 million classifications per second on MNIST), https:\u002F\u002Fgithub.com\u002FBooBSD\u002FTsetlin.jl\n* Class-parallel Tsetlin Machine in C with logging support, https:\u002F\u002Fgithub.com\u002Fashurrafiev\u002FClassParallelTM\n* GUI application for visualising Tsetlin machine states and learning process, https:\u002F\u002Fgithub.com\u002Fashurrafiev\u002FTsetlinMachineViewer\n* Fast C++ implementation of the Weighted Tsetlin Machine with MNIST-, IMDb-, and Connect-4 demos, https:\u002F\u002Fgithub.com\u002Fadrianphoulady\u002Fweighted-tsetlin-machine-cpp\n* Fast bit-operation based implementation in C with MNIST demo, https:\u002F\u002Fgithub.com\u002Fcair\u002Ffast-tsetlin-machine-with-mnist-demo\n* CUDA implementation with IMDB text classification demo, https:\u002F\u002Fgithub.com\u002Fcair\u002Ffast-tsetlin-machine-in-cuda-with-imdb-demo\n* Hardware implementations, https:\u002F\u002Fgithub.com\u002FJieGH\u002FHardware_TM_Demo\n* Kivy implementation, https:\u002F\u002Fgithub.com\u002FDarshanaAbeyrathna\u002FTsetlin-Machine-Based-AI-Enabled-Mobile-App-for-Forecasting-the-Number-of-Corona-Patients\n* C implementation, https:\u002F\u002Fgithub.com\u002Fcair\u002FTsetlinMachineC\n* Parallelized C++ implementation of Multi-class and Regression Tsetlin Machine with scikit-learn-compatible Python wrapper, https:\u002F\u002Fgithub.com\u002FWojciechMigda\u002FTsetlini, https:\u002F\u002Fgithub.com\u002FWojciechMigda\u002FPyTsetlini\n* Rust implementation, https:\u002F\u002Fgithub.com\u002FKhaledSharif\u002FTsetlinMachine\n* Rust implementation with fast bit-operations, including MNIST demo, https:\u002F\u002Fgithub.com\u002Fjcriddle4\u002Ftsetlin_rust_mnist\n* C++ implementation, https:\u002F\u002Fgithub.com\u002F222464\u002FTsetlinMachine\n* Node.js implementation, https:\u002F\u002Fgithub.com\u002Fanon767\u002FTsetlinMachine\n* C# implementation, https:\u002F\u002Fgithub.com\u002Fcokobware\u002FTsetlinMachineCSharp\n* F# implementation, https:\u002F\u002Fgithub.com\u002Ffwaris\u002FFsTsetlin\n\n## Other Architectures\n\n* The Convolutional Tsetlin Machine, https:\u002F\u002Fgithub.com\u002Fcair\u002Fconvolutional-tsetlin-machine\n* The Graph Tsetlin Machine, https:\u002F\u002Fgithub.com\u002Fcair\u002FGraphTsetlinMachine\n* The Regression Tsetlin Machine, https:\u002F\u002Fgithub.com\u002Fcair\u002Fregression-tsetlin-machine\n* Coalesced Multi-Output Tsetlin Machine, https:\u002F\u002Fgithub.com\u002Fcair\u002FPyCoalescedTsetlinMachineCUDA\u002F\n* Massively Parallel and Asynchronous Architecture for Logic-based AI, https:\u002F\u002Fgithub.com\u002Fcair\u002FPyTsetlinMachineCUDA\n\n## Hardware\n\n* [Literal Labs](https:\u002F\u002Fwww.literal-labs.ai)\n\n## Books\n\n* [An Introduction to Tsetlin Machines](https:\u002F\u002Ftsetlinmachine.org)\n\n## Conferences\n\n* [International Symposium on the Tsetlin Machine (ISTM)](https:\u002F\u002Fistm.no) [Proceedings [2022](https:\u002F\u002Fieeexplore.ieee.org\u002Fxpl\u002Fconhome\u002F9923753\u002Fproceeding), [2023](https:\u002F\u002Fieeexplore.ieee.org\u002Fxpl\u002Fconhome\u002F10454903\u002Fproceeding)]\n\n## Videos\n\n* Watching the state transitions of Tsetlin Automata. Demo by Jie Lei, Microsystems Research Group, Newcastle University. https:\u002F\u002Fyoutu.be\u002FwXyiLtlpwHI\n* Keyword Spotting using Tsetlin Machines. Demo by Jie Lei, Microsystems Research Group, Newcastle University. https:\u002F\u002Fyoutu.be\u002FJW0tztpjX8k\n* Mignon AI Presentation at Arm Summit 2020 by Adrian Wheeldon and Jie Lei, Microsystems Research Group, Newcastle University. https:\u002F\u002Fyoutu.be\u002FN-wkgibJAZE\n* Explainability and Dependability Analysis of Learning Automata based AI Hardware. IOLTS presentation by Rishad Shafik, Microsystems Research Group, Newcastle University. https:\u002F\u002Fyoutu.be\u002FIjzZY0fDYiA\n* Tsetlin Machine - A new paradigm for pervasive AI. DATE SCONA Workshop presentation by Adrian Wheeldon, Microsystems Research Group, Newcastle University. https:\u002F\u002Fyoutu.be\u002FTaspuovmSR8\n* Quick Guide to the Tsetlin Machine using Sequential Logic in Logisim. Presentations by Jie Lei, Microsystems Research Group, Newcastle University.\n  * Tsetlin Automaton - https:\u002F\u002Fyoutu.be\u002FXzWSPo7GF94\n  * Clause Calculation - https:\u002F\u002Fyoutu.be\u002FYfrt-W40LiI\n  * Summation and Thresholding - https:\u002F\u002Fyoutu.be\u002FipKHuHMDafU\n* Tsetlin Machine on Iris Data Set Demo with Handheld MignonAI (http:\u002F\u002Fwww.mignon.ai). Presentation by Jie Lei, Microsystems Research Group, Newcastle University. https:\u002F\u002Fyoutu.be\u002FBzaPGByX-hg\n* The-Ruler-of-Tsetlin-Automaton. Presentation by Jie Lei, Microsystems Research Group, Newcastle University. https:\u002F\u002Fyoutu.be\u002FLltDhg4ZuWo\n* Interpretable clustering and dimension reduction with Tsetlin automata machine learning. Presentation by Christian D. Blakely, PwC Switzerland. https:\u002F\u002Fyoutu.be\u002F5-09LOGLcV8\n* Predicting and explaining economic growth using real-time interpretable learning. Presentation by Christian D. Blakely, PwC Switzerland. https:\u002F\u002Fyoutu.be\u002FJ6K7V7V7ayo\n* Early detection of breast cancer from a simple blood test. Presentation by Christian D. Blakely, PwC Switzerland. https:\u002F\u002Fyoutu.be\u002FFrHN_aRLRug\n* Recent advances in Tsetlin Machines. NORA.ai Webinar presentation by Ole-Christoffer Granmo, CAIR, University of Agder. https:\u002F\u002Fyoutu.be\u002FGHelDh3bN00\n\n## Tutorials\n\nConvolutional Tsetlin Machine tutorial, https:\u002F\u002Fgithub.com\u002Fcair\u002Fconvolutional-tsetlin-machine-tutorial\n\n## Acknowledgements\n\nI thank my colleagues from the Centre for Artificial Intelligence Research (CAIR), Lei Jiao, Xuan Zhang, Geir Thore Berge, Darshana Abeyrathna, Saeed Rahimi Gorji, Sondre Glimsdal, Rupsa Saha, Bimal Bhattarai, Rohan K. Yadav, Bernt Viggo Matheussen, Morten Goodwin, Christian Omlin, Vladimir Zadorozhny (University of Pittsburgh), Jivitesh Sharma, Ahmed Abouzeid, and Charul Giri, for their contributions to the development of the Tsetlin machine family of techniques. I would also like to thank our House of CAIR partners, Alex Yakovlev, Rishad Shafik, Ashur Rafiev, Sidharth Maheshwari, Adrian Wheeldon, Jie Lei, Tousif Rahman,  (Newcastle University), Jonny Edwards (Temporal Computing), Marco Wiering (University of Groningen), Christian D. Blakely (PwC Switzerland), Adrian Phoulady, Anders Refsdal Olsen, Halvor Smørvik, and Erik Mathisen for their many contributions.\n\n## Tsetlin Machine Papers\n\n```bash\n@InProceedings{yadav2022robust,\n  title     = {Robust Interpretable Text Classification against Spurious Correlations Using AND-rules with Negation},\n  author    = {Yadav, Rohan Kumar and Jiao, Lei and Granmo, Ole-Christoffer and Goodwin, Morten},\n  booktitle = {Proceedings of the Thirty-First International Joint Conference on\n               Artificial Intelligence, {IJCAI-22}},\n  publisher = {International Joint Conferences on Artificial Intelligence Organization},\n  editor    = {Lud De Raedt},\n  pages     = {4439--4446},\n  year      = {2022},\n  month     = {7},\n  note      = {Main Track}\n  doi       = {10.24963\u002Fijcai.2022\u002F616},\n  url       = {https:\u002F\u002Fdoi.org\u002F10.24963\u002Fijcai.2022\u002F616},\n}\n```\n\n```bash\n@InProceedings{bhattarai2022fakenews,\n  author    = {Bhattarai, Bimal  and  Granmo, Ole-Christoffer  and  Jiao, Lei},\n  title     = {Explainable Tsetlin Machine Framework for Fake News Detection with Credibility Score Assessment},\n  booktitle      = {Proceedings of the Language Resources and Evaluation Conference},\n  month          = {June},\n  year           = {2022},\n  address        = {Marseille, France},\n  publisher      = {European Language Resources Association},\n  pages     = {4894--4903},\n  url       = {https:\u002F\u002Faclanthology.org\u002F2022.lrec-1.523}\n}\n```\n\n```bash\n@InProceedings{bhattarai2022convtext,\n  author    = {Bhattarai, Bimal  and  Granmo, Ole-Christoffer  and  Jiao, Lei},\n  title     = {ConvTextTM: An Explainable Convolutional Tsetlin Machine Framework for Text Classification},\n  booktitle      = {Proceedings of the Language Resources and Evaluation Conference},\n  month          = {June},\n  year           = {2022},\n  address        = {Marseille, France},\n  publisher      = {European Language Resources Association},\n  pages     = {3761--3770},\n  url       = {https:\u002F\u002Faclanthology.org\u002F2022.lrec-1.401}\n}\n```\n\n\n```bash\n@article{saha2021disc,\n  author = {Saha, Rupsa and Granmo, Ole-Christoffer and Goodwin, Morten},\n  title = {Using Tsetlin Machine to discover interpretable rules in natural language processing applications},\n  journal = {Expert Systems},\n  url = {https:\u002F\u002Fonlinelibrary.wiley.com\u002Fdoi\u002Fabs\u002F10.1111\u002Fexsy.12873},\n  year={2021}\n}\n```\n\n```bash\n@article{abeyrathna2021multistep,\n  author = {Abeyrathna, Kuruge Darshana and Granmo, Ole-Christoffer and Shafik, Rishad and Jiao, Lei and Wheeldon, Adrian and Yakovlev, Alex and Lei, Jie and Goodwin, Morten},\n  title = {A multi-step finite-state automaton for arbitrarily deterministic Tsetlin Machine learning},\n  journal = {Expert Systems},\n  url = {https:\u002F\u002Fonlinelibrary.wiley.com\u002Fdoi\u002Fabs\u002F10.1111\u002Fexsy.12836},\n  year={2021}\n}\n```\n\n```bash\n@InProceedings{yadav2021dwr,\n  title={Enhancing Interpretable Clauses Semantically using Pretrained Word Representation},\n  author={Rohan Kumar Yadav and Lei Jiao and Ole-Christoffer Granmo and Morten Goodwin},\n  booktitle={BLACKBOXNLP},\n  url = {https:\u002F\u002Faclanthology.org\u002F2021.blackboxnlp-1.19.pdf},\n  year={2021}\n}\n```\n\n```bash\n@article{jiao2021andorconvergence,\n  title={On the Convergence of Tsetlin Machines for the AND and the OR Operators},\n  author={Lei Jiao and Xuan Zhang and Ole-Christoffer Granmo},\n  journal = {arXiv preprint arXiv:2109.09488}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2109.09488}\n}\n```\n\n```bash\n@InProceedings{wheeldon2021self,\n  title=\"{Self-Timed Reinforcement Learning using Tsetlin Machine}\",\n  author={Adrian Wheeldon and Alex Yakovlev and Rishad Shafik},\n  booktitle={27th IEEE International Symposium on Asynchronous Circuits and Systems (ASYNC 2021)},\n  year={2021},\n  organization={IEEE},\n  url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2109.00846}\n}\n```\n\n```bash\n@article{glimsdal2021coalesced,\n  title={Coalesced Multi-Output Tsetlin Machines with Clause Sharing},\n  author={Sondre Glimsdal and Ole-Christoffer Granmo},\n  journal = {arXiv preprint arXiv:2108.07594}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2108.07594}\n}\n```\n\n```bash\n@article{Abeyrathna2021adaptivesparse,\n  title=\"{Adaptive Sparse Representation of Continuous Input for Tsetlin Machines Based on Stochastic Searching on the Line}\",\n  volume={10},\n  ISSN={2079-9292},\n  url={http:\u002F\u002Fdx.doi.org\u002F10.3390\u002Felectronics10172107},\n  DOI={10.3390\u002Felectronics10172107},\n  number={17},\n  journal={Electronics},\n  publisher={MDPI AG},\n  author={Abeyrathna, Kuruge Darshana and Granmo, Ole-Christoffer and Goodwin, Morten},\n  year={2021},\n  month={Aug},\n  pages={2107}}\n```\n\n```bash\n@article{zhang2021convergence,\n  title = {On the {{Convergence}} of {{Tsetlin Machines}} for the {{IDENTITY}}- and {{NOT Operators}}},\n  author = {Zhang, Xuan and Jiao, Lei and Granmo, Ole-Christoffer and Goodwin, Morten},\n  year = {2021},\n  journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2021parallel,\n  title=\"{Massively Parallel and Asynchronous Tsetlin Machine Architecture Supporting Almost Constant-Time Scaling}\",\n  author={K. Darshana Abeyrathna and Bimal Bhattarai and Morten Goodwin and Saeed Gorji and Ole-Christoffer Granmo and Lei Jiao and Rupsa Saha and Rohan K. Yadav},\n  booktitle={The Thirty-eighth International Conference on Machine Learning (ICML 2021)},\n  year={2021},\n  organization={ICML}\n}\n```\n\n```bash\n@article{sharma2021dropclause,\n  title=\"{Human Interpretable AI: Enhancing Tsetlin Machine Stochasticity with Drop Clause}\",\n  author={Jivitesh Sharma and Rohan Yadav and Ole-Christoffer Granmo and Lei Jiao},\n  journal = {arXiv preprint arXiv:2105.14506}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2105.14506}\n}\n```\n\n```bash\n@article{bhattarai2021fakenews,\n  title=\"{Explainable Tsetlin Machine framework for fake news detection with credibility score assessment}\",\n  author={Bimal Bhattarai and Ole-Christoffer Granmo and Lei Jiao},\n  journal = {arXiv preprint arXiv:2105.09114}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2105.09114}\n}\n```\n\n```bash\n@article{bhattarai2021wordlevel,\n  title=\"{Word-level Human Interpretable Scoring Mechanism for Novel Text Detection Using Tsetlin Machines}\",\n  author={Bimal Bhattarai and Ole-Christoffer Granmo and Lei Jiao},\n  journal = {arXiv preprint arXiv:2105.04708}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2105.04708}\n}\n```\n\n```bash\n@article{lei2021kws,\n  title=\"{Low-Power Audio Keyword Spotting Using Tsetlin Machines}\",\n  author={Jie Lei and Tousif Rahman and Rishad Shafik and Adrian Wheeldon and Alex Yakovlev and Ole-Christoffer Granmo and Fahim Kawsar and Akhil Mathur},\n  journal = {Journal of Low Power Electronics and Applications}, year = {2021},\n  volume=11,\n  issue=18,\n  url = {https:\u002F\u002Fwww.mdpi.com\u002F2079-9268\u002F11\u002F2\u002F18},\n  organization={MDPI}\n}\n```\n\n```bash\n@InProceedings{blakely2021closed,\n  title=\"{Closed-Form Expressions for Global and Local Interpretation of Tsetlin Machines}\",\n  author={Christian D. {Blakely} and Ole-Christoffer {Granmo}},\n  booktitle={34th International Conference on Industrial, Engineering and Other Applications of Applied Intelligent Systems (IEA\u002FAIE 2021)},\n  year={2021},\n  organization={Springer}\n}\n```\n\n```bash\n@InProceedings{gorji2021rl,\n  title=\"{Explainable Reinforcement Learning with the Tsetlin Machine}\",\n  author={Saeed {Gorji} and Ole Christoffer {Granmo} and Marco {Wiering}},\n  booktitle={34th International Conference on Industrial, Engineering and Other Applications of Applied Intelligent Systems (IEA\u002FAIE 2021)},\n  year={2021},\n  organization={Springer}\n}\n```\n\n```bash\n@InProceedings{yadav2021sentiment,\n  title=\"{Human-Level Interpretable Learning for Aspect-Based Sentiment Analysis}\",\n  author={Rohan Kumar {Yadav} and Lei {Jiao} and Ole-Christoffer {Granmo} and Morten {Goodwin}},\n  booktitle={The Thirty-Fifth AAAI Conference on Artificial Intelligence (AAAI-21)},\n  year={2021},\n  organization={AAAI}\n}\n```\n\n```bash\n@InProceedings{nicolae2021question,\n  title=\"{Question Classification using Interpretable Tsetlin Machine}\",\n  author={Dragos Constantin {Nicolae}},\n  booktitle={The 1st International Workshop on Machine Reasoning (MRC 2021)},\n  year={2021}\n}\n```\n\n```bash\n@article{saha2021relational,\n  title=\"{A Relational Tsetlin Machine with Applications to Natural Language Understanding}\",\n  author={Rupsa Saha and Ole-Christoffer Granmo and Vladimir I. Zadorozhny and Morten Goodwin},\n  journal = {arXiv preprint arXiv:2102.10952}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2102.10952}\n}\n```\n\n```bash\n@InProceedings{yadav2021wordsense,\n  title=\"{Interpretability in Word Sense Disambiguation using Tsetlin Machine}\",\n  author={Rohan Kumar {Yadav} and Lei {Jiao} and Ole-Christoffer {Granmo} and Morten {Goodwin}},\n  booktitle={13th International Conference on Agents and Artificial Intelligence (ICAART 2021)},\n  year={2021},\n  organization={INSTICC}\n}\n```\n\n```bash\n@InProceedings{bhattarai2021novelty,\n  title=\"{Measuring the Novelty of Natural Language Text Using the Conjunctive Clauses of a Tsetlin Machine Text Classifier}\",\n  author={Bimal Bhattarai and Lei Jiao and Ole-Christoffer Granmo},\n  booktitle={13th International Conference on Agents and Artificial Intelligence (ICAART 2021)},\n  year={2021},\n  organization={INSTICC}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2021convreg,\n  title=\"{Convolutional Regression Tsetlin Machine}\",\n  author={Abeyrathna, Kuruge Darshana and Granmo, Ole-Christoffer and Goodwin, Morten},\n  booktitle={6th International Conference on Machine Learning Technologies (ICMLT 2021)},\n  year={2021},\n  organization={ACM}\n}\n```\n\n```bash\n@article{abeyrathna2021integer,\n  author = {Abeyrathna, Kuruge Darshana and Granmo, Ole-Christoffer and Goodwin, Morten},\n  title = \"{Extending the Tsetlin Machine With Integer-Weighted Clauses for Increased Interpretability}\",\n  journal = {IEEE Access},\n  volume = 9,\n  year = {2021}\n}\n```\n\n```bash\n@article{jiao2021xor,\n  title=\"{On the Convergence of Tsetlin Machines for the XOR Operator}\",\n  author={Lei Jiao and Xuan Zhang and Ole-Christoffer Granmo and K. Darshana Abeyrathna},\n  journal = {arXiv preprint arXiv:2101.02547}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2101.02547}\n}\n```\n\n```bash\n@InProceedings{wheeldon2021low,\n  title=\"{Low-Latency Asynchronous Logic Design for Inference at the Edge}\",\n  author={Adrian Wheeldon and Alex Yakovlev and Rishad Shafik and Jordan Morris},\n  booktitle={2021 Design, Automation and Test in Europe Conference (DATE21)},\n  year={2021},\n  pages=\"370-373\"\n}\n```\n\n```bash\n@InProceedings{lei2020arithmetic,\n  title=\"{From Arithmetic to Logic Based AI: A Comparative Analysis of Neural Networks and Tsetlin Machine}\",\n  author={Jie {Lei} and Adrian {Wheeldon} and Rishad {Shafik} and Alex {Yakovlev} and Ole-Christoffer {Granmo}},\n  booktitle={27th IEEE International Conference on Electronics Circuits and Systems (ICECS2020)},\n  year={2020},\n  organization={IEEE}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2020auc,\n  title=\"{On Obtaining Classification Confidence, Ranked Predictions and AUC with Tsetlin Machines}\",\n  author={K. Darshana Abeyrathna and Ole-Christoffer Granmo and Morten Goodwin},\n  booktitle={2020 IEEE Symposium Series on Computational Intelligence (SSCI)},\n  year={2020},\n  organization={IEEE}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2020intrusion,\n  title=\"{Intrusion Detection with Interpretable Rules Generated Using the Tsetlin Machine}\",\n  author={K. Darshana Abeyrathna and Harsha S. Gardiyawasam Pussewalage and Sasanka N. Ranasinghea and Vladimir A. Oleshchuk and Ole-Christoffer Granmo},\n  booktitle={2020 IEEE Symposium Series on Computational Intelligence (SSCI)},\n  year={2020},\n  organization={IEEE}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2020adaptive,\n  title=\"{Adaptive Continuous Feature Binarization for Tsetlin Machines Applied to Forecasting Dengue Incidences in the Philippines}\",\n  author={K. Darshana Abeyrathna and Ole-Christoffer Granmo and Xuan Zhang and Morten Goodwin},\n  booktitle={2020 IEEE Symposium Series on Computational Intelligence (SSCI)},\n  year={2020},\n  organization={IEEE}\n}\n```\n\n```bash\n@InProceedings{saha2020causal,\n  author = {Rupsa {Saha} and Ole-Christoffer {Granmo} and Morten {Goodwin}},\n  title = \"{Mining Interpretable Rules for Sentiment and Semantic Relation Analysis using Tsetlin Machines}\",\n  booktitle=\"Lecture Notes in Computer Science: Proceedings of the 40th International Conference on Innovative Techniques and Applications of Artificial Intelligence (SGAI-2020)\", year=\"2020\",\n  publisher=\"Springer International Publishing\"\n}\n```\n\n```bash\n@InProceedings{abeyrathna2020deterministic,\n  title=\"{A Novel Multi-Step Finite-State Automaton for Arbitrarily Deterministic Tsetlin Machine Learning}\",\n  author={K. Darshana Abeyrathna and Ole-Christoffer Granmo and Rishad Shafik and Alex Yakovlev and Adrian Wheeldon and Jie Lei and Morten Goodwin},\n  booktitle=\"Lecture Notes in Computer Science: Proceedings of the 40th International Conference on Innovative Techniques and Applications of Artificial Intelligence (SGAI-2020)\", year=\"2020\",\n  publisher=\"Springer International Publishing\"\n}\n```\n\n```bash\n@article{wheeldon2020learning, \n  author={Adrian {Wheeldon} and Rishad {Shafik} and Tousif {Rahman} and Jie {Lei} and Alex {Yakovlev} and Ole-Christoffer {Granmo}}, \n  journal={Philosophical Transactions of the Royal Society A},\n  title=\"{Learning Automata based Energy-efficient AI Hardware Design for IoT}\",\n  year={2020}\n}\n```\n\n```bash\n@InProceedings{shafik2020explainability,\n  title=\"{Explainability and Dependability Analysis of Learning Automata based AI Hardware}\",\n  author={Rishad {Shafik} and Adrian {Wheeldon} and Alex {Yakovlev}},\n  booktitle={IEEE 26th International Symposium on On-Line Testing and Robust System Design (IOLTS)},\n  year={2020},\n  organization={IEEE}\n}\n```\n\n```bash\n@article{lavrova2020,\n  author = {D. S. {Lavrova} and N. N. {Eliseev}},\n  title = \"{Network Attacks Detection based on Tsetlin Machine}\",\n  pages = {17-23},\n  journal = {Information Security Problems. Computer Systems.}, year = {2020}\n}\n```\n\n```bash\n@InProceedings{gorji2020indexing,\n  title=\"{Increasing the Inference and Learning Speed of Tsetlin Machines with Clause Indexing}\",\n  author={Saeed {Gorji} and Ole Christoffer {Granmo} and Sondre {Glimsdal} and Jonathan {Edwards} and Morten {Goodwin}},\n  booktitle={33rd International Conference on Industrial, Engineering and Other Applications of Applied Intelligent Systems (IEA\u002FAIE 2020)},\n  year={2020},\n  organization={Springer}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2020integerregression,\n  title=\"{A Regression Tsetlin Machine with Integer Weighted Clauses for Compact Pattern Representation}\",\n  author={Abeyrathna, Kuruge Darshana and Granmo, Ole-Christoffer and Goodwin, Morten},\n  booktitle={33rd International Conference on Industrial, Engineering and Other Applications of Applied Intelligent Systems (IEA\u002FAIE 2020)},\n  year={2020},\n  organization={Springer}\n}\n```\n\n```bash\n@InProceedings{phoulady2020weighted, \n  author={Adrian {Phoulady} and Ole-Christoffer {Granmo} and Saeed Rahimi {Gorji} and Hady Ahmady {Phoulady}}, \n  booktitle={Proceedings of the Ninth International Workshop on Statistical Relational AI (StarAI 2020)}, \n  title=\"{The Weighted Tsetlin Machine: Compressed Representations with Clause Weighting}\",\n  year={2020}\n}\n```\n\n```bash\n@InProceedings{wheeldon2020pervasive, \n  author={Adrian {Wheeldon} and Rishad {Shafik} and Alex {Yakovlev} and Jonathan {Edwards} and Ibrahim {Haddadi} and Ole-Christoffer {Granmo}}, \n  booktitle={SCONA Workshop at Design, Automation and Test in Europe (DATE 2020)}, \n  title=\"{Tsetlin Machine: A New Paradigm for Pervasive AI}\",\n  year={2020}\n}\n```\n\n```bash\n@article{abeyrathna2020nonlinear, \n  author={K. Darshana {Abeyrathna} and Ole-Christoffer {Granmo} and Xuan {Zhang} and Lei {Jiao} and Morten {Goodwin}}, \n  journal={Philosophical Transactions of the Royal Society A},\n  title=\"{The Regression Tsetlin Machine - A Novel Approach to Interpretable Non-Linear Regression}\",\n  volume={378}, issue={2164},\n  year={2020}\n}\n```\n\n```bash\n@InProceedings{gorji2019multigranular,\n  author = {Saeed Rahimi {Gorji} and Ole-Christoffer {Granmo} and Adrian {Phoulady} and Morten {Goodwin}},\n  title = \"{A Tsetlin Machine with Multigranular Clauses}\",\n  booktitle=\"Lecture Notes in Computer Science: Proceedings of the Thirty-ninth International Conference on Innovative Techniques and Applications of Artificial Intelligence (SGAI-2019)\", year=\"2019\",\n  volume = {11927},\n  publisher=\"Springer International Publishing\"\n}\n```\n\n```bash\n@article{berge2019text, \n  author={Geir Thore {Berge} and Ole-Christoffer {Granmo} and Tor Oddbjørn {Tveit} and Morten {Goodwin} and Lei {Jiao} and Bernt Viggo {Matheussen}}, \n  journal={IEEE Access}, \n  title=\"{Using the Tsetlin Machine to Learn Human-Interpretable Rules for High-Accuracy Text Categorization with Medical Applications}\",\n  volume={7},\n  pages={115134-115146}, \n  year={2019}, \n  doi={10.1109\u002FACCESS.2019.2935416}, \n  ISSN={2169-3536}\n}\n```\n\n```bash\n@article{granmo2019convtsetlin,\n  author = {{Granmo}, Ole-Christoffer and {Glimsdal}, Sondre and {Jiao}, Lei and {Goodwin}, Morten and {Omlin}, Christian W. and {Berge}, Geir Thore},\n  title = \"{The Convolutional Tsetlin Machine}\",\n  journal = {arXiv preprint arXiv:1905.09688}, year = {2019},\n  url={https:\u002F\u002Farxiv.org\u002Fabs\u002F1905.09688}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2019regressiontsetlin,\n  author = {{Abeyrathna}, Kuruge Darshana and {Granmo}, Ole-Christoffer and {Jiao}, Lei and {Goodwin}, Morten},\n  title = \"{The Regression Tsetlin Machine: A Tsetlin Machine for Continuous Output Problems}\",\n  editor=\"Moura Oliveira, Paulo and Novais, Paulo and Reis, Lu{\\'i}s Paulo \",\n  booktitle=\"Progress in Artificial Intelligence\", year=\"2019\",\n  publisher=\"Springer International Publishing\",\n  pages=\"268--280\"\n}\n```\n\n```bash\n@InProceedings{abeyrathna2019continuousinput,\n  author = {{Abeyrathna}, Kuruge Darshana and {Granmo}, Ole-Christoffer and {Zhang}, Xuan and {Goodwin}, Morten},\n  title = \"{A Scheme for Continuous Input to the Tsetlin Machine with Applications to Forecasting Disease Outbreaks}\",\n  booktitle = \"{Advances and Trends in Artificial Intelligence. From Theory to Practice}\", year = \"2019\",\n  editor = \"Wotawa, Franz and Friedrich, Gerhard and Pill, Ingo and Koitz-Hristov, Roxane and Ali, Moonis\",\n  publisher = \"Springer International Publishing\",\n  pages = \"564--578\"\n}\n```\n\n```bash\n@article{granmo2018tsetlin,\n  author = {{Granmo}, Ole-Christoffer},\n  title = \"{The Tsetlin Machine - A Game Theoretic Bandit Driven Approach to Optimal Pattern Recognition with Propositional Logic}\",\n  journal = {arXiv preprint arXiv:1804.01508}, year = {2018},\n  url={https:\u002F\u002Farxiv.org\u002Fabs\u002F1804.01508}\n}\n```\n\n## Licence\n\nCopyright (c) 2025 Ole-Christoffer Granmo and the University of Agder\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\u002For sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","# 特斯林机\n![许可证](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fmicrosoft\u002Finterpret.svg?style=flat-square) ![维护状态](https:\u002F\u002Fimg.shields.io\u002Fmaintenance\u002Fyes\u002F2026?style=flat-square)\n\n特斯拉特林机的代码和数据集。实现了来自 https:\u002F\u002Farxiv.org\u002Fabs\u002F1804.01508 的特斯拉特林机，包括多分类版本。特斯拉特林机通过由一组特斯拉特林自动机组成的易于解释的命题公式来解决复杂的模式识别问题。\n\n\u003Cp align=\"center\">\n  \u003Cimg width=\"75%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_cfcce137c54f.png\">\n\u003C\u002Fp>\n\n## 目录\n\n- [基础知识](#basics)\n  - [分类](#classification)\n  - [学习](#learning)\n  - [学习行为](#learning-behaviour)\n- [噪声 XOR 演示](#noisy-xor-demo)\n- [要求](#requirements)\n- [其他实现](#other-implementations)\n- [其他架构](#other-architectures)\n- [硬件](#hardware)\n- [书籍](#books)\n- [会议](#conferences)\n- [视频](#videos)\n- [教程](#tutorials)\n- [致谢](#acknowledgements)\n- [特斯拉特林机论文](#tsetlin-machine-papers)\n- [许可证](#licence)\n\n## 基础知识\n\n### 分类\n\n\u003Cp align=\"left\">\n一个基本的特斯拉特林机以布尔特征向量 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_25d39ee3e06d.png\" border=\"0\" valign=\"middle\"\u002F> 作为输入，将其分类为两类之一： \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F> 或 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F>。连同它们的否定形式 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_ab4ad3f56934.png\" border=\"0\" valign=\"middle\"\u002F>，这些特征构成一个文字集合 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_20544493688e.png\" border=\"0\" valign=\"middle\"\u002F>。\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\n特斯拉特林机的模式被表述为一个合取子句 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png\" border=\"0\" valign=\"middle\"\u002F>，它是通过将文字集合 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_4ea6a6d3f06c.png\" border=\"0\" valign=\"middle\"\u002F> 的一个子集进行逻辑与运算而形成的：\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png (X)=\\bigwedge_{{{l}} {\\in} L_j} l = \\prod_{{{l}} {\\in} L_j} l\" border=\"0\" valign=\"middle\"\u002F>.\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\n例如，子句 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)=x_1\\land{\\lnot}x_2=x_1 \\bar{x}_2\" border=\"0\" valign=\"middle\"\u002F> 由文字 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_d7c352e0f0a4.png\" border=\"0\" valign=\"middle\"\u002F> 组成，并且仅当 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_984ea16ef20e.png\" border=\"0\" valign=\"middle\"\u002F> 且 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_6d2f4dc3baa3.png\" border=\"0\" valign=\"middle\"\u002F> 时，才输出 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_f5ba4007a1cb.png\" border=\"0\" valign=\"middle\"\u002F>。\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\n所使用的子句数量是一个用户可配置的参数 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_16d4045ec18c.png\" border=\"0\"\u002F>。其中一半的子句被赋予正极性，另一半则被赋予负极性。随后，这些子句的输出通过求和并使用单位阶跃函数 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_81a2864ee986.png\" border=\"0\" valign=\"middle\"\u002F> 进行阈值处理，从而得出最终的分类决策：\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_7023a8919e30.png\" border=\"0\" valign=\"middle\"\u002F>.\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\n换句话说，分类基于多数投票原则：正极性子句投票支持 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F>，而负极性子句则投票支持 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F>。例如，该分类器\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_2707554a835c.png\" border=\"0\" valign=\"middle\"\u002F>,\n\u003C\u002Fp>\n能够捕捉 XOR 关系。\n\u003C\u002Fp>\n\n### 学习\n\n\u003Cp align=\"left\">\n一个子句 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)\" border=\"0\" valign=\"middle\"\u002F> 由一组采斯林自动机组成，每个采斯林自动机决定是否将特定的文字 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_0b0145da6600.png\" border=\"0\" valign=\"middle\"\u002F> 包含或排除在子句之外（见上图）。学习如何选择包含哪些文字是基于强化学习：I型反馈会产生频繁模式，而II型反馈则会增强模式的区分能力。\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\n采斯林机器是在线学习的，每次处理一个训练样本 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_6dafcf7aa188.png\" border=\"0\" valign=\"middle\"\u002F>。\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg width=\"52%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_3a054495b515.png\">\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\n\u003Cb>I型反馈\u003C\u002Fb>以随机方式给予正极性子句当 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F> 时，以及负极性子句当 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F> 时。受此影响的子句会根据以下因素来强化其内部的每一个采斯林自动机：(i) 子句的输出值 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)\" border=\"0\" valign=\"middle\"\u002F>；(ii) 目标采斯林自动机的动作——“包含”或“排除”；以及 (iii) 分配给该自动机的文字值 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_0b0145da6600.png\" border=\"0\" valign=\"middle\"\u002F>。如表1所示，有两种规则分别独立地控制着子句中每个采斯林自动机的I型反馈：\n\u003C\u002Fp>\n\n* 当 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)=1\" border=\"0\" valign=\"middle\"\u002F> \u003Cb>且\u003C\u002Fb> \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_ae2d69408bc0.png\" border=\"0\" valign=\"middle\"\u002F> 时，“包含”会被奖励，“排除”则会以概率 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_f5a0f6d8e478.png\" border=\"0\" valign=\"middle\"\u002F> 受到惩罚。这种强化作用较强（高概率触发），能够使子句记住并优化它在 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_cf2ca0a97f0a.png\" border=\"0\" valign=\"middle\"\u002F> 中识别出的模式。\n* 如果 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)=0\" border=\"0\" valign=\"middle\"\u002F> \u003Cb>或\u003C\u002Fb> \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_1d862abffaf7.png\" border=\"0\" valign=\"middle\"\u002F>，则“包含”会被以概率 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_6eba47898db3.png\" border=\"0\" valign=\"middle\"\u002F> 惩罚，“排除”则会被奖励。这种强化作用较弱（低概率触发），可以将不常见的模式逐渐转变为常见模式。\n\u003C\u002Fp>\n\n\u003Cp>\n其中，\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_82dbbff6e127.png\" border=\"0\" valign=\"middle\"\u002F> 是一个超参数，用于控制所产生模式的频率。\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg width=\"52%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_a2b2103ab6fb.png\">\n\u003C\u002Fp>\n\n\u003Cp>\n\u003Cb>II型反馈\u003C\u002Fb>以随机方式给予正极性子句当 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F> 时，以及负极性子句当 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F> 时。同样地，受影响的子句会根据以下因素来强化其内部的每个采斯林自动机：(i) 子句的输出值 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)\" border=\"0\" valign=\"middle\"\u002F>；(ii) 目标采斯林自动机的动作——“包含”或“排除”；以及 (iii) 分配给该自动机的文字值 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_0b0145da6600.png\" border=\"0\" valign=\"middle\"\u002F>。如表2所示，当 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c6b9f9c54c06.png(X)=1\" border=\"0\" valign=\"middle\"\u002F> \u003Cb>且\u003C\u002Fb> \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_1ffcb347fbbf.png\" border=\"0\" valign=\"middle\"\u002F> 时，II型反馈会惩罚“排除”操作。这种反馈作用强烈，能够筛选出用于区分 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F> 和 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_59ab40cd85f0.png\" border=\"0\" valign=\"middle\"\u002F> 的候选文字。\n\u003C\u002Fp>\n\n\u003Cp>\n\u003Cb>资源分配\u003C\u002Fb>机制确保子句能够在各种频繁模式之间合理分布，而不是遗漏某些模式而过度集中于其他模式。也就是说，对于任何输入 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_cf2ca0a97f0a.png\" border=\"0\" valign=\"middle\"\u002F>，随着子句输出总和的增加，\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_24aa82ee11ef.png\" border=\"0\" valign=\"middle\"\u002F>\n\u003C\u002Fp>\n\u003Cp>\n接近用户设定的目标值 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_5066b1a2807f.png\" border=\"0\" valign=\"middle\"\u002F>（对于 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F>）时，强化某个子句的概率会逐渐降为零（对于 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_23b9276cfa5b.png\" border=\"0\" valign=\"middle\"\u002F> 则为 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_c09bfafdbec3.png\" border=\"0\" valign=\"middle\"\u002F>）。例如，下图展示了当 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_854b8a7a3d60.png\" border=\"0\" valign=\"middle\"\u002F> 且 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_5066b1a2807f.png=2\" border=\"0\" valign=\"middle\"\u002F> 时，不同子句输出总和 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_612b3377a2f3.png\" border=\"0\" valign=\"middle\"\u002F> 下，强化某个子句的概率变化情况：\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n  \u003Cimg width=\"60%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_1c72a45be38c.png\">\n\u003C\u002Fp>\n\u003Cp>\n如果某个子句未被强化，则它不会对其内部的采斯林自动机产生反馈，这些自动机的状态也就保持不变。极端情况下，当投票总和 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_612b3377a2f3.png\" border=\"0\" valign=\"middle\"\u002F> 等于或超过目标值 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_5066b1a2807f.png\" border=\"0\" valign=\"middle\"\u002F>（即采斯林机器已成功识别输入 \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_cf2ca0a97f0a.png\" border=\"0\" valign=\"middle\"\u002F>）时，所有子句都不会被强化。因此，它们可以自由地学习新的模式，从而自然地平衡模式表示所需的资源。\n\u003C\u002Fp>\n\n\u003Cp>\n详情请参阅 https:\u002F\u002Farxiv.org\u002Fabs\u002F1804.01508。\n\u003C\u002Fp>\n\n### 学习行为\n下图展示了特茨林机在二值化但未进行其他增强处理的MNIST数据集（https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMNIST_database）上的平均学习进度（基于50次运行）。更多信息请参见：https:\u002F\u002Fgithub.com\u002Fcair\u002Ffast-tsetlin-machine-with-mnist-demo。\n\n\u003Cp align=\"center\">\n  \u003Cimg width=\"75%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_readme_60e880c024c6.png\">\n\u003C\u002Fp>\n\n如图所示，测试集和训练集的准确率在各个epoch中几乎呈单调递增趋势。即使训练集上的准确率接近99.9%，测试集上的准确率仍在持续提升，最终在400个epoch后达到98.2%。这与神经网络使用反向传播时的情况截然不同：在缺乏适当正则化机制的情况下，测试集准确率通常会在某个点开始下降，出现过拟合现象。\n\n## 噪声XOR演示\n\n```bash\n.\u002FNoisyXORDemo.py\n\n测试数据准确率（无噪声）：1.0\n训练数据准确率（40%噪声）：0.603\n\n预测：x1 = 1, x2 = 0, ... -> y =  1\n预测：x1 = 0, x2 = 1, ... -> y =  1\n预测：x1 = 0, x2 = 0, ... -> y =  0\n预测：x1 = 1, x2 = 1, ... -> y =  0\n```\n\n## 系统要求\n\n- Python 2.7.x https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F\n- Numpy http:\u002F\u002Fwww.numpy.org\u002F\n- Cython http:\u002F\u002Fcython.org\u002F\n\n## 其他实现\n\n* Tsetlin Machine Unified - 统一代码库，一统天下。实现了Tsetlin机、合并式Tsetlin机、卷积Tsetlin机、回归Tsetlin机和加权Tsetlin机，并支持连续特征、丢弃子句、Type III反馈、聚焦负采样、多任务分类器、自编码器、文字预算以及一对一多分类器。TMU用Python编写，同时提供了C语言和CUDA加速的子句评估与更新接口，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002Ftmu，PyPI链接：https:\u002F\u002Fpypi.org\u002Fproject\u002Ftmu\u002F\n* 面向逻辑型AI的大规模并行与异步架构。实现了Tsetlin机、卷积Tsetlin机、回归Tsetlin机和加权Tsetlin机，并支持连续特征，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002FPyTsetlinMachineCUDA，PyPI链接：https:\u002F\u002Fpypi.org\u002Fproject\u002FPyTsetlinMachineCUDA\u002F\n* 高级Tsetlin机Python API，配备快速C扩展。实现了Tsetlin机、卷积Tsetlin机、回归Tsetlin机、加权Tsetlin机和嵌入式Tsetlin机，并支持连续特征、多粒度子句及子句索引，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002FpyTsetlinMachine，PyPI链接：https:\u002F\u002Fpypi.org\u002Fproject\u002FpyTsetlinMachine\u002F\n* 多线程实现的Tsetlin机、卷积Tsetlin机、回归Tsetlin机和加权Tsetlin机，支持连续特征和多粒度子句，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002FpyTsetlinMachineParallel，PyPI链接：https:\u002F\u002Fpypi.org\u002Fproject\u002FpyTsetlinMachineParallel\u002F\n* 用Julia编写的高性能Tsetlin机实现，具备批处理和底层并行化功能（在MNIST数据集上每秒可完成5200万次分类），项目地址：https:\u002F\u002Fgithub.com\u002FBooBSD\u002FTsetlin.jl\n* 用C语言编写的类并行Tsetlin机，支持日志记录功能，项目地址：https:\u002F\u002Fgithub.com\u002Fashurrafiev\u002FClassParallelTM\n* 用于可视化Tsetlin机状态及学习过程的GUI应用，项目地址：https:\u002F\u002Fgithub.com\u002Fashurrafiev\u002FTsetlinMachineViewer\n* 快速C++实现的加权Tsetlin机，附带MNIST、IMDb和Connect-4演示，项目地址：https:\u002F\u002Fgithub.com\u002Fadrianphoulady\u002Fweighted-tsetlin-machine-cpp\n* 快速基于位操作的C语言实现，附带MNIST演示，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002Ffast-tsetlin-machine-with-mnist-demo\n* CUDA实现，附带IMDb文本分类演示，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002Ffast-tsetlin-machine-in-cuda-with-imdb-demo\n* 硬件实现，项目地址：https:\u002F\u002Fgithub.com\u002FJieGH\u002FHardware_TM_Demo\n* Kivy实现，项目地址：https:\u002F\u002Fgithub.com\u002FDarshanaAbeyrathna\u002FTsetlin-Machine-Based-AI-Enabled-Mobile-App-for-Forecasting-the-Number-of-Corona-Patients\n* C语言实现，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002FTsetlinMachineC\n* 并行化的C++实现，适用于多分类和回归Tsetlin机，并提供与scikit-learn兼容的Python封装，项目地址：https:\u002F\u002Fgithub.com\u002FWojciechMigda\u002FTsetlini，以及https:\u002F\u002Fgithub.com\u002FWojciechMigda\u002FPyTsetlini\n* Rust实现，项目地址：https:\u002F\u002Fgithub.com\u002FKhaledSharif\u002FTsetlinMachine\n* 支持快速位操作的Rust实现，包含MNIST演示，项目地址：https:\u002F\u002Fgithub.com\u002Fjcriddle4\u002Ftsetlin_rust_mnist\n* C++实现，项目地址：https:\u002F\u002Fgithub.com\u002F222464\u002FTsetlinMachine\n* Node.js实现，项目地址：https:\u002F\u002Fgithub.com\u002Fanon767\u002FTsetlinMachine\n* C#实现，项目地址：https:\u002F\u002Fgithub.com\u002Fcokobware\u002FTsetlinMachineCSharp\n* F#实现，项目地址：https:\u002F\u002Fgithub.com\u002Ffwaris\u002FFsTsetlin\n\n## 其他架构\n\n* 卷积Tsetlin机，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002Fconvolutional-tsetlin-machine\n* 图Tsetlin机，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002FGraphTsetlinMachine\n* 回归Tsetlin机，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002Fregression-tsetlin-machine\n* 合并式多输出Tsetlin机，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002FPyCoalescedTsetlinMachineCUDA\u002F\n* 面向逻辑型AI的大规模并行与异步架构，项目地址：https:\u002F\u002Fgithub.com\u002Fcair\u002FPyTsetlinMachineCUDA\n\n## 硬件\n\n* [Literal Labs](https:\u002F\u002Fwww.literal-labs.ai)\n\n## 书籍\n\n* 《Tsetlin机器入门》（https:\u002F\u002Ftsetlinmachine.org）\n\n## 会议\n\n* 国际Tsetlin机器研讨会（ISTM）（https:\u002F\u002Fistm.no）[论文集：2022年（https:\u002F\u002Fieeexplore.ieee.org\u002Fxpl\u002Fconhome\u002F9923753\u002Fproceeding）、2023年（https:\u002F\u002Fieeexplore.ieee.org\u002Fxpl\u002Fconhome\u002F10454903\u002Fproceeding）]\n\n## 视频\n\n* 观看采特林自动机的状态转换。演示者：雷杰，纽卡斯尔大学微系统研究组。https:\u002F\u002Fyoutu.be\u002FwXyiLtlpwHI\n* 使用采特林机器进行关键词检测。演示者：雷杰，纽卡斯尔大学微系统研究组。https:\u002F\u002Fyoutu.be\u002FJW0tztpjX8k\n* Mignon AI 在 2020 年 Arm 峰会上的演讲，由阿德里安·惠尔登和雷杰共同完成，来自纽卡斯尔大学微系统研究组。https:\u002F\u002Fyoutu.be\u002FN-wkgibJAZE\n* 基于学习自动机的 AI 硬件的可解释性与可靠性分析。IOLTS 演讲，由里沙德·沙菲克主讲，纽卡斯尔大学微系统研究组。https:\u002F\u002Fyoutu.be\u002FIjzZY0fDYiA\n* 采特林机器——普适 AI 的新范式。DATE SCONA 工作坊演讲，由阿德里安·惠尔登主讲，纽卡斯尔大学微系统研究组。https:\u002F\u002Fyoutu.be\u002FTaspuovmSR8\n* 使用 Logisim 中的顺序逻辑快速入门采特林机器。纽卡斯尔大学微系统研究组的雷杰主讲。\n  * 采特林自动机——https:\u002F\u002Fyoutu.be\u002FXzWSPo7GF94\n  * 子句计算——https:\u002F\u002Fyoutu.be\u002FYfrt-W40LiI\n  * 求和与阈值处理——https:\u002F\u002Fyoutu.be\u002FipKHuHMDafU\n* 手持式 MignonAI（http:\u002F\u002Fwww.mignon.ai）在 Iris 数据集上的采特林机器演示。纽卡斯尔大学微系统研究组的雷杰主讲。https:\u002F\u002Fyoutu.be\u002FBzaPGByX-hg\n* 采特林自动机之王。纽卡斯尔大学微系统研究组的雷杰主讲。https:\u002F\u002Fyoutu.be\u002FLltDhg4ZuWo\n* 使用采特林自动机机器学习进行可解释的聚类与降维。瑞士普华永道的克里斯蒂安·D·布拉凯利主讲。https:\u002F\u002Fyoutu.be\u002F5-09LOGLcV8\n* 利用实时可解释学习预测并解释经济增长。瑞士普华永道的克里斯蒂安·D·布拉凯利主讲。https:\u002F\u002Fyoutu.be\u002FJ6K7V7V7ayo\n* 通过简单的血液检测早期发现乳腺癌。瑞士普华永道的克里斯蒂安·D·布拉凯利主讲。https:\u002F\u002Fyoutu.be\u002FFrHN_aRLRug\n* 采特林机器的最新进展。NORA.ai 网络研讨会，由奥勒-克里斯托弗·格兰莫主讲，挪威阿格德大学 CAIR 研究中心。https:\u002F\u002Fyoutu.be\u002FGHelDh3bN00\n\n## 教程\n\n卷积采特林机器教程，https:\u002F\u002Fgithub.com\u002Fcair\u002Fconvolutional-tsetlin-machine-tutorial\n\n## 致谢\n\n我感谢人工智能研究中心（CAIR）的同事们——雷娇、张轩、盖尔·索雷·贝格、达尔沙纳·阿贝拉特纳、赛义德·拉希米·戈尔吉、松德雷·格林斯达尔、鲁普萨·萨哈、比马尔·巴塔赖、罗汉·K·亚达夫、伯恩特·维戈·马修森、莫滕·古德温、克里斯蒂安·奥姆林、弗拉基米尔·扎多罗日尼（匹兹堡大学）、吉维特什·夏尔马、艾哈迈德·阿布泽伊德以及查鲁尔·吉里——他们为采特林机器系列技术的发展做出了贡献。同时，我也要感谢我们的 CAIR 合作伙伴们——亚历克斯·亚科夫列夫、里沙德·沙菲克、阿舒尔·拉菲耶夫、西达尔特·马赫什瓦里、阿德里安·惠尔登、雷杰、陶西夫·拉赫曼（纽卡斯尔大学）、乔尼·爱德华兹（Temporal Computing）、马可·韦林（格罗宁根大学）、克里斯蒂安·D·布拉凯利（瑞士普华永道）、阿德里安·福拉迪、安德斯·雷夫斯达尔·奥尔森、哈尔沃尔·斯莫尔维克以及埃里克·马蒂森——他们为我们提供了诸多支持。\n\n## 采特林机器相关论文\n\n```bash\n@InProceedings{yadav2022robust,\n  title     = {利用带否定的 AND 规则对虚假相关性实现稳健可解释文本分类},\n  author    = {Yadav, Rohan Kumar and Jiao, Lei and Granmo, Ole-Christoffer and Goodwin, Morten},\n  booktitle = {第三十一届国际联合人工智能会议论文集，{IJCAI-22}},\n  publisher = {国际联合人工智能会议组织},\n  editor    = {Lud De Raedt},\n  pages     = {4439--4446},\n  year      = {2022},\n  month     = {7},\n  note      = {主赛道}\n  doi       = {10.24963\u002Fijcai.2022\u002F616},\n  url       = {https:\u002F\u002Fdoi.org\u002F10.24963\u002Fijcai.2022\u002F616},\n}\n```\n\n```bash\n@InProceedings{bhattarai2022fakenews,\n  author    = {Bhattarai, Bimal  and  Granmo, Ole-Christoffer  and  Jiao, Lei},\n  title     = {用于假新闻检测并评估可信度分数的可解释采特林机器框架},\n  booktitle      = {语言资源与评估会议论文集},\n  month          = {六月},\n  year           = {2022},\n  address        = {法国马赛},\n  publisher      = {欧洲语言资源协会},\n  pages     = {4894--4903},\n  url       = {https:\u002F\u002Faclanthology.org\u002F2022.lrec-1.523}\n}\n```\n\n```bash\n@InProceedings{bhattarai2022convtext,\n  author    = {Bhattarai, Bimal  and  Granmo, Ole-Christoffer  and  Jiao, Lei},\n  title     = {ConvTextTM：用于文本分类的可解释卷积采特林机器框架},\n  booktitle      = {语言资源与评估会议论文集},\n  month          = {六月},\n  year           = {2022},\n  address        = {法国马赛},\n  publisher      = {欧洲语言资源协会},\n  pages     = {3761--3770},\n  url       = {https:\u002F\u002Faclanthology.org\u002F2022.lrec-1.401}\n}\n```\n\n\n```bash\n@article{saha2021disc,\n  author = {Saha, Rupsa and Granmo, Ole-Christoffer and Goodwin, Morten},\n  title = {利用采特林机器在自然语言处理应用中发现可解释规则},\n  journal = {Expert Systems},\n  url = {https:\u002F\u002Fonlinelibrary.wiley.com\u002Fdoi\u002Fabs\u002F10.1111\u002Fexsy.12873},\n  year={2021}\n}\n```\n\n```bash\n@article{abeyrathna2021multistep,\n  author = {Abeyrathna, Kuruge Darshana and Granmo, Ole-Christoffer and Shafik, Rishad and Jiao, Lei and Wheeldon, Adrian and Yakovlev, Alex and Lei, Jie and Goodwin, Morten},\n  title = {一种用于任意确定性采特林机器学习的多步有限状态自动机},\n  journal = {Expert Systems},\n  url = {https:\u002F\u002Fonlinelibrary.wiley.com\u002Fdoi\u002Fabs\u002F10.1111\u002Fexsy.12836},\n  year={2021}\n}\n```\n\n```bash\n@InProceedings{yadav2021dwr,\n  title={利用预训练词表示语义增强可解释子句},\n  author={Rohan Kumar Yadav 和 Lei Jiao 以及 Ole-Christoffer Granmo 和 Morten Goodwin},\n  booktitle={BLACKBOXNLP},\n  url = {https:\u002F\u002Faclanthology.org\u002F2021.blackboxnlp-1.19.pdf},\n  year={2021}\n}\n```\n\n```bash\n@article{jiao2021andorconvergence,\n  title={关于采特林机器在 AND 和 OR 运算符下的收敛性},\n  author={Lei Jiao 和 Xuan Zhang 以及 Ole-Christoffer Granmo},\n  journal = {arXiv 预印本 arXiv:2109.09488}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2109.09488}\n}\n```\n\n```bash\n@InProceedings{wheeldon2021self,\n  title=\"{使用采特林机器的自定时强化学习}\",\n  author={Adrian Wheeldon 和 Alex Yakovlev 以及 Rishad Shafik},\n  booktitle={第 27 届 IEEE 国际异步电路与系统研讨会（ASYNC 2021）},\n  year={2021},\n  organization={IEEE},\n  url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2109.00846}\n}\n```\n\n```bash\n@article{glimsdal2021coalesced,\n  title={具有子句共享的凝聚型多输出特什林机},\n  author={Sondre Glimsdal 和 Ole-Christoffer Granmo},\n  journal = {arXiv 预印本 arXiv:2108.07594}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2108.07594}\n}\n```\n\n```bash\n@article{Abeyrathna2021adaptivesparse,\n  title=\"{基于线性随机搜索的特什林机连续输入自适应稀疏表示}\",\n  volume={10},\n  ISSN={2079-9292},\n  url={http:\u002F\u002Fdx.doi.org\u002F10.3390\u002Felectronics10172107},\n  DOI={10.3390\u002Felectronics10172107},\n  number={17},\n  journal={Electronics},\n  publisher={MDPI AG},\n  author={Abeyrathna, Kuruge Darshana、Granmo, Ole-Christoffer 和 Goodwin, Morten},\n  year={2021},\n  month={Aug},\n  pages={2107}}\n```\n\n```bash\n@article{zhang2021convergence,\n  title = {关于特什林机对“恒等”与“非”运算符的收敛性},\n  author = {Zhang, Xuan、Jiao, Lei、Granmo, Ole-Christoffer 和 Goodwin, Morten},\n  year = {2021},\n  journal = {IEEE 模式分析与机器智能汇刊}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2021parallel,\n  title=\"{支持近似常数时间扩展的超大规模并行异步特什林机架构}\",\n  author={K. Darshana Abeyrathna、Bimal Bhattarai、Morten Goodwin、Saeed Gorji、Ole-Christoffer Granmo、Lei Jiao、Rupsa Saha 和 Rohan K. Yadav},\n  booktitle={第三十八届国际机器学习会议（ICML 2021）},\n  year={2021},\n  organization={ICML}\n}\n```\n\n```bash\n@article{sharma2021dropclause,\n  title=\"{人类可解释的人工智能：通过丢弃子句增强特什林机的随机性}\",\n  author={Jivitesh Sharma、Rohan Yadav、Ole-Christoffer Granmo 和 Lei Jiao},\n  journal = {arXiv 预印本 arXiv:2105.14506}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2105.14506}\n}\n```\n\n```bash\n@article{bhattarai2021fakenews,\n  title=\"{用于假新闻检测且具备可信度评分评估的可解释特什林机框架}\",\n  author={Bimal Bhattarai、Ole-Christoffer Granmo 和 Lei Jiao},\n  journal = {arXiv 预印本 arXiv:2105.09114}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2105.09114}\n}\n```\n\n```bash\n@article{bhattarai2021wordlevel,\n  title=\"{基于特什林机的新型文本检测用词级人类可解释评分机制}\",\n  author={Bimal Bhattarai、Ole-Christoffer Granmo 和 Lei Jiao},\n  journal = {arXiv 预印本 arXiv:2105.04708}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2105.04708}\n}\n```\n\n```bash\n@article{lei2021kws,\n  title=\"{利用特什林机实现低功耗音频关键词检测}\",\n  author={Jie Lei、Tousif Rahman、Rishad Shafik、Adrian Wheeldon、Alex Yakovlev、Ole-Christoffer Granmo、Fahim Kawsar 和 Akhil Mathur},\n  journal = {低功耗电子与应用期刊}, year = {2021},\n  volume=11,\n  issue=18,\n  url = {https:\u002F\u002Fwww.mdpi.com\u002F2079-9268\u002F11\u002F2\u002F18},\n  organization={MDPI}\n}\n```\n\n```bash\n@InProceedings{blakely2021closed,\n  title=\"{特什林机全局与局部解释的闭式表达式}\",\n  author={Christian D. {Blakely} 和 Ole-Christoffer {Granmo}},\n  booktitle={第34届工业、工程及其他应用智能系统国际会议（IEA\u002FAIE 2021）},\n  year={2021},\n  organization={Springer}\n}\n```\n\n```bash\n@InProceedings{gorji2021rl,\n  title=\"{基于特什林机的可解释强化学习}\",\n  author={Saeed {Gorji}、Ole Christoffer {Granmo} 和 Marco {Wiering}},\n  booktitle={第34届工业、工程及其他应用智能系统国际会议（IEA\u002FAIE 2021）},\n  year={2021},\n  organization={Springer}\n}\n```\n\n```bash\n@InProceedings{yadav2021sentiment,\n  title=\"{面向方面情感分析的人类水平可解释学习}\",\n  author={Rohan Kumar {Yadav}、Lei {Jiao}、Ole-Christoffer {Granmo} 和 Morten {Goodwin}},\n  booktitle={第三十五届 AAAI 人工智能大会（AAAI-21）},\n  year={2021},\n  organization={AAAI}\n}\n```\n\n```bash\n@InProceedings{nicolae2021question,\n  title=\"{使用可解释特什林机进行问题分类}\",\n  author={Dragos Constantin {Nicolae}},\n  booktitle={第一届机器推理国际研讨会（MRC 2021）},\n  year={2021}\n}\n```\n\n```bash\n@article{saha2021relational,\n  title=\"{一种用于自然语言理解的关联特什林机}\",\n  author={Rupsa Saha、Ole-Christoffer Granmo、Vladimir I. Zadorozhny 和 Morten Goodwin},\n  journal = {arXiv 预印本 arXiv:2102.10952}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2102.10952}\n}\n```\n\n```bash\n@InProceedings{yadav2021wordsense,\n  title=\"{利用特什林机进行词义消歧的可解释性研究}\",\n  author={Rohan Kumar {Yadav}、Lei {Jiao}、Ole-Christoffer {Granmo} 和 Morten {Goodwin}},\n  booktitle={第13届代理与人工智能国际会议（ICAART 2021）},\n  year={2021},\n  organization={INSTICC}\n}\n```\n\n```bash\n@InProceedings{bhattarai2021novelty,\n  title=\"{利用特什林机文本分类器的合取子句衡量自然语言文本的新颖性}\",\n  author={Bimal Bhattarai、Lei Jiao 和 Ole-Christoffer Granmo},\n  booktitle={第13届代理与人工智能国际会议（ICAART 2021）},\n  year={2021},\n  organization={INSTICC}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2021convreg,\n  title=\"{卷积回归特什林机}\",\n  author={Abeyrathna, Kuruge Darshana、Granmo, Ole-Christoffer 和 Goodwin, Morten},\n  booktitle={第六届国际机器学习技术会议（ICMLT 2021）},\n  year={2021},\n  organization={ACM}\n}\n```\n\n```bash\n@article{abeyrathna2021integer,\n  author = {Abeyrathna, Kuruge Darshana、Granmo, Ole-Christoffer 和 Goodwin, Morten},\n  title = \"{通过整数权重子句扩展特什林机以提高可解释性}\",\n  journal = {IEEE Access},\n  volume = 9,\n  year = {2021}\n}\n```\n\n```bash\n@article{jiao2021xor,\n  title=\"{关于特什林机对 XOR 运算符的收敛性}\",\n  author={Lei Jiao、Xuan Zhang、Ole-Christoffer Granmo 和 K. Darshana Abeyrathna},\n  journal = {arXiv 预印本 arXiv:2101.02547}, year = {2021},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2101.02547}\n}\n```\n\n```bash\n@InProceedings{wheeldon2021low,\n  title=\"{用于边缘推理的低延迟异步逻辑设计}\",\n  author={Adrian Wheeldon、Alex Yakovlev、Rishad Shafik 和 Jordan Morris},\n  booktitle={2021 年欧洲设计、自动化与测试会议（DATE21）},\n  year={2021},\n  pages=\"370-373\"\n}\n```\n\n```bash\n@InProceedings{lei2020arithmetic,\n  title=\"{从算术到基于逻辑的人工智能：神经网络与特茨林机的比较分析}\",\n  author={Jie {Lei} 和 Adrian {Wheeldon} 和 Rishad {Shafik} 和 Alex {Yakovlev} 和 Ole-Christoffer {Granmo}},\n  booktitle={第27届IEEE电子电路与系统国际会议（ICECS2020）},\n  year={2020},\n  organization={IEEE}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2020auc,\n  title=\"{关于使用特茨林机获取分类置信度、排序预测及AUC}\",\n  author={K. Darshana Abeyrathna 和 Ole-Christoffer Granmo 和 Morten Goodwin},\n  booktitle={2020年IEEE计算智能系列研讨会（SSCI）},\n  year={2020},\n  organization={IEEE}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2020intrusion,\n  title=\"{利用特茨林机生成可解释规则进行入侵检测}\",\n  author={K. Darshana Abeyrathna 和 Harsha S. Gardiyawasam Pussewalage 和 Sasanka N. Ranasinghea 和 Vladimir A. Oleshchuk 和 Ole-Christoffer Granmo},\n  booktitle={2020年IEEE计算智能系列研讨会（SSCI）},\n  year={2020},\n  organization={IEEE}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2020adaptive,\n  title=\"{应用于菲律宾登革热发病率预测的特茨林机自适应连续特征二值化}\",\n  author={K. Darshana Abeyrathna 和 Ole-Christoffer Granmo 和 Xuan Zhang 和 Morten Goodwin},\n  booktitle={2020年IEEE计算智能系列研讨会（SSCI）},\n  year={2020},\n  organization={IEEE}\n}\n```\n\n```bash\n@InProceedings{saha2020causal,\n  author = {Rupsa {Saha} 和 Ole-Christoffer {Granmo} 和 Morten {Goodwin}},\n  title = \"{利用特茨林机挖掘用于情感和语义关系分析的可解释规则}\",\n  booktitle=\"计算机科学讲义：第40届人工智能创新技术与应用国际会议（SGAI-2020）论文集\", year=\"2020\",\n  publisher=\"Springer International Publishing\"\n}\n```\n\n```bash\n@InProceedings{abeyrathna2020deterministic,\n  title=\"{一种新颖的多步有限状态自动机，用于任意确定性特茨林机学习}\",\n  author={K. Darshana Abeyrathna 和 Ole-Christoffer Granmo 和 Rishad Shafik 和 Alex Yakovlev 和 Adrian Wheeldon 和 Jie Lei 和 Morten Goodwin},\n  booktitle=\"计算机科学讲义：第40届人工智能创新技术与应用国际会议（SGAI-2020）论文集\", year=\"2020\",\n  publisher=\"Springer International Publishing\"\n}\n```\n\n```bash\n@article{wheeldon2020learning, \n  author={Adrian {Wheeldon} 和 Rishad {Shafik} 和 Tousif {Rahman} 和 Jie {Lei} 和 Alex {Yakovlev} 和 Ole-Christoffer {Granmo}}, \n  journal={英国皇家学会哲学事务A辑},\n  title=\"{基于学习自动机的物联网节能型人工智能硬件设计}\",\n  year={2020}\n}\n```\n\n```bash\n@InProceedings{shafik2020explainability,\n  title=\"{基于学习自动机的人工智能硬件的可解释性与可靠性分析}\",\n  author={Rishad {Shafik} 和 Adrian {Wheeldon} 和 Alex {Yakovlev}},\n  booktitle={IEEE第26届在线测试与鲁棒系统设计国际研讨会（IOLTS）},\n  year={2020},\n  organization={IEEE}\n}\n```\n\n```bash\n@article{lavrova2020,\n  author = {D. S. {Lavrova} 和 N. N. {Eliseev}},\n  title = \"{基于特茨林机的网络攻击检测}\",\n  pages = {17-23},\n  journal = {信息安全问题·计算机系统}, year = {2020}\n}\n```\n\n```bash\n@InProceedings{gorji2020indexing,\n  title=\"{通过子句索引提高特茨林机的推理与学习速度}\",\n  author={Saeed {Gorji} 和 Ole Christoffer {Granmo} 和 Sondre {Glimsdal} 和 Jonathan {Edwards} 和 Morten {Goodwin}},\n  booktitle={第33届工业、工程及其他应用智能系统国际会议（IEA\u002FAIE 2020）},\n  year={2020},\n  organization={Springer}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2020integerregression,\n  title=\"{具有整数加权子句的回归特茨林机，用于紧凑的模式表示}\",\n  author={Abeyrathna, Kuruge Darshana 和 Granmo, Ole-Christoffer 和 Goodwin, Morten},\n  booktitle={第33届工业、工程及其他应用智能系统国际会议（IEA\u002FAIE 2020）},\n  year={2020},\n  organization={Springer}\n}\n```\n\n```bash\n@InProceedings{phoulady2020weighted, \n  author={Adrian {Phoulady} 和 Ole-Christoffer {Granmo} 和 Saeed Rahimi {Gorji} 和 Hady Ahmady {Phoulady}}, \n  booktitle={第九届统计关系人工智能国际研讨会（StarAI 2020）论文集}, \n  title=\"{加权特茨林机：基于子句加权的压缩表示}\",\n  year={2020}\n}\n```\n\n```bash\n@InProceedings{wheeldon2020pervasive, \n  author={Adrian {Wheeldon} 和 Rishad {Shafik} 和 Alex {Yakovlev} 和 Jonathan {Edwards} 和 Ibrahim {Haddadi} 和 Ole-Christoffer {Granmo}}, \n  booktitle={欧洲设计、自动化与测试大会（DATE 2020）中的SCONA研讨会}, \n  title=\"{特茨林机：普适人工智能的新范式}\",\n  year={2020}\n}\n```\n\n```bash\n@article{abeyrathna2020nonlinear, \n  author={K. Darshana {Abeyrathna} 和 Ole-Christoffer {Granmo} 和 Xuan {Zhang} 和 Lei {Jiao} 和 Morten {Goodwin}}, \n  journal={英国皇家学会哲学事务A辑},\n  title=\"{回归特茨林机——一种新型可解释非线性回归方法}\",\n  volume={378}, issue={2164},\n  year={2020}\n}\n```\n\n```bash\n@InProceedings{gorji2019multigranular,\n  author = {Saeed Rahimi {Gorji} 和 Ole-Christoffer {Granmo} 和 Adrian {Phoulady} 和 Morten {Goodwin}},\n  title = \"{具有多粒度子句的特茨林机}\",\n  booktitle=\"计算机科学讲义：第三十九届人工智能创新技术与应用国际会议（SGAI-2019）论文集\", year=\"2019\",\n  volume = {11927},\n  publisher=\"Springer International Publishing\"\n}\n```\n\n```bash\n@article{berge2019text, \n  author={Geir Thore {Berge} 和 Ole-Christoffer {Granmo} 和 Tor Oddbjørn {Tveit} 和 Morten {Goodwin} 和 Lei {Jiao} 和 Bernt Viggo {Matheussen}}, \n  journal={IEEE Access}, \n  title=\"{利用特茨林机学习人类可解释规则，实现高精度文本分类并应用于医疗领域}\",\n  volume={7},\n  pages={115134-115146}, \n  year={2019}, \n  doi={10.1109\u002FACCESS.2019.2935416}, \n  ISSN={2169-3536}\n}\n```\n\n```bash\n@article{granmo2019convtsetlin,\n  author = {{Granmo}, Ole-Christoffer 和 {Glimsdal}, Sondre 和 {Jiao}, Lei 和 {Goodwin}, Morten 和 {Omlin}, Christian W. 和 {Berge}, Geir Thore},\n  title = \"{卷积特茨林机}\",\n  journal = {arXiv预印本 arXiv:1905.09688}, year = {2019},\n  url={https:\u002F\u002Farxiv.org\u002Fabs\u002F1905.09688}\n}\n```\n\n```bash\n@InProceedings{abeyrathna2019regressiontsetlin,\n  author = {{阿贝拉特纳}, 库鲁格·达尔沙纳和{格兰莫}, 奥莱-克里斯托弗和{焦}, 雷和{古德温}, 莫滕},\n  title = \"{回归型策特林机：一种用于连续输出问题的策特林机}\",\n  editor=\"穆拉·奥利维拉, 保罗和诺瓦伊斯, 保罗和雷斯, 路易斯·保罗 \",\n  booktitle=\"人工智能进展\", year=\"2019\",\n  publisher=\"施普林格国际出版公司\",\n  pages=\"268--280\"\n}\n```\n\n```bash\n@InProceedings{abeyrathna2019continuousinput,\n  author = {{阿贝拉特纳}, 库鲁格·达尔沙纳和{格兰莫}, 奥莱-克里斯托弗和{张}, 玄和{古德温}, 莫滕},\n  title = \"{一种适用于策特林机的连续输入方案及其在疾病暴发预测中的应用}\",\n  booktitle = \"{人工智能的进展与趋势：从理论到实践}\", year = \"2019\",\n  editor = \"沃塔瓦, 弗朗茨和弗里德里希, 格哈德和皮尔, 英戈和科伊茨-赫里斯托夫, 罗克珊和阿里, 穆尼斯\",\n  publisher = \"施普林格国际出版公司\",\n  pages = \"564--578\"\n}\n```\n\n```bash\n@article{granmo2018tsetlin,\n  author = {{格兰莫}, 奥莱-克里斯托弗},\n  title = \"{策特林机——一种基于博弈论多臂老虎机的、以命题逻辑为基础的最优模式识别方法}\",\n  journal = {arXiv预印本 arXiv:1804.01508}, year = {2018},\n  url={https:\u002F\u002Farxiv.org\u002Fabs\u002F1804.01508}\n}\n```\n\n\n\n## 许可证\n\n版权所有 (c) 2025 奥莱-克里斯托弗·格兰莫及阿格德大学\n\n特此授予任何人免费获取本软件及相关文档文件（以下简称“软件”）副本的权利，允许其以任何方式处理该软件，包括但不限于使用、复制、修改、合并、发布、分发、再许可和出售软件副本等行为。但须遵守以下条件：\n\n上述版权声明及本许可声明应包含在软件的所有副本或重要部分中。\n\n“软件”按“原样”提供，不提供任何形式的明示或暗示担保，包括但不限于适销性、特定用途适用性和非侵权性。在任何情况下，作者或版权所有者均不对因使用本软件而产生的任何索赔、损害或其他责任负责，无论此类责任是基于合同、侵权行为或其他原因，亦不论其是否与本软件的使用或与其他方面的交易有关。","# Tsetlin Machine 快速上手指南\n\nTsetlin Machine (TM) 是一种基于布尔逻辑和强化学习的新型机器学习算法。它通过集体协作的“塔塞林自动机”（Tsetlin Automata）构建可解释的命题公式，擅长解决复杂的模式识别问题，且在训练过程中不易过拟合。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows\n*   **Python 版本**：Python 2.7.x (根据原文要求，建议也尝试 Python 3.x，通常此类库在较新版本中也能运行，但严格遵循文档需准备 2.7)\n*   **核心依赖**：\n    *   `numpy`：数值计算库\n    *   `cython`：用于加速 Python 代码的编译扩展\n\n> **国内加速建议**：\n> 安装依赖时，推荐使用清华或阿里镜像源以提升下载速度。\n> 例如：`pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple \u003C包名>`\n\n## 安装步骤\n\n1.  **克隆项目代码**\n    首先从 GitHub 获取源代码：\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Folegranmo\u002FTsetlinMachine.git\n    cd TsetlinMachine\n    ```\n\n2.  **安装依赖库**\n    使用 pip 安装必要的 Python 包（推荐国内镜像）：\n    ```bash\n    pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple numpy cython\n    ```\n\n3.  **编译扩展（如需）**\n    如果项目中包含 `.pyx` 文件，可能需要先编译 Cython 扩展。通常在运行示例脚本前，确保当前目录下已生成对应的 `.so` (Linux\u002FMac) 或 `.pyd` (Windows) 文件。部分实现可能需要在 setup.py 存在时运行：\n    ```bash\n    python setup.py build_ext --inplace\n    ```\n    *(注：若直接运行提供的 demo 脚本报错缺少模块，请执行此步)*\n\n## 基本使用\n\n项目提供了一个经典的“噪声异或（Noisy XOR）”演示脚本，用于展示 Tsetlin Machine 的学习能力和抗噪性。\n\n### 运行示例\n\n在项目根目录下直接运行演示脚本：\n\n```bash\npython NoisyXORDemo.py\n```\n\n### 预期输出\n\n运行成功后，您将看到类似以下的输出，展示了模型在无噪声测试集和高噪声训练集上的表现，以及具体的逻辑预测规则：\n\n```text\nAccuracy on test data (no noise): 1.0\nAccuracy on training data (40% noise): 0.603\n\nPrediction: x1 = 1, x2 = 0, ... -> y =  1\nPrediction: x1 = 0, x2 = 1, ... -> y =  1\nPrediction: x1 = 0, x2 = 0, ... -> y =  0\nPrediction: x1 = 1, x2 = 1, ... -> y =  0\n```\n\n### 结果解读\n*   **准确率**：模型在纯净测试数据上达到了 100% 的准确率，证明了其强大的泛化能力。\n*   **可解释性**：输出清晰地展示了学习到的逻辑规则（即 XOR 关系：当两个输入不同时输出 1，相同时输出 0），体现了 TM 模型“白盒”可解释的特性。","某金融风控团队正在构建信用卡欺诈检测系统，需要在毫秒级内判断交易是否异常，同时必须向监管机构和用户清晰解释判定理由。\n\n### 没有 TsetlinMachine 时\n- 深度学习模型虽能识别复杂模式，但如同“黑盒”，无法输出人类可读的决策逻辑，导致合规审查困难。\n- 传统规则引擎依赖专家手动编写\"If-Then\"语句，难以自动发现数据中隐蔽的非线性关联（如特定时间与地点的组合风险）。\n- 模型训练和推理过程消耗大量 GPU 算力，在边缘设备或低资源服务器上部署成本高昂且延迟较高。\n- 当出现误判时，开发人员只能猜测特征权重，无法精确定位是哪几个具体条件触发了警报。\n\n### 使用 TsetlinMachine 后\n- TsetlinMachine 直接生成由布尔逻辑组成的命题公式（如“夜间交易 AND 非本地 IP\"），让每个判定结果都有据可查，轻松满足合规要求。\n- 通过集体自动机协作，TsetlinMachine 能自动从数据中学习并组合出复杂的逻辑子句，无需人工预设规则即可捕捉隐蔽的欺诈模式。\n- 基于逻辑运算的特性使得 TsetlinMachine 仅需极低算力即可运行，能在普通 CPU 甚至嵌入式芯片上实现超低延迟推理。\n- 开发者可以直接阅读生成的逻辑子句，精确理解是哪些特征的组合导致了分类结果，极大提升了调试效率和模型可信度。\n\nTsetlinMachine 的核心价值在于打破了高精度与高可解释性之间的壁垒，用简单的逻辑公式解决了复杂的模式识别难题。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcair_TsetlinMachine_37175874.png","cair","Centre for Artificial Intelligence Research (CAIR)","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fcair_e30de74a.png","CAIR is a centre for research excellence on artificial intelligence at the University of Agder. We attack unsolved problems, seeking superintelligence. ",null,"cair-internal@uia.no","https:\u002F\u002Fcair.uia.no\u002F","https:\u002F\u002Fgithub.com\u002Fcair",[81,85],{"name":82,"color":83,"percentage":84},"Cython","#fedf5b",85,{"name":86,"color":87,"percentage":88},"Python","#3572A5",15,497,59,"2026-04-16T16:59:25","MIT",1,"","未说明",{"notes":97,"python":98,"dependencies":99},"该工具基于经典的 Tsetlin Machine 算法实现，主要依赖 Python 2.7 环境（注意：Python 2.7 已停止官方维护）。需要安装 Numpy 进行数值计算，以及 Cython 用于可能的性能优化。README 中未明确指定支持的操作系统，但鉴于其依赖项为通用 Python 库，通常可在 Linux、macOS 和 Windows 上运行。未提及 GPU 加速需求，推测主要在 CPU 上运行。","2.7.x",[100,101],"numpy","cython",[14,16],[104,105,106,107,108,109,110,111],"tsetlin-machine","machine-learning","game-theory","propositional-logic","pattern-recognition","bandit-learning","frequent-pattern-mining","learning-automata","2026-03-27T02:49:30.150509","2026-04-20T07:17:13.800641",[115,120,125,129,134,138],{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},44118,"编译时遇到 'numpy\u002Farrayobject.h' file not found 错误怎么办？","该错误通常是因为缺少正确的 Cython 构建配置。确保已安装 numpy 和 cython 依赖。可以使用 `cythonize` 命令单独编译 .pyx 文件，例如：`cythonize -a -i MultiClassTsetlinMachine.pyx`。如果在 setup.py 中配置，需确保 `include_dirs` 包含 `numpy.get_include()`。避免将多个 .pyx 文件编译到同一个扩展模块中以防止符号重复（duplicate symbol）错误，应为每个 .pyx 文件创建独立的 Extension 或使用 cythonize 自动处理。","https:\u002F\u002Fgithub.com\u002Fcair\u002FTsetlinMachine\u002Fissues\u002F1",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},44119,"Tsetlin Machine 如何处理输入特征的否定形式（Negated Literals）？","Tsetlin Machine 在构建子句时会同时考虑原始输入值及其否定形式。例如，若原始输入为 X = [x1, x2, x3] = [1, 0, 1]，TM 会将其扩展为 [x1, ¬x1, x2, ¬x2, x3, ¬x3]，即 [1, 0, 0, 1, 1, 0]。代码中每个自动机有 `2 * number_of_states` 个状态：状态 0 到 `number_of_states` 决定从子句中排除该文字，而状态 `number_of_states + 1` 到 `2 * number_of_states` 决定将该文字包含在子句中。","https:\u002F\u002Fgithub.com\u002Fcair\u002FTsetlinMachine\u002Fissues\u002F13",{"id":126,"question_zh":127,"answer_zh":128,"source_url":124},44120,"Type I 反馈机制中，当子句输出为 1 且文字值为 1 时，为何还会产生惩罚（Penalty）？","这是一个常见的理解误区。在 Type I(a) 反馈规则中（条件：子句输出 Cj(X)=1 且文字 lk=1），如果自动机状态决定“包含”该文字（即状态非负），则不会发生惩罚，只会发生奖励或无操作。惩罚通常发生在自动机状态决定“排除”该文字（状态为负），但该文字实际值为 1 的情况，或者在特定的反馈类型（如 Type II）下。简而言之，如果自动机已经选择了包含该文字且该文字为真，根据标准 TM 算法，此时不应触发针对“包含”操作的惩罚逻辑。",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},44121,"在尝试将 Tsetlin Machine 移植到 NumPy 时，模型无法收敛或训练结果不佳，常见原因是什么？","一个常见且隐蔽的错误是随机掩码（rand_mask）的形状不正确。在生成随机数进行状态更新采样时，掩码的形状必须与状态数组的形状完全匹配。例如，错误地使用了 `(1,) * self.state.ndim` 而不是 `self.state.shape` 会导致广播机制工作异常，从而破坏训练逻辑。确保所有向量化操作的维度对齐是解决此类问题的关键。","https:\u002F\u002Fgithub.com\u002Fcair\u002FTsetlinMachine\u002Fissues\u002F16",{"id":135,"question_zh":136,"answer_zh":137,"source_url":133},44122,"如何实现支持多分类（Multi-class）的 Tsetlin Machine 数据结构？","多分类 Tsetlin Machine 的状态通常需要存储在一个 5 维数组中，形状为 `(n_classes, 2, clause_dim, 2, in_dim)`。各维度含义如下：\n1. Axis 0: 类别索引 (class index)\n2. Axis 1: 极性 (polarity, 0: 投票给 y=0, 1: 投票给 y=1)\n3. Axis 2: 每个极性下的子句索引 (clause index)\n4. Axis 3: 文字类型 (0: 原始文字, 1: 否定文字)\n5. Axis 4: 输入特征维度 (input feature)\n初始化时，通常将状态设置为接近动作阈值的空子句状态（例如 -1）。",{"id":139,"question_zh":140,"answer_zh":141,"source_url":124},44123,"C++ 实现 Type I 反馈表时，奖励和惩罚的计算逻辑是怎样的？","Type I 反馈表的实现核心在于根据子句输出、文字值和包含状态计算概率。奖励概率通常为 `1\u002FS`，惩罚概率为 `(S-1)\u002FS`（其中 S 是特异性参数）。具体逻辑是：如果子句输出和文字值均为真，且文字被包含，则根据概率给予奖励；如果文字未被包含但值为真，可能给予惩罚以鼓励包含。在代码实现中，通常使用伯努利采样 `rand_bernoulli(probability)` 来决定是否更新状态，并根据自动机当前状态的极性（正或负）决定是增加还是减少状态值（饱和加减法）。",[]]