[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-dso-org--deep-symbolic-optimization":3,"tool-dso-org--deep-symbolic-optimization":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 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,52],"视频",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[14,35],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":75,"owner_location":75,"owner_email":75,"owner_twitter":75,"owner_website":75,"owner_url":76,"languages":77,"stars":86,"forks":87,"last_commit_at":88,"license":89,"difficulty_score":32,"env_os":90,"env_gpu":91,"env_ram":91,"env_deps":92,"category_tags":102,"github_topics":75,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":104,"updated_at":105,"faqs":106,"releases":135},4297,"dso-org\u002Fdeep-symbolic-optimization","deep-symbolic-optimization","A deep learning framework for symbolic optimization.","deep-symbolic-optimization（DSO）是一个基于深度学习的符号优化框架，旨在让机器自动发现简洁、可解释的数学公式或控制策略。它主要解决两大核心问题：一是“符号回归”，即从复杂数据中还原出精确的数学表达式；二是“符号控制”，即在强化学习环境中推导出高效的符号化决策策略。\n\n与传统黑盒模型不同，DSO 生成的结果是人类可读的公式，兼具高精度与强可解释性。该框架在权威的 SRBench 基准测试中表现卓越，不仅在符号解发现率和准确率上达到业界领先水平，更荣获 2022 年 GECCO 符号回归竞赛现实赛道冠军。其技术亮点在于巧妙结合了深度神经网络与策略梯度搜索，通过“风险寻求”机制引导模型探索更优的符号结构，并支持融入领域先验知识以提升搜索效率。\n\ndeep-symbolic-optimization 非常适合科研人员、算法工程师及数据科学家使用，尤其是那些需要在物理建模、控制系统设计或可解释 AI 领域深入探索的专业人士。虽然它提供了定义新任务的接口，但需要用户具备一定的编程基础（Python）和机器学习背景。对于希望摆脱纯数据驱动黑盒、追求数学本质规律的研究者而言","deep-symbolic-optimization（DSO）是一个基于深度学习的符号优化框架，旨在让机器自动发现简洁、可解释的数学公式或控制策略。它主要解决两大核心问题：一是“符号回归”，即从复杂数据中还原出精确的数学表达式；二是“符号控制”，即在强化学习环境中推导出高效的符号化决策策略。\n\n与传统黑盒模型不同，DSO 生成的结果是人类可读的公式，兼具高精度与强可解释性。该框架在权威的 SRBench 基准测试中表现卓越，不仅在符号解发现率和准确率上达到业界领先水平，更荣获 2022 年 GECCO 符号回归竞赛现实赛道冠军。其技术亮点在于巧妙结合了深度神经网络与策略梯度搜索，通过“风险寻求”机制引导模型探索更优的符号结构，并支持融入领域先验知识以提升搜索效率。\n\ndeep-symbolic-optimization 非常适合科研人员、算法工程师及数据科学家使用，尤其是那些需要在物理建模、控制系统设计或可解释 AI 领域深入探索的专业人士。虽然它提供了定义新任务的接口，但需要用户具备一定的编程基础（Python）和机器学习背景。对于希望摆脱纯数据驱动黑盒、追求数学本质规律的研究者而言，这是一个强大且经过学术验证的开源代码库。","# Deep Symbolic Optimization\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdso-org_deep-symbolic-optimization_readme_edbb8ae0b5fd.png\" width=750\u002F>\n\u003C\u002Fp>\n\nDeep Symbolic Optimization (DSO) is a deep learning framework for symbolic optimization tasks. The package `dso` includes the core symbolic optimization algorithms, as well as support for two particular symbolic optimization tasks: (1) _symbolic regression_ (recovering tractable mathematical expressions from an input dataset) and (2) discovering _symbolic policies_ for reinforcement learning environments. In the code, these tasks are referred to as `regression` and `control`, respectively. We also include a simple interface for defining new tasks.\n\n> **Note**\n> Looking for a modern PyTorch-based codebase? See https:\u002F\u002Fgithub.com\u002Fdso-org\u002Fdeep-symbolic-optimization-pytorch — a refactor of DSO that replaces TensorFlow with PyTorch for all neural-network components.\n\nOn symbolic regression, DSO was benchmarked against the SRBench benchmark set and achieves state-of-the-art in both symbolic solution rate and accuracy solution rate:\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdso-org_deep-symbolic-optimization_readme_58ce8898af93.png\" width=300\u002F>\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdso-org_deep-symbolic-optimization_readme_6b78f53e115b.png\" width=300\u002F>\n\u003C\u002Fp>\n\nDSO also won [1st place](https:\u002F\u002Fcavalab.org\u002Fsrbench\u002Fcompetition-2022\u002F#real-world-track-rankings) in the Real-World Track of the 2022 SRBench Symbolic Regression Competition held at the GECCO 2022 conference.\n\nThis repository contains code supporting the following publications:\n1. Petersen et al. 2021 **Deep symbolic regression: Recovering mathematical expressions from data via risk-seeking policy gradients.** *ICLR 2021.* [Oral](https:\u002F\u002Ficlr.cc\u002Fvirtual\u002F2021\u002Fposter\u002F2578) [Paper](https:\u002F\u002Fopenreview.net\u002Fforum?id=m5Qsh0kBQG)\n2. Landajuela et al. 2021 **Discovering symbolic policies with deep reinforcement learning.** *ICML 2021.* [Paper](https:\u002F\u002Fproceedings.mlr.press\u002Fv139\u002Flandajuela21a.html)\n3. Mundhenk et al. 2021 **Symbolic Regression via Neural-Guided Genetic Programming Population Seeding.** *NeurIPS 2021* [Paper](https:\u002F\u002Fproceedings.neurips.cc\u002Fpaper\u002F2021\u002Fhash\u002Fd073bb8d0c47f317dd39de9c9f004e9d-Abstract.html)\n4. Landajuela et al. 2022 **A Unified Framework for Deep Symbolic Regression.** *NeurIPS 2022* [Paper](https:\u002F\u002Fopenreview.net\u002Fforum?id=2FNnBhwJsHK)  \n5. Landajuela et al. 2021 **Improving exploration in policy gradient search: Application to symbolic optimization.** *Math-AI @ ICLR 2021.* [Paper](https:\u002F\u002Fmathai-iclr.github.io\u002Fpapers\u002Fpapers\u002FMATHAI_16_paper.pdf)\n6. Kim et al. 2020 **An interactive visualization platform for deep symbolic regression.** *IJCAI 2020.* [Paper](https:\u002F\u002Fwww.ijcai.org\u002FProceedings\u002F2020\u002F0763.pdf)\n7. Petersen et al. 2021 **Incorporating domain knowledge into neural-guided search via *in situ* priors and constraints** *AutoML @ ICML 2021.* [Paper]()\n8. Kim et al. 2021 **Distilling Wikipedia mathematical knowledge into neural network models.** *Math-AI @ ICLR 2021.* [Paper](https:\u002F\u002Fmathai-iclr.github.io\u002Fpapers\u002Fpapers\u002FMATHAI_15_paper.pdf)\n9. Silva et al. 2022 **Leveraging Language Models to Efficiently Learn Symbolic Optimization Solutions** *ALA Workshop 2022.* [Paper](https:\u002F\u002Fala2022.github.io\u002Fpapers\u002FALA2022_paper_24.pdf)\n10. Glatt et al. 2022 **Deep Symbolic Optimization for Electric Component Sizing in Fixed Topology Power Converters** *AI for Design and Manufacturing (ADAM) @ AAAI 2022.* [Paper](https:\u002F\u002Fopenreview.net\u002Fforum?id=u_ghY9PnAyZ)\n11. Pettit et al. 2025 **DisCo-DSO: Coupling Discrete and Continuous Optimization for Efficient Generative Design in Hybrid Spaces.** *AAAI 2025* [Paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2412.11051) [Blog Post](https:\u002F\u002Flandajuela.github.io\u002Fdiscrete_continuous_autoregressive\u002F)\n\n# Installation\n\n### Installation - Core package\n\nThe core package has been tested on Python3.6+ on Unix and OSX. To install the core package (and the default `regression` task), we highly recommend first creating a Python 3 virtual environment, e.g.,\n\n```\npython3 -m venv venv3 # Create a Python 3 virtual environment\nsource venv3\u002Fbin\u002Factivate # Activate the virtual environment\n```\nThen, from the repository root:\n```\npip install --upgrade setuptools pip\nexport CFLAGS=\"-I $(python -c \"import numpy; print(numpy.get_include())\") $CFLAGS\" # Needed on Mac to prevent fatal error: 'numpy\u002Farrayobject.h' file not found\npip install -e .\u002Fdso # Install DSO package and core dependencies\n```\n\nThe `regression` task is installed by default. It doesn't require any of the installation options below.\n\n### Installation - `control` task\nThere are a few additional dependencies to run the `control` task. Install them using:\n```\npip install -e .\u002Fdso[control]\n```\n\n### Installation - all tasks\nTo install all dependencies for all tasks, use the `all` option:\n\n```\npip install -e .\u002Fdso[all]\n```\n\n# Getting started\n\nDSO relies on configuring runs via a JSON file, then launching them via a simple command-line or a few lines of Python.\n\n### Method 1: Running DSO via command-line interface\n\nAfter creating your config file, simply run:\n```\npython -m dso.run path\u002Fto\u002Fconfig.json\n```\nAfter training, results are saved to a timestamped directory in the path given in the `\"logdir\"` parameter (default `.\u002Flog`).\n\n### Method 2: Running DSO via Python interface\n\nThe Python interface lets users instantiate and customize DSO models via Python scripts, an interactive Python shell, or an iPython notebook. The core DSO model is `dso.core.DeepSymbolicOptimizer`. After creating your config file, you can use:\n```\nfrom dso import DeepSymbolicOptimizer\n\n# Create and train the model\nmodel = DeepSymbolicOptimizer(\"path\u002Fto\u002Fconfig.json\")\nmodel.train()\n```\nAfter training, results are saved to a timestamped directory in the path given in `config[\"training\"][\"logdir\"]` (default `.\u002Flog`).\n\n### Configuring runs\n\nA single JSON file is used to configure each run. This file specifies the symbolic optimization task and all hyperparameters.\n\nEach configuration JSON file has a number of top-level keys that control various parts of the DSO framework. The important top-level keys are:\n* `\"experiment\"` configures the experiment, namely the log directory and random number seed.\n* `\"task\"` configures the task, e.g., the dataset for symbolic regression, or the Gym environment for the `control` task. See below for task-specific configuration.\n* `\"logging\"` configures the output files for the execution of the algorithm, such as `\"save_all_iterations\"` to save detailed statistics for every iteration.\n* `\"training\"` configures training hyperparameters like `\"n_samples\"` (the total number of samples to generate) and `\"epsilon\"` (the risk factor used by the risk-seeking policy gradient).\n* `\"policy\"` configures policy hyperparameters like `\"max_length\"` and `\"num_layers\"`.\n* `\"policy_optimizer\"` configures policy optimization hyperparameters like `\"learning_rate\"` and `\"optimizer\"`.\n* `\"gp_meld\"` configures genetic programming hyperparameters.\n* `\"prior\"` configures the priors and constraints on the search space.\n\nAny parameters not included in your config file assume default values found in `config\u002Fconfig_common.json`, `config\u002Fconfig_regression.json` (for `regression` runs), and `config\u002Fconfig_control.json` (for `control` runs).\n\n##### Configuring runs for symbolic regression\n\nHere are simple example contents of a JSON file for the `regression` task:\n\n```\n{\n  \"task\" : {\n    \"task_type\" : \"regression\",\n    \"dataset\" : \"path\u002Fto\u002Fmy_dataset.csv\",\n    \"function_set\" : [\"add\", \"sub\", \"mul\", \"div\", \"sin\", \"cos\", \"exp\", \"log\", \"poly\"]\n  }\n}\n```\nThis configures DSO to learn symbolic expressions to fit your custom dataset, using the tokens specified in `function_set` (see `dso\u002Ffunctions.py` for a list of supported tokens).\n\nYou can test symbolic regression out of the box with a default configuration, after running setup, with a command such as:\n\n```\npython -m dso.run dso\u002Fconfig\u002Fconfig_regression.json --b Nguyen-7\n```\n\nThis will run DSO on the regression task with benchmark Nguyen-7.\n\nIf you want to include optimized floating-point constants in the search space, simply include `\"const\"` in the `function_set` list. Note that constant optimization uses an inner-optimization loop, which leads to much longer runtimes (~hours instead of ~minutes).\n\nIf you want to include the powerful LINEAR token (called `poly` in the code)--introduced in the unified deep symbolic regression (uDSR) NeurIPS 2022 paper--in the search space, simply include `\"poly\"` in the `function_set` list. Polynomial optimization adds a bit of overhead, but not nearly as much as the `const` token; thus, we highly recommend this token for most applications.\n\nYou can further configure the LINEAR\u002F`poly` token by adjusting the `poly_optimizer_params` in the config, for example:\n```\n{\n  \"task\" : {\n    \"task_type\" : \"regression\",\n    \"dataset\" : \"path\u002Fto\u002Fmy_dataset.csv\",\n    \"function_set\" : [\"add\", \"sub\", \"mul\", \"div\", \"sin\", \"cos\", \"exp\", \"log\", \"poly\"]\n    \"poly_optimizer_params\" : {\n      \"degree\": 3,\n      \"coef_tol\": 1e-6,\n      \"regressor\": \"dso_least_squares\"\n      \"regressor_params\": {}\n    }\n  }\n}\n ```\nWithin `poly_optimizer_params`, `degree` specifies the degree of the polynomials to be fit, `coef_tol` is a threshold value used to remove terms with sufficiently small coefficients, and `regressor` is the underlying regressor used to learn the polynomial coefficients. The default `regressor` is our in-house implementation of least squares called `dso_least_squares`, which optimizes the fitting process during the expression-learning loop. Other than `dso_least_squares`, we also support `sklearn` regressors `linear_regression`, `lasso`, and `ridge`. Depending on the `regressor`, parameters can be configured through `regressor_params`.\n\n##### Configuring runs for learning symbolic control policies\n\nHere's a simple example for the `control` task:\n```\n{\n  \"task\" : {\n    \"task_type\" : \"control\",\n    \"env\" : \"MountainCarContinuous-v0\",\n    \"function_set\" : [\"add\", \"sub\", \"mul\", \"div\", \"sin\", \"cos\", \"exp\", \"log\", 1.0, 5.0, 10.0]\n  }\n}\n```\nThis configures DSO to learn a symbolic policy for MountainCarContinuous-v0, using the tokens specified in `function_set` (see `dso\u002Ffunctions.py` for a list of supported tokens).\n\nFor environments with multi-dimensional action spaces, DSO requires a pre-trained \"anchor\" policy. DSO is run once per action dimension, and the `\"action_spec\"` parameter is updated each run. For an environment with `N` action dimesions, `\"action_spec\"` is a list of length `N`. A single element should be `null`, meaning that is the symbolic action to be learned. Any number of elements can be `\"anchor\"`, meaning the anchor policy will determine those actions. Any number of elements can be expression traversals (e.g., `[\"add\", \"x1\", \"x2\"]`), meaning that fixed symbolic policy will determine those actions.\n\nHere's an example workflow for HopperBulletEnv-v0, which has three action dimensions. First, learn a symbolic policy for the first action by running DSO with a config like:\n```\n{\n  \"task\" : {\n    \"task_type\" : \"control\",\n    \"name\" : \"HopperBulletEnv-v0\",\n    \"function_set\" : [\"add\", \"sub\", \"mul\", \"div\", \"sin\", \"cos\", \"exp\", \"log\", 1.0, 5.0, 10.0],\n    \"action_spec\" : [null, \"anchor\", \"anchor\"],\n    \"anchor\" : \"path\u002Fto\u002Fanchor.pkl\"\n  }\n}\n```\nwhere `\"path\u002Fto\u002Fanchor.pkl\"` is a path to a `stable_baselines` model. (The environments used in the ICML paper have default values for `anchor`, so you do not have to specify one.) After running, let's say the best expression has traversal `[\"add\", \"x1\", \"x2\"]`. To launch the second round of DSO, update the config's `action_spec` to use the fixed symbolic policy for the first action, learn a symbolic policy for the second action, and use the anchor again for the third action:\n```\n\"action_spec\" : [[\"add\", \"x1\", \"x2\"], null, \"anchor\"]\n```\nAfter running DSO, say the second action's traversal is [\"div\", \"x3\", \"x4\"]. Finally, update the `action_spec` to:\n```\n\"action_spec\" : [[\"add\", \"x1\", \"x2\"], [\"div\", \"x3\", \"x4\"], null]\n```\nand rerun DSO. The final result is a fully symbolic policy.\n\n##### Configuring runs for learning decision tree policies\n\nDSO can also be configured to learn a decision tree policy.\nThis is done by specifying `decision_tree_threshold_set` in `\"task\"`, which is a set of thresholds on the values of state variables when making a decision.\nIn particular, for each threshold `tj` in `decision_tree_threshold_set`, `StateChecker` tokens `xi \u003C tj` for all\nstate variables `xi` will be added to the `Library`.\n\nFor example, for `MountainCarContinuous-v0`, here is an example config:\n```\n{\n  \"task\" : {\n    \"task_type\" : \"control\",\n    \"env\" : \"MountainCarContinuous-v0\",\n    \"function_set\" : [\"add\", \"sub\", \"mul\", \"div\", \"sin\", \"cos\", \"exp\", \"log\", 1.0, 5.0, 10.0]\n    \"decision_tree_threshold_set\" : [-0.05, 0.0, 0.01]\n  }\n}\n```\nOther than the functions specified in `function_set`, this will also add `x1 \u003C -0.05`, `x1 \u003C 0.0`, `x1 \u003C 0.01`, `x2 \u003C -0.05`, `x2 \u003C 0.0`, and `x2 \u003C 0.01`\nto the `Library` because `MountainCarContinuous-v0` has two state variables.\nWith these `StateChecker` tokens, decision tree policies like \"if `x1` \u003C -0.05 and `x2` \u003C 0.0, the action is `exp(x1) + 1.0`; otherwise, the action is `sin(10 * x2)`\" can be sampled.\n\n### Using the Neural-Guided Genetic Programming Population Seeding Controller\n\nTo include the genetic programming inner-loop optimizer introduced in NeurIPS 2021, insert a field in your config for `\"gp_meld\"`. You can play with the different parameters. The most important part is to set `\"run_gp_meld\"` to true.\n```\n{\n  \"gp_meld\" : {\n    \"run_gp_meld\" : true,\n    \"verbose\" : false,\n    \"generations\" : 20,\n    \"p_crossover\" : 0.5,\n    \"p_mutate\" : 0.5,\n    \"tournament_size\" : 5,\n    \"train_n\" : 50,\n    \"mutate_tree_max\" : 3,\n    \"parallel_eval\" : true\n  }\n}\n```\n\n# Sklearn interface\n\nThe `regression` task supports an additional [`sklearn`-like regressor interface](https:\u002F\u002Fscikit-learn.org\u002Fstable\u002Fmodules\u002Fgenerated\u002Fsklearn.base.RegressorMixin.html) to make it easy to try out deep symbolic regression on your own data:\n```\nfrom dso import DeepSymbolicRegressor\n\n# Generate some data\nnp.random.seed(0)\nX = np.random.random((10, 2))\ny = np.sin(X[:,0]) + X[:,1] ** 2\n\n# Create the model\nmodel = DeepSymbolicRegressor() # Alternatively, you can pass in your own config JSON path\n\n# Fit the model\nmodel.fit(X, y) # Should solve in ~10 seconds\n\n# View the best expression\nprint(model.program_.pretty())\n\n# Make predictions\nmodel.predict(2 * X)\n\n```\n\n# Analyzing results\n\nEach run of DSO saves a timestamped log directory in `config[\"training\"][\"logdir\"]`. Inside this directory is:\n* `dso_ExperimentName_0.csv`: This file contains batch-wise summary statistics for each epoch. The suffix `_0` means the random number seed was 0. (See \"Advanced usage\" for batch runs with multiple seeds.)\n* `dso_ExperimnetName_0_summary.csv`: This file contains summary statistics for the entire training run.\n* `dso_ExperimnetName_0_hof.csv`: This file contains statistics of the \"hall of fame\" (best sequences discovered during training). Edit `config[\"training\"][\"hof\"] to set the number of hall-of-famers to record.\n* `dso_ExperimnetName_0_pf.csv`: This file contains statistics of the Pareto front of sequences discovered during training. This is a reward-complexity front.\n* `config.json`: This is a \"dense\" version of the configuration used for your run. It explicitly includes all parameters.\n\n# Advanced usage\n\n## Batch runs\nDSO's command-line interface supports a `multiprocessing`-parallelized batch mode to run multiple tasks in parallel. This is recommended for large runs. Batch-mode DSO is launched with:\n\n```\npython -m dso.run path\u002Fto\u002Fconfig.json [--runs] [--n_cores_task] [--b] [--seed]\n```\n\nThe option `--runs` (default `1`) defines how many independent tasks (with different random number seeds) to perform. The `regression` task is computationally expedient enough to run multiple tasks in parallel. For the `control` task, we recommend running with the default `--runs=1`.\n\nThe option `--n_cores_task` (default `1`) defines how many parallel processes to use across the `--runs` tasks. Each task is assigned a single core, so `--n_cores_task` should be less than or equal to `--runs`. (To use multiple cores _within_ a single task, i.e., to parallelize reward computation, see the `n_cores_batch` configuration parameter.)\n\nThe option `--seed`, *if provided*, will override the parameter `\"seed\"` in your config.\n\nBy default, DSO will use the task specification found in the configuration JSON. The option `--b` (default `None`) is used to specify the named task(s) via command-line. For example, `--b=path\u002Fto\u002Fmydata.csv` runs DSO on the given dataset (`regression` task), and `--b=MountainCarContinuous-v0` runs the environment MountainCarContinuous-v0 (`control` task). This is useful for running benchmark problems.\n\nFor example, to train 100 independent runs on the Nguyen-1 benchmark using 12 cores, using seeds 500 through 599:\n```\npython -m dso.run --b=Nguyen-1 --runs=100 --n_cores_task=12 --seed=500\n```\n\n## Adding custom tasks and priors\n\nDSO supports adding custom tasks and priors from your own modules.\n\nTo add new tasks, the `task_type` keyword in the config file can be used in the following format: `\u003Cmodule>.\u003Csource>:\u003Cfunction>` specifying the source implementing a `make_task` function.\n\nFor example:\n```\n{\n  \"task\" : {\n    \"task_type\" : \"custom_mod.my_source:make_task\"\n  }\n}\n```\n\nSimilarly, new priors can be added by specifying the source where the `Prior` class can be found in the `prior` group of the config file.\n\nFor example:\n```\n \"prior\": {\n      \"uniform_arity\" : {\n         \"on\" : true\n      },\n      \"custom_mod.my_source:CustomPrior\" : {\n         \"loc\" : 10,\n         \"scale\" : 5,\n         \"on\" : true\n      }\n  }\n```\n\n# Policy optimizers\n\nDSO supports a variety of policy optimizers based the following objective structure:\n\n```math\nJ(\\theta) = \\sum_{i=1}^N J(\\tau; \\theta) \\text{ with } J(\\tau; \\theta) \\propto \\log(p(\\tau|\\theta)).\n```\n\nThe objective can be specified by overriding the ``_set_up`` method of ``PolicyOptimizer``.\nCurrent DSO supports the following policy optimizers:\n\n## Policy gradient optimizers\n\nGiven a batch $\\mathcal{T} = \\{\\tau^{(i)}\\}_{i=1}^N$ of designs such that $\\tau^{(i)} \\sim p( \\cdot | \\theta)\\ \\forall 1 \\leq i \\leq N$:\n\n```math\n\\nabla_\\theta J_\\textrm{pg}(\\theta; \\varepsilon) \\approx \\frac{1}{\\varepsilon N}\\sum_{i=1}^N \\left( R(\\tau^{(i)}) - b \\right) \\cdot \\mathbf{1}_{R(\\tau^{(i)}) \\geq \\tilde{R}_\\varepsilon(\\theta) } \n\\nabla_\\theta \\log p(\\tau^{(i)} | \\theta)\n```\nwhere \n```math\n\\tilde{R}_\\varepsilon(\\theta) = \\textrm{Q}_{1-\\varepsilon}(\\mathcal{T} ) \n```\n(the empirical quantile). \n\n### Vanilla policy gradient\n\nWe take:\n\n```math\nb = \\textrm{EWMA}_n \\text{ with } \\textrm{EWMA}(n) = \\alpha  \\bar{R} + (1 - \\alpha) \\textrm{EWMA}_{n-1} \\text{ and }\\bar{R}  = \\frac{1}{N} \\sum_{i=1}^N R(\\tau)\n```\n```math\n\\varepsilon = 1.0\n```\nConfiguration:\n```\n   training.epsilon: 1.0,\n   training.baseline : \"ewma_R\",\n   policy_optimizer.policy_optimizer_type : \"pg\"\n```\n\n### Risk-seeking policy gradient\n\n```math\nb = \\tilde{R}_\\varepsilon(\\theta)\n```\n```math\n\\varepsilon = 0.05\n```\nConfiguration:\n```\n   training.epsilon: 0.05,\n   training.baseline : \"R_e\",\n   policy_optimizer.policy_optimizer_type : \"pg\"\n```\n \n## Priority queue training\nGiven a maximum reward priority queue (MRPQ):\n```math\n\\nabla_\\theta J_\\textrm{MRPQ}(\\theta)= \\frac{1}{k}\\sum_{\\tau\\in\\textrm{MRPQ}}\\nabla_\\theta \\log p(\\tau|\\theta)\n```\n\n## Proximal policy optimization\nGiven a batch $\\mathcal{T} = \\{\\tau^{(i)}\\}_{i=1}^N$ of designs such that $\\tau^{(i)} \\sim p( \\cdot | \\theta) \\forall i$:\n\nFor $1=1,\\dots,K$ do: \n```math\n\\theta \\leftarrow \\theta + \\alpha \\nabla J_{\\text{PPO}}\n```\nwith\n```math\nJ_{\\text{PPO}} (\\theta) =\\mathbb{E}_{\\tau \\sim \\mathcal{T}} [ \\min (r(\\theta) (R(\\tau) - b), \\text{clip}(r(\\theta), 1-\\epsilon, 1 + \\epsilon) (R(\\tau ) - b) ]\n```\n\n# Code dependency map\n\n\u003Cdetails>\n\u003Csummary>The map of core dependencies is depicted here.\u003C\u002Fsummary>\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdso-org_deep-symbolic-optimization_readme_fe8e989ee520.png\" width=750\u002F>\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n\n# Citing this work\n\nTo cite this work, please cite the papers according to the most relevant tasks and\u002For methods.\n\nTo cite the `regression` task, please use:\n```\n@inproceedings{petersen2021deep,\n  title={Deep symbolic regression: Recovering mathematical expressions from data via risk-seeking policy gradients},\n  author={Petersen, Brenden K and Landajuela, Mikel and Mundhenk, T Nathan and Santiago, Claudio P and Kim, Soo K and Kim, Joanne T},\n  booktitle={Proc. of the International Conference on Learning Representations},\n  year={2021}\n}\n```\n\nTo cite the `control` task, please use:\n```\n@inproceedings{landajuela2021discovering,\n  title={Discovering symbolic policies with deep reinforcement learning},\n  author={Landajuela, Mikel and Petersen, Brenden K and Kim, Sookyung and Santiago, Claudio P and Glatt, Ruben and Mundhenk, Nathan and Pettit, Jacob F and Faissol, Daniel},\n  booktitle={International Conference on Machine Learning},\n  pages={5979--5989},\n  year={2021},\n  organization={PMLR}\n}\n```\n\nTo cite the neural-guided genetic programming population seeding method, please use:\n```\n@inproceedings{mundhenk2021seeding,\n  title={Symbolic Regression via Neural-Guided Genetic Programming Population Seeding},\n  author={T. Nathan Mundhenk and Mikel Landajuela and Ruben Glatt and Claudio P. Santiago and Daniel M. Faissol and Brenden K. Petersen},\n  booktitle={Advances in Neural Information Processing Systems},\n  year={2021}\n}\n```\n\nTo cite the unified deep symbolic regression (uDSR) method or the LINEAR\u002F`poly` token, please use:\n```\n@inproceedings{landajuela2022unified,\ntitle={A Unified Framework for Deep Symbolic Regression},\n  author={Mikel Landajuela and Chak Lee and Jiachen Yang and Ruben Glatt and Claudio P. Santiago and Ignacio Aravena and Terrell N. Mundhenk and Garrett Mulcahy and Brenden K. Petersen},\n  booktitle={Advances in Neural Information Processing Systems},\n  year={2022}\n}\n```\n\n# Release\n\nLLNL-CODE-647188\n","# 深度符号优化\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdso-org_deep-symbolic-optimization_readme_edbb8ae0b5fd.png\" width=750\u002F>\n\u003C\u002Fp>\n\n深度符号优化（DSO）是一个用于符号优化任务的深度学习框架。`dso` 包含核心的符号优化算法，并支持两种特定的符号优化任务：(1) _符号回归_（从输入数据集中恢复可处理的数学表达式）和 (2) 为强化学习环境发现 _符号策略_。在代码中，这些任务分别称为 `regression` 和 `control`。我们还提供了一个简单的接口来定义新的任务。\n\n> **注意**\n> 正在寻找基于 PyTorch 的现代代码库吗？请参阅 https:\u002F\u002Fgithub.com\u002Fdso-org\u002Fdeep-symbolic-optimization-pytorch — 这是 DSO 的重构版本，将所有神经网络组件中的 TensorFlow 替换为 PyTorch。\n\n在符号回归方面，DSO 已经在 SRBench 基准测试集上进行了基准测试，并在符号解率和准确解率方面均达到了最先进的水平：\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdso-org_deep-symbolic-optimization_readme_58ce8898af93.png\" width=300\u002F>\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdso-org_deep-symbolic-optimization_readme_6b78f53e115b.png\" width=300\u002F>\n\u003C\u002Fp>\n\nDSO 还在 GECCO 2022 大会上举行的 2022 年 SRBench 符号回归竞赛的真实世界赛道中获得了 [第一名](https:\u002F\u002Fcavalab.org\u002Fsrbench\u002Fcompetition-2022\u002F#real-world-track-rankings)。\n\n此仓库包含支持以下出版物的代码：\n1. Petersen 等人，2021 年 **深度符号回归：通过风险偏好型策略梯度从数据中恢复数学表达式。** *ICLR 2021。* [口头报告](https:\u002F\u002Ficlr.cc\u002Fvirtual\u002F2021\u002Fposter\u002F2578) [论文](https:\u002F\u002Fopenreview.net\u002Fforum?id=m5Qsh0kBQG)\n2. Landajuela 等人，2021 年 **使用深度强化学习发现符号策略。** *ICML 2021。* [论文](https:\u002F\u002Fproceedings.mlr.press\u002Fv139\u002Flandajuela21a.html)\n3. Mundhenk 等人，2021 年 **通过神经引导的遗传编程种群播种进行符号回归。** *NeurIPS 2021* [论文](https:\u002F\u002Fproceedings.neurips.cc\u002Fpaper\u002F2021\u002Fhash\u002Fd073bb8d0c47f317dd39de9c9f004e9d-Abstract.html)\n4. Landajuela 等人，2022 年 **深度符号回归的统一框架。** *NeurIPS 2022* [论文](https:\u002F\u002Fopenreview.net\u002Fforum?id=2FNnBhwJsHK)  \n5. Landajuela 等人，2021 年 **改进策略梯度搜索中的探索：应用于符号优化。** *Math-AI @ ICLR 2021。* [论文](https:\u002F\u002Fmathai-iclr.github.io\u002Fpapers\u002Fpapers\u002FMATHAI_16_paper.pdf)\n6. Kim 等人，2020 年 **用于深度符号回归的交互式可视化平台。** *IJCAI 2020。* [论文](https:\u002F\u002Fwww.ijcai.org\u002FProceedings\u002F2020\u002F0763.pdf)\n7. Petersen 等人，2021 年 **通过现场先验和约束将领域知识融入神经引导搜索** *AutoML @ ICML 2021。* [论文]()\n8. Kim 等人，2021 年 **将维基百科的数学知识提炼到神经网络模型中。** *Math-AI @ ICLR 2021。* [论文](https:\u002F\u002Fmathai-iclr.github.io\u002Fpapers\u002Fpapers\u002FMATHAI_15_paper.pdf)\n9. Silva 等人，2022 年 **利用语言模型高效学习符号优化解决方案** *ALA Workshop 2022。* [论文](https:\u002F\u002Fala2022.github.io\u002Fpapers\u002FALA2022_paper_24.pdf)\n10. Glatt 等人，2022 年 **用于固定拓扑功率转换器中电气元件尺寸确定的深度符号优化** *AI for Design and Manufacturing (ADAM) @ AAAI 2022。* [论文](https:\u002F\u002Fopenreview.net\u002Fforum?id=u_ghY9PnAyZ)\n11. Pettit 等人，2025 年 **DisCo-DSO：耦合离散与连续优化，以实现混合空间中的高效生成式设计。** *AAAI 2025* [论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2412.11051) [博客文章](https:\u002F\u002Flandajuela.github.io\u002Fdiscrete_continuous_autoregressive\u002F)\n\n# 安装\n\n### 安装 - 核心包\n\n核心包已在 Unix 和 OSX 上的 Python 3.6+ 环境中进行了测试。要安装核心包（以及默认的 `regression` 任务），我们强烈建议首先创建一个 Python 3 虚拟环境，例如：\n\n```\npython3 -m venv venv3 # 创建 Python 3 虚拟环境\nsource venv3\u002Fbin\u002Factivate # 激活虚拟环境\n```\n\n然后，在仓库根目录下执行：\n\n```\npip install --upgrade setuptools pip\nexport CFLAGS=\"-I $(python -c \"import numpy; print(numpy.get_include())\") $CFLAGS\" # 在 Mac 上需要防止致命错误：“numpy\u002Farrayobject.h”文件未找到\npip install -e .\u002Fdso # 安装 DSO 包及核心依赖项\n```\n\n默认情况下会安装 `regression` 任务。它不需要下面的任何安装选项。\n\n### 安装 - `control` 任务\n运行 `control` 任务需要一些额外的依赖项。可以使用以下命令安装：\n\n```\npip install -e .\u002Fdso[control]\n```\n\n### 安装 - 所有任务\n要安装所有任务的所有依赖项，请使用 `all` 选项：\n\n```\npip install -e .\u002Fdso[all]\n```\n\n# 开始使用\n\nDSO 依靠 JSON 文件来配置运行，然后通过简单的命令行或几行 Python 代码来启动它们。\n\n### 方法 1：通过命令行界面运行 DSO\n\n创建好配置文件后，只需运行：\n\n```\npython -m dso.run path\u002Fto\u002Fconfig.json\n```\n\n训练完成后，结果会保存到 `\"logdir\"` 参数指定路径下的带时间戳的目录中（默认为 `.\u002Flog`）。\n\n### 方法 2：通过 Python 接口运行 DSO\n\nPython 接口允许用户通过 Python 脚本、交互式 Python shell 或 iPython 笔记本实例化和自定义 DSO 模型。核心 DSO 模型是 `dso.core.DeepSymbolicOptimizer`。创建好配置文件后，可以使用：\n\n```\nfrom dso import DeepSymbolicOptimizer\n\n# 创建并训练模型\nmodel = DeepSymbolicOptimizer(\"path\u002Fto\u002Fconfig.json\")\nmodel.train()\n```\n\n训练完成后，结果会保存到 `config[\"training\"][\"logdir\"]` 中指定路径下的带时间戳的目录中（默认为 `.\u002Flog`）。\n\n### 配置运行\n\n每个运行都使用一个单独的 JSON 文件进行配置。该文件指定了符号优化任务和所有超参数。\n\n每个配置 JSON 文件都有多个顶级键，用于控制 DSO 框架的各个部分。重要的顶级键包括：\n* `\"experiment\"` 配置实验，即日志目录和随机数种子。\n* `\"task\"` 配置任务，例如符号回归的数据集，或 `control` 任务的 Gym 环境。有关任务特定配置，请参见下文。\n* `\"logging\"` 配置算法执行的输出文件，例如 `\"save_all_iterations\"` 用于保存每次迭代的详细统计信息。\n* `\"training\"` 配置训练超参数，如 `\"n_samples\"`（要生成的样本总数）和 `\"epsilon\"`（风险偏好型策略梯度使用的风险因子）。\n* `\"policy\"` 配置策略超参数，如 `\"max_length\"` 和 `\"num_layers\"`。\n* `\"policy_optimizer\"` 配置策略优化超参数，如 `\"learning_rate\"` 和 `\"optimizer\"`。\n* `\"gp_meld\"` 配置遗传编程超参数。\n* `\"prior\"` 配置搜索空间上的先验和约束。\n\n配置文件中未包含的任何参数都将采用默认值，这些默认值位于 `config\u002Fconfig_common.json`、`config\u002Fconfig_regression.json`（用于 `regression` 任务）和 `config\u002Fconfig_control.json`（用于 `control` 任务）中。\n\n##### 配置符号回归任务\n\n以下是 `regression` 任务的 JSON 配置文件示例：\n\n```\n{\n  \"task\" : {\n    \"task_type\" : \"regression\",\n    \"dataset\" : \"path\u002Fto\u002Fmy_dataset.csv\",\n    \"function_set\" : [\"add\", \"sub\", \"mul\", \"div\", \"sin\", \"cos\", \"exp\", \"log\", \"poly\"]\n  }\n}\n```\n\n此配置将使 DSO 学习符号表达式以拟合您的自定义数据集，并使用 `function_set` 中指定的函数符号（有关支持的符号列表，请参阅 `dso\u002Ffunctions.py`）。\n\n在完成设置后，您可以使用默认配置直接运行符号回归任务，例如：\n\n```\npython -m dso.run dso\u002Fconfig\u002Fconfig_regression.json --b Nguyen-7\n```\n\n这将使用基准测试 Nguyen-7 运行 DSO 的回归任务。\n\n如果您希望在搜索空间中包含优化后的浮点常数，只需在 `function_set` 列表中添加 `\"const\"` 即可。请注意，常数优化会引入一个内部优化循环，从而显著增加运行时间（从几分钟延长至数小时）。\n\n若要将强大的 LINEAR 符号（代码中称为 `poly`）——该符号是在 NeurIPS 2022 统一深度符号回归 (uDSR) 论文中提出的——纳入搜索空间，只需在 `function_set` 列表中添加 `\"poly\"` 即可。多项式优化会带来一定的额外开销，但远小于 `const` 符号；因此，我们强烈建议在大多数应用中使用此符号。\n\n您还可以通过调整配置中的 `poly_optimizer_params` 参数进一步配置 LINEAR\u002F`poly` 符号，例如：\n```\n{\n  \"task\" : {\n    \"task_type\" : \"regression\",\n    \"dataset\" : \"path\u002Fto\u002Fmy_dataset.csv\",\n    \"function_set\" : [\"add\", \"sub\", \"mul\", \"div\", \"sin\", \"cos\", \"exp\", \"log\", \"poly\"],\n    \"poly_optimizer_params\" : {\n      \"degree\": 3,\n      \"coef_tol\": 1e-6,\n      \"regressor\": \"dso_least_squares\",\n      \"regressor_params\": {}\n    }\n  }\n}\n```\n\n在 `poly_optimizer_params` 中，`degree` 指定要拟合的多项式的次数，`coef_tol` 是用于移除系数足够小的项的阈值，而 `regressor` 是用于学习多项式系数的底层回归器。默认的 `regressor` 是我们自主研发的最小二乘法实现 `dso_least_squares`，它会在表达式学习过程中优化拟合过程。除了 `dso_least_squares` 外，我们还支持 `sklearn` 提供的线性回归、Lasso 和 Ridge 回归器。根据所选的 `regressor`，可以通过 `regressor_params` 配置相关参数。\n\n##### 配置符号控制策略学习任务\n\n以下是 `control` 任务的简单示例：\n\n```\n{\n  \"task\" : {\n    \"task_type\" : \"control\",\n    \"env\" : \"MountainCarContinuous-v0\",\n    \"function_set\" : [\"add\", \"sub\", \"mul\", \"div\", \"sin\", \"cos\", \"exp\", \"log\", 1.0, 5.0, 10.0]\n  }\n}\n```\n\n此配置将使 DSO 学习适用于 MountainCarContinuous-v0 的符号策略，并使用 `function_set` 中指定的函数符号（有关支持的符号列表，请参阅 `dso\u002Ffunctions.py`）。\n\n对于具有多维动作空间的环境，DSO 需要一个预先训练好的“锚点”策略。DSO 会针对每个动作维度分别运行一次，并且每次运行时都会更新 `\"action_spec\"` 参数。对于具有 `N` 个动作维度的环境，`\"action_spec\"` 是一个长度为 `N` 的列表。其中一个元素应为 `null`，表示该位置是要学习的符号动作；任意数量的元素可以设置为 `\"anchor\"`，表示由锚点策略决定这些动作；也可以有任意数量的元素是表达式遍历形式（如 `[\"add\", \"x1\", \"x2\"]`），表示由固定的符号策略决定这些动作。\n\n以下是以 HopperBulletEnv-v0 为例的工作流程，该环境有三个动作维度。首先，通过运行如下配置来学习第一个动作的符号策略：\n```\n{\n  \"task\" : {\n    \"task_type\" : \"control\",\n    \"name\" : \"HopperBulletEnv-v0\",\n    \"function_set\" : [\"add\", \"sub\", \"mul\", \"div\", \"sin\", \"cos\", \"exp\", \"log\", 1.0, 5.0, 10.0],\n    \"action_spec\" : [null, \"anchor\", \"anchor\"],\n    \"anchor\" : \"path\u002Fto\u002Fanchor.pkl\"\n  }\n}\n```\n\n其中 `\"path\u002Fto\u002Fanchor.pkl\"` 是一个 `stable_baselines` 模型的路径。（ICML 论文中使用的环境已经设置了默认的 `anchor` 值，因此无需另行指定。）运行完成后，假设最佳表达式为 `[\"add\", \"x1\", \"x2\"]`。为了启动第二轮 DSO，需更新配置中的 `action_spec`，将第一个动作固定为符号策略，学习第二个动作的符号策略，并继续使用锚点策略来确定第三个动作：\n```\n\"action_spec\" : [[\"add\", \"x1\", \"x2\"], null, \"anchor\"]\n```\n\n再次运行 DSO 后，假设第二个动作的表达式为 `[\"div\", \"x3\", \"x4\"]`。最后，更新 `action_spec` 为：\n```\n\"action_spec\" : [[\"add\", \"x1\", \"x2\"], [\"div\", \"x3\", \"x4\"], null]\n```\n\n然后重新运行 DSO。最终结果将是一个完全符号化的策略。\n\n##### 配置决策树策略学习任务\n\nDSO 也可以配置为学习决策树策略。\n\n这需要在 `\"task\"` 中指定 `decision_tree_threshold_set`，即在做出决策时对状态变量取值设定的一组阈值。\n\n具体而言，对于 `decision_tree_threshold_set` 中的每个阈值 `tj`，所有状态变量 `xi` 的 `StateChecker` 符号 `xi \u003C tj` 都会被添加到库中。\n\n例如，对于 `MountainCarContinuous-v0`，配置示例如下：\n```\n{\n  \"task\" : {\n    \"task_type\" : \"control\",\n    \"env\" : \"MountainCarContinuous-v0\",\n    \"function_set\" : [\"add\", \"sub\", \"mul\", \"div\", \"sin\", \"cos\", \"exp\", \"log\", 1.0, 5.0, 10.0],\n    \"decision_tree_threshold_set\" : [-0.05, 0.0, 0.01]\n  }\n}\n```\n\n除了 `function_set` 中指定的函数外，由于 `MountainCarContinuous-v0` 有两个状态变量，此配置还会将 `x1 \u003C -0.05`、`x1 \u003C 0.0`、`x1 \u003C 0.01`、`x2 \u003C -0.05`、`x2 \u003C 0.0` 和 `x2 \u003C 0.01` 添加到库中。\n\n借助这些 `StateChecker` 符号，可以生成类似“如果 `x1 \u003C -0.05` 且 `x2 \u003C 0.0`，则动作为 `exp(x1) + 1.0`；否则，动作为 `sin(10 * x2)`”这样的决策树策略。\n\n\n\n### 使用神经引导的遗传编程种群播种控制器\n\n要启用 NeurIPS 2021 中提出的遗传编程内层优化器，您需要在配置中添加 `\"gp_meld\"` 字段。您可以尝试不同的参数设置，但最重要的是将 `\"run_gp_meld\"` 设置为 `true`。\n```\n{\n  \"gp_meld\" : {\n    \"run_gp_meld\" : true,\n    \"verbose\" : false,\n    \"generations\" : 20,\n    \"p_crossover\" : 0.5,\n    \"p_mutate\" : 0.5,\n    \"tournament_size\" : 5,\n    \"train_n\" : 50,\n    \"mutate_tree_max\" : 3,\n    \"parallel_eval\" : true\n  }\n}\n```\n\n# Sklearn 接口\n\n`regression` 任务 支持一个额外的 [`sklearn`-like 回归器接口](https:\u002F\u002Fscikit-learn.org\u002Fstable\u002Fmodules\u002Fgenerated\u002Fsklearn.base.RegressorMixin.html)，以便您可以轻松地在自己的数据上尝试深度符号回归：\n```\nfrom dso import DeepSymbolicRegressor\n\n# 生成一些数据\nnp.random.seed(0)\nX = np.random.random((10, 2))\ny = np.sin(X[:,0]) + X[:,1] ** 2\n\n# 创建模型\nmodel = DeepSymbolicRegressor() # 或者，您也可以传入自己的配置 JSON 路径\n\n# 拟合模型\nmodel.fit(X, y) # 应该在 ~10 秒内求解\n\n# 查看最佳表达式\nprint(model.program_.pretty())\n\n# 进行预测\nmodel.predict(2 * X)\n\n```\n\n# 分析结果\n\nDSO 的每次运行都会在 `config[\"training\"][\"logdir\"]` 中保存一个带时间戳的日志目录。该目录内包含：\n* `dso_ExperimentName_0.csv`: 此文件包含每个 epoch 的批次级汇总统计信息。后缀 `_0` 表示随机数种子为 0。（有关使用多个种子进行批量运行，请参阅“高级用法”。）\n* `dso_ExperimnetName_0_summary.csv`: 此文件包含整个训练过程的汇总统计信息。\n* `dso_ExperimnetName_0_hof.csv`: 此文件包含“名人堂”（训练期间发现的最佳序列）的统计信息。可通过编辑 `config[\"training\"][\"hof\"]` 来设置要记录的名人堂成员数量。\n* `dso_ExperimnetName_0_pf.csv`: 此文件包含训练期间发现的序列的帕累托前沿统计信息。这是一个奖励-复杂度前沿。\n* `config.json`: 这是用于您运行的配置的“密集”版本，明确包含了所有参数。\n\n# 高级用法\n\n## 批量运行\nDSO 的命令行界面支持 `multiprocessing` 并行化的批量模式，以并行运行多个任务。这对于大型运行非常推荐。批量模式的 DSO 可通过以下命令启动：\n\n```\npython -m dso.run path\u002Fto\u002Fconfig.json [--runs] [--n_cores_task] [--b] [--seed]\n```\n\n选项 `--runs`（默认值为 `1`）定义要执行的独立任务数量（使用不同的随机数种子）。`regression` 任务的计算效率足够高，可以并行运行多个任务。而对于 `control` 任务，我们建议使用默认的 `--runs=1`。\n\n选项 `--n_cores_task`（默认值为 `1`）定义在 `--runs` 个任务中使用的并行进程数量。每个任务分配一个核心，因此 `--n_cores_task` 应小于或等于 `--runs`。（若要在单个任务内使用多个核心，即并行化奖励计算，请参阅 `n_cores_batch` 配置参数。）\n\n如果提供了 `--seed` 选项，则会覆盖您配置中的 `\"seed\"` 参数。\n\n默认情况下，DSO 将使用配置 JSON 中找到的任务规范。选项 `--b`（默认值为 `None`）用于通过命令行指定命名任务。例如，`--b=path\u002Fto\u002Fmydata.csv` 会在给定数据集上运行 DSO（`regression` 任务），而 `--b=MountainCarContinuous-v0` 会运行 MountainCarContinuous-v0 环境（`control` 任务）。这对于运行基准问题非常有用。\n\n例如，要在 Nguyen-1 基准测试上使用 12 个核心训练 100 个独立运行，并使用种子 500 到 599：\n```\npython -m dso.run --b=Nguyen-1 --runs=100 --n_cores_task=12 --seed=500\n```\n\n## 添加自定义任务和先验\nDSO 支持从您自己的模块添加自定义任务和先验。\n\n要添加新任务，可以在配置文件中使用 `task_type` 关键字，格式如下：\u003Cmodule>.\u003Csource>:\u003Cfunction>，指定实现 `make_task` 函数的源代码。\n\n例如：\n```\n{\n  \"task\" : {\n    \"task_type\" : \"custom_mod.my_source:make_task\"\n  }\n}\n```\n\n同样，可以通过在配置文件的 `prior` 组中指定可找到 `Prior` 类的源代码来添加新的先验。\n\n例如：\n```\n \"prior\": {\n      \"uniform_arity\" : {\n         \"on\" : true\n      },\n      \"custom_mod.my_source:CustomPrior\" : {\n         \"loc\" : 10,\n         \"scale\" : 5,\n         \"on\" : true\n      }\n  }\n```\n\n# 策略优化器\nDSO 支持多种基于以下目标结构的策略优化器：\n\n```math\nJ(\\theta) = \\sum_{i=1}^N J(\\tau; \\theta) \\text{ 其中 } J(\\tau; \\theta) \\propto \\log(p(\\tau|\\theta)).\n```\n\n可以通过重写 `PolicyOptimizer` 的 ``_set_up`` 方法来指定目标函数。\n当前 DSO 支持以下策略优化器：\n\n## 策略梯度优化器\n给定一批设计 $\\mathcal{T} = \\{\\tau^{(i)}\\}_{i=1}^N$，其中 $\\tau^{(i)} \\sim p( \\cdot | \\theta)\\ \\forall 1 \\leq i \\leq N$：\n\n```math\n\\nabla_\\theta J_\\textrm{pg}(\\theta; \\varepsilon) \\approx \\frac{1}{\\varepsilon N}\\sum_{i=1}^N \\left( R(\\tau^{(i)}) - b \\right) \\cdot \\mathbf{1}_{R(\\tau^{(i)}) \\geq \\tilde{R}_\\varepsilon(\\theta) } \n\\nabla_\\theta \\log p(\\tau^{(i)} | \\theta)\n```\n其中 \n```math\n\\tilde{R}_\\varepsilon(\\theta) = \\textrm{Q}_{1-\\varepsilon}(\\mathcal{T} ) \n```\n（经验分位数）。\n\n### 经典策略梯度\n我们取：\n\n```math\nb = \\textrm{EWMA}_n \\text{ 其中 } \\textrm{EWMA}(n) = \\alpha  \\bar{R} + (1 - \\alpha) \\textrm{EWMA}_{n-1} \\text{ 且 }\\bar{R}  = \\frac{1}{N} \\sum_{i=1}^N R(\\tau)\n```\n```math\n\\varepsilon = 1.0\n```\n配置：\n```\n   training.epsilon: 1.0,\n   training.baseline : \"ewma_R\",\n   policy_optimizer.policy_optimizer_type : \"pg\"\n```\n\n### 风险偏好型策略梯度\n```math\nb = \\tilde{R}_\\varepsilon(\\theta)\n```\n```math\n\\varepsilon = 0.05\n```\n配置：\n```\n   training.epsilon: 0.05,\n   training.baseline : \"R_e\",\n   policy_optimizer.policy_optimizer_type : \"pg\"\n```\n \n## 优先队列训练\n给定一个最大奖励优先队列（MRPQ）：\n```math\n\\nabla_\\theta J_\\textrm{MRPQ}(\\theta)= \\frac{1}{k}\\sum_{\\tau\\in\\textrm{MRPQ}}\\nabla_\\theta \\log p(\\tau|\\theta)\n```\n\n## 近端策略优化\n给定一批设计 $\\mathcal{T} = \\{\\tau^{(i)}\\}_{i=1}^N$，其中 $\\tau^{(i)} \\sim p( \\cdot | \\theta) \\forall i$：\n\n对于 $1=1,\\dots,K$，执行以下操作：\n```math\n\\theta \\leftarrow \\theta + \\alpha \\nabla J_{\\text{PPO}}\n```\n其中\n```math\nJ_{\\text{PPO}} (\\theta) =\\mathbb{E}_{\\tau \\sim \\mathcal{T}} [ \\min (r(\\theta) (R(\\tau) - b), \\text{clip}(r(\\theta), 1-\\epsilon, 1 + \\epsilon) (R(\\tau ) - b) ]\n```\n\n# 代码依赖关系图\n\n\u003Cdetails>\n\u003Csummary>此处展示了核心依赖关系图。\u003C\u002Fsummary>\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdso-org_deep-symbolic-optimization_readme_fe8e989ee520.png\" width=750\u002F>\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n# 引用本工作\n\n要引用本工作，请根据最相关的任务和\u002F或方法引用相应的论文。\n\n要引用 `regression` 任务，请使用：\n```\n@inproceedings{petersen2021deep,\n  title={深度符号回归：通过风险偏好型策略梯度从数据中恢复数学表达式},\n  author={Petersen, Brenden K 和 Landajuela, Mikel 和 Mundhenk, T Nathan 和 Santiago, Claudio P 和 Kim, Soo K 和 Kim, Joanne T},\n  booktitle={国际学习表示会议论文集},\n  year={2021}\n}\n```\n\n要引用 `control` 任务，请使用：\n```\n@inproceedings{landajuela2021discovering,\n  title={利用深度强化学习发现符号策略},\n  author={Landajuela, Mikel 和 Petersen, Brenden K 和 Kim, Sookyung 和 Santiago, Claudio P 和 Glatt, Ruben 和 Mundhenk, Nathan 和 Pettit, Jacob F 和 Faissol, Daniel},\n  booktitle={国际机器学习会议},\n  pages={5979--5989},\n  year={2021},\n  organization={PMLR}\n}\n```\n\n要引用神经引导的遗传编程种群初始化方法，请使用：\n```\n@inproceedings{mundhenk2021seeding,\n  title={基于神经引导的遗传编程种群初始化的符号回归},\n  author={T. Nathan Mundhenk 和 Mikel Landajuela 和 Ruben Glatt 和 Claudio P. Santiago 和 Daniel M. Faissol 和 Brenden K. Petersen},\n  booktitle={神经信息处理系统进展},\n  year={2021}\n}\n```\n\n要引用统一的深度符号回归（uDSR）方法或 LINEAR\u002F`poly` 记号，请使用：\n```\n@inproceedings{landajuela2022unified,\ntitle={深度符号回归的统一框架},\n  author={Mikel Landajuela 和 Chak Lee 和 Jiachen Yang 和 Ruben Glatt 和 Claudio P. Santiago 和 Ignacio Aravena 和 Terrell N. Mundhenk 和 Garrett Mulcahy 和 Brenden K. Petersen},\n  booktitle={神经信息处理系统进展},\n  year={2022}\n}\n```\n\n# 发布\n\nLLNL-CODE-647188","# Deep Symbolic Optimization (DSO) 快速上手指南\n\nDeep Symbolic Optimization (DSO) 是一个用于符号优化任务的深度学习框架，主要支持**符号回归**（从数据中恢复数学表达式）和**符号策略发现**（强化学习环境中的控制策略）。\n\n## 环境准备\n\n*   **操作系统**: Linux (Unix) 或 macOS (OSX)。\n*   **Python 版本**: Python 3.6 及以上。\n*   **前置依赖**: 建议先创建独立的虚拟环境以避免依赖冲突。\n    *   *注：国内用户可使用清华源或阿里源加速 pip 安装。*\n\n## 安装步骤\n\n### 1. 创建并激活虚拟环境\n```bash\npython3 -m venv venv3\nsource venv3\u002Fbin\u002Factivate\n```\n\n### 2. 升级基础工具并设置环境变量\n在 macOS 上需要设置 `CFLAGS` 以防止 numpy 头文件缺失错误，Linux 通常也可兼容此设置。\n```bash\npip install --upgrade setuptools pip\nexport CFLAGS=\"-I $(python -c \"import numpy; print(numpy.get_include())\") $CFLAGS\"\n```\n\n### 3. 安装 DSO 核心包\n默认安装包含符号回归 (`regression`) 任务所需的所有依赖。\n```bash\n# 推荐使用国内镜像源加速安装\npip install -e .\u002Fdso -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n> **可选任务安装**：\n> *   若需运行强化学习控制任务 (`control`)：`pip install -e .\u002Fdso[control]`\n> *   若需安装所有任务依赖：`pip install -e .\u002Fdso[all]`\n\n## 基本使用\n\nDSO 通过 JSON 配置文件定义任务和超参数，支持命令行和 Python 接口两种运行方式。\n\n### 方法一：命令行运行（推荐）\n\n直接使用内置配置运行基准测试（例如符号回归基准数据集 `Nguyen-7`）：\n```bash\npython -m dso.run dso\u002Fconfig\u002Fconfig_regression.json --b Nguyen-7\n```\n\n运行结束后，结果将保存在 `log` 目录下以时间戳命名的文件夹中。\n\n### 方法二：Python 接口运行\n\n适用于需要在脚本或 Notebook 中自定义流程的场景。\n\n1.  **准备配置文件**：创建一个名为 `config.json` 的文件，内容如下（以自定义数据集的符号回归为例）：\n    ```json\n    {\n      \"task\" : {\n        \"task_type\" : \"regression\",\n        \"dataset\" : \"path\u002Fto\u002Fmy_dataset.csv\",\n        \"function_set\" : [\"add\", \"sub\", \"mul\", \"div\", \"sin\", \"cos\", \"exp\", \"log\", \"poly\"]\n      }\n    }\n    ```\n    *提示：加入 `\"poly\"` 可启用线性\u002F多项式优化令牌，显著提升大多数应用的效果；加入 `\"const\"` 可优化浮点常数，但会大幅增加运行时间。*\n\n2.  **执行训练**：\n    ```python\n    from dso import DeepSymbolicOptimizer\n\n    # 加载配置并初始化模型\n    model = DeepSymbolicOptimizer(\"path\u002Fto\u002Fconfig.json\")\n\n    # 开始训练\n    model.train()\n    ```\n\n训练完成后，日志和结果同样保存至配置中指定的 `logdir`（默认为 `.\u002Flog`）。","某新能源电池研发团队的算法工程师正试图从海量的充放电实验数据中，挖掘出描述电池老化速率的精确数学公式，以优化电池管理系统。\n\n### 没有 deep-symbolic-optimization 时\n- 依赖传统遗传编程或人工试错，面对高维噪声数据时极易陷入局部最优，难以收敛到全局最优解。\n- 生成的模型往往是缺乏物理意义的“黑盒”神经网络，工程师无法理解变量间的因果逻辑，难以通过行业评审。\n- 为了平衡拟合精度与公式简洁度，需要反复手动调整正则化参数，耗时数周仍无法获得可解释的解析表达式。\n- 在 2022 年 SRBench 真实世界赛道这类高难度基准测试中，现有方案的符号解发现率和准确率均落后于前沿水平。\n\n### 使用 deep-symbolic-optimization 后\n- 利用基于风险寻求策略梯度的深度学习框架，显著提升了在复杂搜索空间中的探索能力，快速锁定全局最优数学结构。\n- 直接输出形如 $f(x) = a \\cdot e^{-bx} + c$ 的简洁符号表达式，完美复现物理规律，让领域专家能直观验证公式合理性。\n- 内置的神经引导种群初始化机制自动平衡了拟合误差与公式复杂度，无需人工干预即可在数小时内得到高精度解析解。\n- 凭借在 SRBench 基准测试中斩获第一的实力，成功在真实电池老化数据上实现了业界领先的符号回归精度，加速了新品研发周期。\n\ndeep-symbolic-optimization 将原本不可解释的数据拟合过程转化为可信赖的数学发现引擎，让 AI 真正成为了科学家的“公式推导助手”。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fdso-org_deep-symbolic-optimization_edbb8ae0.png","dso-org","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fdso-org_07038938.png",null,"https:\u002F\u002Fgithub.com\u002Fdso-org",[78,82],{"name":79,"color":80,"percentage":81},"Python","#3572A5",99.2,{"name":83,"color":84,"percentage":85},"Cython","#fedf5b",0.8,719,154,"2026-04-05T06:41:49","BSD-3-Clause","Linux, macOS","未说明",{"notes":93,"python":94,"dependencies":95},"核心包已在 Unix 和 macOS 上测试通过。Windows 未明确提及支持。安装时需在 Mac 上设置 CFLAGS 环境变量以防止 numpy 头文件缺失错误。'control' 任务需要额外依赖（如 Gym 环境），可通过 pip install -e .\u002Fdso[control] 安装。该工具主要基于 TensorFlow（README 提到有独立的 PyTorch 重构版本）。若使用常数优化（const）或多项式优化（poly），运行时间会显著增加。","3.6+",[96,97,98,99,100,101],"numpy","setuptools","pip","stable_baselines (control 任务可选)","gym (control 任务可选)","scikit-learn (可选，用于 poly 回归器)",[14,103],"其他","2026-03-27T02:49:30.150509","2026-04-06T17:24:42.816394",[107,112,117,121,126,131],{"id":108,"question_zh":109,"answer_zh":110,"source_url":111},19559,"如何避免深度符号优化（DSO）模型出现过拟合（overtraining）？","可以尝试以下几种方法来减少过拟合：\n1. 使输入数据点（X 轴）不均匀分布。\n2. 使用训练集 - 验证集拆分（Train-Validation Split），即在部分数据上训练，在保留的验证集上评估。\n3. 从函数集中移除 'const'（常数）令牌，因为它容易导致过拟合。\n4. 如果已知目标函数是单调的，可以移除三角函数令牌（如 sin, cos）。\n注意：目前无法直接强制约束函数的凹凸性或单调性，因为这类基于语义的约束通常难以实现，而基于语法的约束才是可行的。","https:\u002F\u002Fgithub.com\u002Fdso-org\u002Fdeep-symbolic-optimization\u002Fissues\u002F34",{"id":113,"question_zh":114,"answer_zh":115,"source_url":116},19560,"运行 dso.run 后生成的 log 文件夹为空，且没有保存结果 CSV 文件，如何解决？","这通常是因为配置文件中禁用了先验（Prior disabled）或使用了不在库中的令牌，导致警告被跳过。请检查配置文件（如 config_common.json 或 config_regression.json）中的参数设置。\n特别注意以下警告信息：\n- 'Skipping invalid ... Reason: Prior disabled'：表示相关先验被禁用，需检查配置中是否错误地关闭了必要的先验。\n- 'Skipping invalid ... Reason: Uses Tokens not in the Library'：表示配置中引用的令牌（如 'const' 或特定约束）未在当前函数集（function_set）中定义。\n确保配置文件中的 'function_set' 包含所有使用的操作符，并正确启用所需的先验约束。","https:\u002F\u002Fgithub.com\u002Fdso-org\u002Fdeep-symbolic-optimization\u002Fissues\u002F72",{"id":118,"question_zh":119,"answer_zh":120,"source_url":116},19561,"DSO 运行时太长，如何调整参数以缩短运行时间（例如从 30 分钟减至 5-10 分钟）？","DSO 的运行时间大致与 'n_samples'（生成的样本总数）成线性关系。要减少运行时间，最直接的方法是降低 'n_samples' 的值。\n例如，可以将配置中的 \"n_samples\" 从 2000000 减少到 2000 或其他较小的数值。\n不建议主要通过调整 'threshold' 来优化时间，调整 'n_samples' 更为有效。详细的参数说明可参考示例配置文件（如 config_common.json）。",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},19562,"为什么 DSO 运行时 CPU 负载很低（不到 6%），即使使用了所有核心？使用 GPU 能加速吗？","CPU 负载低且 GPU 无法显著加速是正常现象，原因如下：\n1. GPU 仅用于神经网络（TensorFlow 计算图部分），但 DSO 使用的 LSTM 网络非常小，GPU 加速效果不明显。\n2. 主要的计算瓶颈在于离图计算（off the compute graph），例如在回归任务中为每个样本计算均方误差（MSE），这部分是在 CPU 上进行的。\n因此，即使安装了 CUDA 并使用 GPU，整体性能提升也有限，CPU 仍然是主要瓶颈。","https:\u002F\u002Fgithub.com\u002Fdso-org\u002Fdeep-symbolic-optimization\u002Fissues\u002F55",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},19563,"导入 TensorFlow 1.14 时内核崩溃或报错 'set_random_seed' 方法不存在，该如何解决？","deep-symbolic-optimization 依赖 TensorFlow 1.14 版本，不兼容 TensorFlow 2.x。\n1. 错误原因：TensorFlow 2.x 移除了 'set_random_seed' 方法，而 DSO 代码中调用了该方法，导致报错或内核崩溃。\n2. 解决方案：必须创建独立的虚拟环境（如使用 Anaconda），并在其中严格安装 tensorflow==1.14。\n3. 安装路径：应在最外层的 'deep-symbolic-optimization' 目录下执行 'pip install -e .\u002Fdso'，而不是在内部的 'dso' 文件夹中。\n4. 环境建议：避免在默认支持 TF 2.x 的平台（如新版 Google Colab）直接运行，需在本地或自定义环境中配置 TF 1.14 + 对应的 CUDA\u002FcuDNN 版本。","https:\u002F\u002Fgithub.com\u002Fdso-org\u002Fdeep-symbolic-optimization\u002Fissues\u002F70",{"id":132,"question_zh":133,"answer_zh":134,"source_url":111},19564,"如何在函数集中添加幂运算（pow）功能？","可以通过修改源代码轻松添加 'pow' 令牌。维护者指出，大约只需要增加 1 行代码即可将 'pow' 添加到函数库中。具体实现需参考 DSO 的库定义文件（library.py 或类似文件），在其中注册新的二元操作符。",[136,141,146,150],{"id":137,"version":138,"summary_zh":139,"released_at":140},117639,"v3.0.0","包含我们2022年NeurIPS论文中的LINEAR\u002F`poly`令牌以及uDSR算法。","2023-03-11T00:24:43",{"id":142,"version":143,"summary_zh":144,"released_at":145},117640,"v2.1.0","最新更新，包含复现我们2021年NeurIPS论文结果的代码。","2021-12-06T15:05:26",{"id":147,"version":148,"summary_zh":75,"released_at":149},117641,"v2.0.1","2021-07-13T04:09:53",{"id":151,"version":152,"summary_zh":153,"released_at":154},117642,"v1.0.0","这是ICLR 2021论文《深度符号回归：通过风险偏好型策略梯度从数据中恢复数学表达式》的发布版本。","2021-07-12T23:03:43"]