[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-Ceruleanacg--Personae":3,"tool-Ceruleanacg--Personae":64},[4,23,32,40,48,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":22},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,2,"2026-04-05T10:45:23",[13,14,15,16,17,18,19,20,21],"图像","数据工具","视频","插件","Agent","其他","语言模型","开发框架","音频","ready",{"id":24,"name":25,"github_repo":26,"description_zh":27,"stars":28,"difficulty_score":29,"last_commit_at":30,"category_tags":31,"status":22},2234,"scikit-learn","scikit-learn\u002Fscikit-learn","scikit-learn 是一个基于 Python 构建的开源机器学习库，依托于 SciPy、NumPy 等科学计算生态，旨在让机器学习变得简单高效。它提供了一套统一且简洁的接口，涵盖了从数据预处理、特征工程到模型训练、评估及选择的全流程工具，内置了包括线性回归、支持向量机、随机森林、聚类等在内的丰富经典算法。\n\n对于希望快速验证想法或构建原型的数据科学家、研究人员以及 Python 开发者而言，scikit-learn 是不可或缺的基础设施。它有效解决了机器学习入门门槛高、算法实现复杂以及不同模型间调用方式不统一的痛点，让用户无需重复造轮子，只需几行代码即可调用成熟的算法解决分类、回归、聚类等实际问题。\n\n其核心技术亮点在于高度一致的 API 设计风格，所有估算器（Estimator）均遵循相同的调用逻辑，极大地降低了学习成本并提升了代码的可读性与可维护性。此外，它还提供了强大的模型选择与评估工具，如交叉验证和网格搜索，帮助用户系统地优化模型性能。作为一个由全球志愿者共同维护的成熟项目，scikit-learn 以其稳定性、详尽的文档和活跃的社区支持，成为连接理论学习与工业级应用的最",65628,1,"2026-04-05T10:10:46",[20,18,14],{"id":33,"name":34,"github_repo":35,"description_zh":36,"stars":37,"difficulty_score":10,"last_commit_at":38,"category_tags":39,"status":22},3364,"keras","keras-team\u002Fkeras","Keras 是一个专为人类设计的深度学习框架，旨在让构建和训练神经网络变得简单直观。它解决了开发者在不同深度学习后端之间切换困难、模型开发效率低以及难以兼顾调试便捷性与运行性能的痛点。\n\n无论是刚入门的学生、专注算法的研究人员，还是需要快速落地产品的工程师，都能通过 Keras 轻松上手。它支持计算机视觉、自然语言处理、音频分析及时间序列预测等多种任务。\n\nKeras 3 的核心亮点在于其独特的“多后端”架构。用户只需编写一套代码，即可灵活选择 TensorFlow、JAX、PyTorch 或 OpenVINO 作为底层运行引擎。这一特性不仅保留了 Keras 一贯的高层易用性，还允许开发者根据需求自由选择：利用 JAX 或 PyTorch 的即时执行模式进行高效调试，或切换至速度最快的后端以获得最高 350% 的性能提升。此外，Keras 具备强大的扩展能力，能无缝从本地笔记本电脑扩展至大规模 GPU 或 TPU 集群，是连接原型开发与生产部署的理想桥梁。",63927,"2026-04-04T15:24:37",[20,14,18],{"id":41,"name":42,"github_repo":43,"description_zh":44,"stars":45,"difficulty_score":10,"last_commit_at":46,"category_tags":47,"status":22},2403,"crawl4ai","unclecode\u002Fcrawl4ai","Crawl4AI 是一款专为大语言模型（LLM）设计的开源网络爬虫与数据提取工具。它的核心使命是将纷繁复杂的网页内容转化为干净、结构化的 Markdown 格式，直接服务于检索增强生成（RAG）、智能体构建及各类数据管道，让 AI 能更轻松地“读懂”互联网。\n\n传统爬虫往往面临反爬机制拦截、动态内容加载困难以及输出格式杂乱等痛点，导致后续数据处理成本高昂。Crawl4AI 通过内置自动化的三级反机器人检测、代理升级策略以及对 Shadow DOM 的深度支持，有效突破了这些障碍。它能智能移除同意弹窗，处理深层链接，并具备长任务崩溃恢复能力，确保数据采集的稳定与高效。\n\n这款工具特别适合开发者、AI 研究人员及数据工程师使用。无论是需要为本地模型构建知识库，还是搭建大规模自动化信息采集流程，Crawl4AI 都提供了极高的可控性与灵活性。作为 GitHub 上备受瞩目的开源项目，它完全免费开放，无需繁琐的注册或昂贵的 API 费用，让用户能够专注于数据价值本身而非采集难题。",63242,"2026-04-02T22:29:19",[14,17],{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":10,"last_commit_at":54,"category_tags":55,"status":22},193,"meilisearch","meilisearch\u002Fmeilisearch","Meilisearch 是一个开源的极速搜索服务，专为现代应用和网站打造，开箱即用。它能帮助开发者快速集成高质量的搜索功能，无需复杂的配置或额外的数据预处理。传统搜索方案往往需要大量调优才能实现准确结果，而 Meilisearch 内置了拼写容错、同义词识别、即时响应等实用特性，并支持 AI 驱动的混合搜索（结合关键词与语义理解），显著提升用户查找信息的体验。\n\nMeilisearch 特别适合 Web 开发者、产品团队或初创公司使用，尤其适用于需要快速上线搜索功能的场景，如电商网站、内容平台或 SaaS 应用。它提供简洁的 RESTful API 和多种语言 SDK，部署简单，资源占用低，本地开发或生产环境均可轻松运行。对于希望在不依赖大型云服务的前提下，为用户提供流畅、智能搜索体验的团队来说，Meilisearch 是一个高效且友好的选择。",56964,"2026-04-05T08:19:14",[13,17,14,20,16,18],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":22},223,"Made-With-ML","GokuMohandas\u002FMade-With-ML","Made-With-ML 是一个面向实战的开源项目，旨在帮助开发者系统掌握从设计、开发到部署和迭代生产级机器学习应用的完整流程。它解决了许多人在学习机器学习时“会训练模型但不会上线”的痛点，强调将软件工程最佳实践与 ML 技术结合，构建可靠、可维护的端到端系统。\n\n该项目特别适合三类人群：一是希望将模型真正落地的开发者（包括软件工程师、数据科学家）；二是刚毕业、想补齐工业界所需技能的学生；三是需要理解技术边界以更好推动产品的技术管理者或产品经理。\n\nMade-With-ML 的亮点在于注重第一性原理讲解，避免盲目调包；同时覆盖 MLOps 关键环节（如实验跟踪、模型测试、服务部署、CI\u002FCD 等），并支持在 Python 生态内平滑扩展训练与推理任务，无需切换语言或复杂基础设施。课程内容结构清晰，配有详细代码示例和视频导览，兼顾理论深度与工程实用性。",47108,"2026-04-05T10:42:55",[19,18,14,16,20],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":80,"owner_email":81,"owner_twitter":81,"owner_website":81,"owner_url":82,"languages":83,"stars":92,"forks":93,"last_commit_at":94,"license":95,"difficulty_score":96,"env_os":97,"env_gpu":98,"env_ram":99,"env_deps":100,"category_tags":113,"github_topics":114,"view_count":10,"oss_zip_url":81,"oss_zip_packed_at":81,"status":22,"created_at":123,"updated_at":124,"faqs":125,"releases":156},2559,"Ceruleanacg\u002FPersonae","Personae","📈 Personae is a repo of implements and environment of Deep Reinforcement Learning & Supervised Learning for Quantitative Trading.","Personae 是一个专为量化交易打造的开源项目，集成了深度强化学习与监督学习的前沿算法及模拟交易环境。它旨在解决金融市场中策略开发与验证的难题，通过提供标准化的代码实现和回测框架，帮助研究者将学术理论快速转化为可评估的交易策略。\n\n该项目特别适合人工智能研究人员、量化开发者以及对算法交易感兴趣的学生使用。Personae 内置了多种经典算法的实现，包括用于连续控制交易的 DDPG、Double-DQN、Dueling-DQN 和策略梯度方法，以及用于时间序列价格预测的 DA-RNN、TreNet 和 LSTM 模型。其独特亮点在于构建了一个基于 Gym 风格的金融市场模拟环境，支持股票和期货数据的交互，能够直接为各类模型提供训练所需的回归或序列数据。\n\n尽管项目提示输入特征较为基础且建议用户自定义优化，但它为探索不同神经网络架构在金融场景下的表现提供了坚实的起点。无论是想复现论文成果，还是希望搭建自己的智能交易代理，Personae 都是一个功能全面且易于扩展的技术底座。","[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-blue.svg)](\u002FLICENSE)\n[![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPlatform-Tensorflow-orange.svg)](https:\u002F\u002Fwww.tensorflow.org\u002F)\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.5-green.svg)]()\n[![Docker](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocker-Available-FF69B4.svg)](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fceruleanwang\u002Fpersonae\u002F)\n\n# Personae - RL & SL Methods and Envs For Quantitative Trading\n\nPersonae is a repo that implements papers proposed methods in Deep Reinforcement Learning & Supervised Learning and applies them to Financial Market.\n\nNow Personae includes 4 RL & 3 SL implements and a simulate Financial Market supporting Stock and Future. (Short Sale is still implementing)\n\nMore RL & SL methods are updating!\n\n# WARNING\n\nThis repo is being reconstructing,\n\nIt will start from 2018-08-24 to ~2018-09-01~ a timestamp that I successfully found a job.\n\n\n\n# Attentions  \n\n- The features as inputs are naive.   \n- Day frequency is clearly not enough.  \n- It's recommended that you could replace the features here to your own.   \n\n# Contents\n\n+ [Deep Deterministic Policy Gradient (DDPG)](algorithm\u002FRL\u002FDDPG.py)   \nImplement of DDPG with TensorFlow.\n    > arXiv:1509.02971: [Continuous control with deep reinforcement learning](https:\u002F\u002Farxiv.org\u002Fabs\u002F1509.02971)\n\n+ [Double DQN](algorithm\u002FRL\u002FDoubleDQN.py)    \nImplement of Double-DQN with TensorFlow.   \n    > arXiv:1509.06461: [Deep Reinforcement Learning with Double Q-learning](https:\u002F\u002Farxiv.org\u002Fabs\u002F1509.06461)\n    \n+ [Dueling-DQN](algorithm\u002FRL\u002FDuelingDQN.py)     \nImplement of Dueling-DQN with TensorFlow.    \n    > arXiv:1511.06581: [Dueling Network Architectures for Deep Reinforcement Learning](https:\u002F\u002Farxiv.org\u002Fabs\u002F1511.06581)     \n\n+ [Policy Gradient](algorithm\u002FRL\u002FPolicyGradient.py)   \nImplement of Policy Gradient with TensorFlow.\n    > NIPS. Vol. 99. 1999: [Policy gradient methods for reinforcement learning with function approximation](https:\u002F\u002Fpapers.nips.cc\u002Fpaper\u002F1713-policy-gradient-methods-for-reinforcement-learning-with-function-approximation.pdf)\n\n+ [DA-RNN (DualAttnRNN)](algorithm\u002FSL\u002FDualAttnRNN.py)      \nImplement of arXiv:1704.02971, DA-RNN with TensorFlow.\n    > arXiv:1704.02971: [A Dual-Stage Attention-Based Recurrent Neural Network for Time Series Prediction](https:\u002F\u002Farxiv.org\u002Fabs\u002F1704.02971)\n\n+ [TreNet (HNN)](algorithm\u002FSL\u002FTreNet.py)     \nImplement of TreNet with TensorFlow.    \n    > IJCAI 2017. [Hybrid Neural Networks for Learning the Trend in Time Series](https:\u002F\u002Fwww.ijcai.org\u002Fproceedings\u002F2017\u002F0316.pdf)\n\n+ [Naive-LSTM (LSTM)](algorithm\u002FSL\u002FNaiveLSTM.py)    \nImplement of simple LSTM based model with TensorFlow.    \n    > arXiv:1506.02078: [Visualizing and Understanding Recurrent Networks](https:\u002F\u002Farxiv.org\u002Fabs\u002F1506.02078)     \n\n# Environment\n\nA basic simulate environment of Financial Market is implemented.\n\n- [Market](base\u002Fenv\u002Fmarket.py)   \nImplement of Market, Trader, Positions as a gym env (gym is not required), which can give a env for regression or sequence data generating for RL or SL model.  \nFor now, Market support Stock Data and Future Data.\n\nAlso, more functions are updating.\n\n# Experiments\n\n+ [Deep Deterministic Policy Gradient (DDPG)](algorithm\u002FSL\u002FDualAttnRNN.py)\n+ [Double-DQN](algorithm\u002FRL\u002FDoubleDQN.py)    \n+ [Dueling-DQN](algorithm\u002FRL\u002FDuelingDQN.py)\n+ [Policy Gradient (PG)](algorithm\u002FRL\u002FPolicyGradient.py)     \nTrain a Agent to trade in stock market, using stock data set from 2012-01-01 to 2018-01-01 where 70% are training data, 30% are testing data.\n\n\u003Cp align='center'>\n  \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FCeruleanacg_Personae_readme_1eea6c705532.jpg'>\n   \u003Cem>Total Profits and Baseline Profits. (Test Set)\u003C\u002Fem>\n\u003C\u002Fp>\n\n+ [DA-RNN (DualAttnRNN)](algorithm\u002FSL\u002FDualAttnRNN.py)   \n+ [Naive-LSTM (LSTM)](algorithm\u002FSL\u002FNaiveLSTM.py)      \n+ [TreNet (HNN)](algorithm\u002FSL\u002FTreNet.py)     \nTrain a Predictor to predict stock prices, using stock data set from 2008-01-01 to 2018-01-01, where 70% are training data, 30% are testing data.\n\n\u003Cp align='center'>\n  \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FCeruleanacg_Personae_readme_f59375440fc5.jpg'>\n   \u003Cem>Prices Prediction Experiments on 4 Bank Stocks. (Test Set)\u003C\u002Fem>\n\u003C\u002Fp>\n\n\n# Requirements\n\nBefore you start testing, following requirements are needed.\n\n- Python3.5\n- TensorFlow1.4\n- numpy\n- scipy\n- pandas\n- rqalpha\n- sklearn\n- tushare\n- matplotlib\n- mongoengine\n- CUDA (option)\n- ta-lib (option)\n- Docker (option)\n- PyTorch (option)\n\nIt's best that if you are a Docker user, so that you can run the whole project without installing those dependencies manually.\n \nAnd you can also use [Ansible](http:\u002F\u002Fwww.ansible.com.cn\u002F) to run [CUDA-Playbook](playbook\u002Fcuda-playbook.yml) and [Docker-Playbook](playbook\u002Fdocker-playbook.yml) to install CUDA and [Nvidia-Docker](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fnvidia-docker) if you want to run tests in a Docker Container.\n\n# How to Use\n\n### If you use Docker\n\n#### About base image\nMy image for this repo is [ceruleanwang\u002Fpersonae](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fceruleanwang\u002Fpersonae\u002F), and personae is inherited from [ceruleanwang\u002Fquant-base](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fceruleanwang\u002Fquant-base\u002F).    \n   \nThe image [ceruleanwang\u002Fquant-base](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fceruleanwang\u002Fquant-base\u002F) is inherited from [nvidia\u002Fcuda:8.0-cudnn6-runtime](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fnvidia\u002Fcuda\u002F). So please make sure your CUDA version and cuDNN version are correct. \n\n#### Instructions\nFirst you should make sure you have stocks data in your mongodb.   \n\nIf you don't have, you can use a spider writen in this repo to crawl stock or future data, but before you start, you should make sure a mongodb service is running.  \n\nIf you don't have mongodb service running, you can also use a mongodb container (option) by following code:\n```\ndocker run -p 27017:27017 -v \u002Fdata\u002Fdb:\u002Fdata\u002Fdb -d --network=your_network mongo\n``` \nThen, you can use spiders to crawl stock data by following code:   \n```\ndocker run -t -v local_project_dir:docker_project_dir --network=your_network ceruleanwang\u002Fpersonae spider\u002Fstock_spider.py\n```\nAlso, you can crawl future data by following code:\n```\ndocker run -t -v local_project_dir:docker_project_dir --network=your_network ceruleanwang\u002Fpersonae spider\u002Ffuture_spider.py\n```\nBut remember to set stock or future codes that you want to crawl, the default stock codes are:\n```\nstock_codes = [\"600036\", \"601328\", \"601998\", \"601398\"]\n```\nAnd the default future codes are:\n```\nfuture_codes = [\"AU88\", \"RB88\", \"CU88\", \"AL88\"]\n```\nAnd they can be modified in:   \n+ [Default Args Parser](helper\u002Fargs_parser.py)\n\nThen you can just run a model by:\n```\ndocker run -t -v local_project_dir:docker_project_dir --network=yuor_network ceruleanwang\u002Fpersonae algorithm\u002FRL or SL\u002Falgorithm_name.py\n```\n\n### If you use Conda\nYou can create an env yourself, and install Python3.5 and all dependencies required, then just run algorithm in your way.   \n\nOne thing should be noticed is that the hostname in [mongoengine](\u002Fbase\u002Fmodel\u002F__init__.py) config should be your own.\n\n### About training & testing \nFor now, all models implemented with TensorFlow support persistence. You can edit many parameters when you are training or testing a model.   \nFor example, following codes show some parameters that could be edited.\n```\nenv = Market(codes, start_date=\"2008-01-01\", end_date=\"2018-01-01\", **{\n    \"market\": market,\n    \"mix_index_state\": True,\n    \"training_data_ratio\": training_data_ratio,\n})\n\nalgorithm = Algorithm(tf.Session(config=config), env, env.trader.action_space, env.data_dim, **{\n    \"mode\": mode,\n    \"episodes\": episode,\n    \"enable_saver\": True,\n    \"enable_summary_writer\": True,\n    \"save_path\": os.path.join(CHECKPOINTS_DIR, \"RL\", model_name, market, \"model\"),\n    \"summary_path\": os.path.join(CHECKPOINTS_DIR, \"RL\", model_name, market, \"summary\"),\n})\n```\n# TODO\n- More Implementations of Papers.\n- More High-Frequency Stocks Data.\n","[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-blue.svg)](\u002FLICENSE)\n[![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPlatform-Tensorflow-orange.svg)](https:\u002F\u002Fwww.tensorflow.org\u002F)\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.5-green.svg)]()\n[![Docker](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocker-Available-FF69B4.svg)](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fceruleanwang\u002Fpersonae\u002F)\n\n# Personae - 强化学习与监督学习方法及量化交易环境\n\nPersonae 是一个实现深度强化学习和监督学习领域论文中提出的方法，并将其应用于金融市场的代码库。\n\n目前，Personae 包含 4 种强化学习实现、3 种监督学习实现，以及一个支持股票和期货的金融市场模拟环境。（做空功能仍在开发中）\n\n更多强化学习和监督学习方法正在持续更新中！\n\n# 警告\n\n本项目正在进行重构，\n\n计划从 2018 年 8 月 24 日开始，持续到大约 2018 年 9 月 1 日——也就是我成功找到工作的那一天。\n\n\n\n# 注意事项  \n\n- 输入特征较为简单。   \n- 日度频率显然不够。  \n- 建议用户根据自身需求替换此处的特征。   \n\n# 内容\n\n+ [深度确定性策略梯度 (DDPG)](algorithm\u002FRL\u002FDDPG.py)   \n使用 TensorFlow 实现 DDPG。\n    > arXiv:1509.02971: [Continuous control with deep reinforcement learning](https:\u002F\u002Farxiv.org\u002Fabs\u002F1509.02971)\n\n+ [双 DQN](algorithm\u002FRL\u002FDoubleDQN.py)    \n使用 TensorFlow 实现双 DQN。   \n    > arXiv:1509.06461: [Deep Reinforcement Learning with Double Q-learning](https:\u002F\u002Farxiv.org\u002Fabs\u002F1509.06461)\n    \n+ [斗士-DQN](algorithm\u002FRL\u002FDuelingDQN.py)     \n使用 TensorFlow 实现斗士-DQN。    \n    > arXiv:1511.06581: [Dueling Network Architectures for Deep Reinforcement Learning](https:\u002F\u002Farxiv.org\u002Fabs\u002F1511.06581)     \n\n+ [策略梯度](algorithm\u002FRL\u002FPolicyGradient.py)   \n使用 TensorFlow 实现策略梯度。\n    > NIPS. Vol. 99. 1999: [Policy gradient methods for reinforcement learning with function approximation](https:\u002F\u002Fpapers.nips.cc\u002Fpaper\u002F1713-policy-gradient-methods-for-reinforcement-learning-with-function-approximation.pdf)\n\n+ [DA-RNN (DualAttnRNN)](algorithm\u002FSL\u002FDualAttnRNN.py)      \n使用 TensorFlow 实现 arXiv:1704.02971 中提出的 DA-RNN。\n    > arXiv:1704.02971: [A Dual-Stage Attention-Based Recurrent Neural Network for Time Series Prediction](https:\u002F\u002Farxiv.org\u002Fabs\u002F1704.02971)\n\n+ [TreNet (HNN)](algorithm\u002FSL\u002FTreNet.py)     \n使用 TensorFlow 实现 TreNet。    \n    > IJCAI 2017. [Hybrid Neural Networks for Learning the Trend in Time Series](https:\u002F\u002Fwww.ijcai.org\u002Fproceedings\u002F2017\u002F0316.pdf)\n\n+ [Naive-LSTM (LSTM)](algorithm\u002FSL\u002FNaiveLSTM.py)    \n使用 TensorFlow 实现简单的 LSTM 模型。    \n    > arXiv:1506.02078: [Visualizing and Understanding Recurrent Networks](https:\u002F\u002Farxiv.org\u002Fabs\u002F1506.02078)     \n\n# 环境\n\n实现了一个基础的金融市场模拟环境。\n\n- [市场](base\u002Fenv\u002Fmarket.py)   \n实现了市场、交易者和持仓等组件，作为一个 gym 环境（无需依赖 gym 库），可以为 RL 或 SL 模型提供回归或序列数据生成的环境。  \n目前，市场支持股票数据和期货数据。\n\n此外，更多功能正在持续开发中。\n\n# 实验\n\n+ [深度确定性策略梯度 (DDPG)](algorithm\u002FSL\u002FDualAttnRNN.py)\n+ [双 DQN](algorithm\u002FRL\u002FDoubleDQN.py)    \n+ [斗士-DQN](algorithm\u002FRL\u002FDuelingDQN.py)\n+ [策略梯度 (PG)](algorithm\u002FRL\u002FPolicyGradient.py)     \n使用 2012 年 1 月 1 日至 2018 年 1 月 1 日的股票数据集训练一个代理在股票市场上进行交易，其中 70% 为训练数据，30% 为测试数据。\n\n\u003Cp align='center'>\n  \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FCeruleanacg_Personae_readme_1eea6c705532.jpg'>\n   \u003Cem>总收益与基准收益。（测试集）\u003C\u002Fem>\n\u003C\u002Fp>\n\n+ [DA-RNN (DualAttnRNN)](algorithm\u002FSL\u002FDualAttnRNN.py)   \n+ [Naive-LSTM (LSTM)](algorithm\u002FSL\u002FNaiveLSTM.py)      \n+ [TreNet (HNN)](algorithm\u002FSL\u002FTreNet.py)     \n使用 2008 年 1 月 1 日至 2018 年 1 月 1 日的股票数据集训练一个预测模型来预测股价，其中 70% 为训练数据，30% 为测试数据。\n\n\u003Cp align='center'>\n  \u003Cimg src='https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FCeruleanacg_Personae_readme_f59375440fc5.jpg'>\n   \u003Cem>对 4 只银行股的价格预测实验。（测试集）\u003C\u002Fem>\n\u003C\u002Fp>\n\n\n# 需求\n\n在开始测试之前，需要满足以下要求。\n\n- Python 3.5\n- TensorFlow 1.4\n- numpy\n- scipy\n- pandas\n- rqalpha\n- sklearn\n- tushare\n- matplotlib\n- mongoengine\n- CUDA（可选）\n- ta-lib（可选）\n- Docker（可选）\n- PyTorch（可选）\n\n建议使用 Docker，这样可以避免手动安装所有依赖项，直接运行整个项目。\n\n此外，您还可以使用 [Ansible](http:\u002F\u002Fwww.ansible.com.cn\u002F) 运行 [CUDA-Playbook](playbook\u002Fcuda-playbook.yml) 和 [Docker-Playbook](playbook\u002Fdocker-playbook.yml)，以安装 CUDA 和 [Nvidia-Docker](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fnvidia-docker)，从而在 Docker 容器中运行测试。\n\n# 使用方法\n\n### 如果您使用 Docker\n\n#### 关于基础镜像\n该项目的基础镜像是 [ceruleanwang\u002Fpersonae](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fceruleanwang\u002Fpersonae\u002F)，而 personae 继承自 [ceruleanwang\u002Fquant-base](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fceruleanwang\u002Fquant-base\u002F)。    \n   \n镜像 [ceruleanwang\u002Fquant-base](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fceruleanwang\u002Fquant-base\u002F) 继承自 [nvidia\u002Fcuda:8.0-cudnn6-runtime](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fnvidia\u002Fcuda\u002F)。因此，请确保您的 CUDA 和 cuDNN 版本正确。 \n\n#### 指令\n首先，您需要确保 MongoDB 中已存储股票数据。   \n\n如果没有，您可以使用本项目中的爬虫来抓取股票或期货数据，但在开始之前，务必确保 MongoDB 服务正在运行。  \n\n如果 MongoDB 服务未运行，您也可以通过以下命令启动一个 MongoDB 容器（可选）：\n```\ndocker run -p 27017:27017 -v \u002Fdata\u002Fdb:\u002Fdata\u002Fdb -d --network=your_network mongo\n``` \n然后，您可以使用爬虫抓取股票数据，命令如下：   \n```\ndocker run -t -v local_project_dir:docker_project_dir --network=your_network ceruleanwang\u002Fpersonae spider\u002Fstock_spider.py\n```\n同样，您也可以使用以下命令抓取期货数据：\n```\ndocker run -t -v local_project_dir:docker_project_dir --network=your_network ceruleanwang\u002Fpersonae spider\u002Ffuture_spider.py\n```\n请注意设置您想要抓取的股票或期货代码，默认的股票代码是：\n```\nstock_codes = [\"600036\", \"601328\", \"601998\", \"601398\"]\n```\n默认的期货代码是：\n```\nfuture_codes = [\"AU88\", \"RB88\", \"CU88\", \"AL88\"]\n```\n这些代码可以在以下文件中修改：   \n+ [默认参数解析器](helper\u002Fargs_parser.py)\n\n之后，您只需运行模型即可：\n```\ndocker run -t -v local_project_dir:docker_project_dir --network=yuor_network ceruleanwang\u002Fpersonae algorithm\u002FRL 或 SL\u002Falgorithm_name.py\n```\n\n### 如果您使用 Conda\n您可以自行创建一个环境，安装 Python 3.5 及所有所需依赖项，然后按照自己的方式运行算法。   \n\n需要注意的是，在 [mongoengine](\u002Fbase\u002Fmodel\u002F__init__.py) 的配置中，hostname 必须设置为您自己的。\n\n### 关于训练与测试\n目前，所有使用 TensorFlow 实现的模型都支持持久化。在训练或测试模型时，您可以修改许多参数。\n例如，以下代码展示了一些可以被修改的参数：\n```\nenv = Market(codes, start_date=\"2008-01-01\", end_date=\"2018-01-01\", **{\n    \"market\": market,\n    \"mix_index_state\": True,\n    \"training_data_ratio\": training_data_ratio,\n})\n\nalgorithm = Algorithm(tf.Session(config=config), env, env.trader.action_space, env.data_dim, **{\n    \"mode\": mode,\n    \"episodes\": episode,\n    \"enable_saver\": True,\n    \"enable_summary_writer\": True,\n    \"save_path\": os.path.join(CHECKPOINTS_DIR, \"RL\", model_name, market, \"model\"),\n    \"summary_path\": os.path.join(CHECKPOINTS_DIR, \"RL\", model_name, market, \"summary\"),\n})\n```\n# 待办事项\n- 更多论文的实现。\n- 更多高频股票数据。","# Personae 快速上手指南\n\nPersonae 是一个基于 TensorFlow 的开源项目，实现了多种深度强化学习（RL）和监督学习（SL）算法，并将其应用于股票和期货市场的量化交易模拟环境中。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**: Linux \u002F macOS (Windows 需通过 Docker 或 WSL)\n- **Python 版本**: 3.5+\n- **深度学习框架**: TensorFlow 1.4\n- **数据库**: MongoDB (用于存储行情数据)\n\n### 前置依赖\n核心依赖库包括：\n- `numpy`, `scipy`, `pandas`, `sklearn`\n- `rqalpha`, `tushare` (数据获取)\n- `matplotlib`, `mongoengine`\n- **可选**: CUDA (GPU 加速), TA-Lib (技术指标), PyTorch\n\n> **建议**: 推荐使用 **Docker** 运行，可避免手动配置复杂的环境依赖。\n\n---\n\n## 安装步骤\n\n### 方案一：使用 Docker（推荐）\n\n1. **拉取镜像**\n   该项目提供了预构建的 Docker 镜像，基于 NVIDIA CUDA 环境。\n   ```bash\n   docker pull ceruleanwang\u002Fpersonae\n   ```\n\n2. **启动 MongoDB 服务**\n   Personae 需要 MongoDB 存储数据。你可以本地安装或使用容器：\n   ```bash\n   docker run -p 27017:27017 -v \u002Fdata\u002Fdb:\u002Fdata\u002Fdb -d --network=host mongo\n   ```\n   *注：若在不同网络环境下，请将 `--network=host` 替换为具体的网络名称 `--network=your_network`。*\n\n3. **获取行情数据**\n   在运行模型前，需先将股票或期货数据爬取并存入 MongoDB。\n   \n   爬取股票数据（默认代码：600036, 601328 等）：\n   ```bash\n   docker run -t -v $(pwd):\u002Fapp --network=host ceruleanwang\u002Fpersonae python spider\u002Fstock_spider.py\n   ```\n   \n   爬取期货数据（默认代码：AU88, RB88 等）：\n   ```bash\n   docker run -t -v $(pwd):\u002Fapp --network=host ceruleanwang\u002Fpersonae python spider\u002Ffuture_spider.py\n   ```\n   *提示：如需修改标的代码，请编辑 `helper\u002Fargs_parser.py` 文件。*\n\n### 方案二：使用 Conda 手动安装\n\n1. **创建虚拟环境**\n   ```bash\n   conda create -n personae python=3.5\n   conda activate personae\n   ```\n\n2. **安装依赖**\n   ```bash\n   pip install tensorflow==1.4 numpy scipy pandas rqalpha sklearn tushare matplotlib mongoengine\n   # 可选安装\n   # pip install torch\n   # 安装 TA-Lib 需先安装系统级库\n   ```\n\n3. **配置数据库连接**\n   修改 `base\u002Fmodel\u002F__init__.py` 中的 `mongoengine` 配置，将 `host` 设置为你本地的 MongoDB 地址。\n\n---\n\n## 基本使用\n\n### 运行训练与测试\n\n确保 MongoDB 中已有数据后，即可运行算法脚本。以下以运行强化学习算法为例：\n\n```bash\n# 语法格式\ndocker run -t -v $(pwd):\u002Fapp --network=host ceruleanwang\u002Fpersonae python algorithm\u002FRL\u002F\u003C算法名称>.py\n\n# 示例：运行 Double DQN\ndocker run -t -v $(pwd):\u002Fapp --network=host ceruleanwang\u002Fpersonae python algorithm\u002FRL\u002FDoubleDQN.py\n```\n\n### 参数配置说明\n\n在代码中可以通过字典形式自定义训练参数。主要参数包括数据区间、训练集比例及模型保存路径等：\n\n```python\nenv = Market(codes, start_date=\"2008-01-01\", end_date=\"2018-01-01\", **{\n    \"market\": market,\n    \"mix_index_state\": True,\n    \"training_data_ratio\": 0.7,  # 70% 训练数据\n})\n\nalgorithm = Algorithm(tf.Session(config=config), env, env.trader.action_space, env.data_dim, **{\n    \"mode\": \"train\",             # 模式：train 或 test\n    \"episodes\": 1000,            # 训练轮数\n    \"enable_saver\": True,        # 是否保存模型\n    \"enable_summary_writer\": True,\n    \"save_path\": \".\u002Fcheckpoints\u002FRL\u002FDoubleDQN\u002Fmodel\",\n    \"summary_path\": \".\u002Fcheckpoints\u002FRL\u002FDoubleDQN\u002Fsummary\",\n})\n```\n\n### 支持算法列表\n\n- **强化学习 (RL)**: DDPG, Double-DQN, Dueling-DQN, Policy Gradient\n- **监督学习 (SL)**: DA-RNN (DualAttnRNN), TreNet (HNN), Naive-LSTM\n\n> **注意**: 本项目使用的输入特征较为基础（日线级别），建议在实际应用中替换为更丰富的特征工程数据以提升效果。","某量化初创团队的研究员正试图构建一个能自动适应市场波动的股票交易策略，但受限于传统统计模型的僵化，难以捕捉非线性规律。\n\n### 没有 Personae 时\n- **算法复现成本极高**：研究员需从零编写 DDPG、Double DQN 等复杂的深度强化学习代码，耗费数周时间调试网络架构，严重拖慢策略迭代速度。\n- **缺乏统一回测环境**：自行搭建的模拟交易市场功能简陋，不支持期货与股票的统一接口，且难以处理做空机制，导致策略验证结果与实际表现偏差巨大。\n- **特征工程盲目低效**：只能使用简单的日线数据作为输入，缺乏如 DA-RNN 或 TreNet 等先进的时间序列注意力机制模型，无法有效提取趋势特征，预测准确率长期低迷。\n- **基线对比困难**：由于缺乏标准化的实验框架，难以将新策略与经典算法（如 Policy Gradient 或 LSTM）进行公平的性能基准对比，无法证明策略优越性。\n\n### 使用 Personae 后\n- **即插即用前沿算法**：直接调用 Personae 内置的 TensorFlow 版本 DDPG、Dueling-DQN 及 DA-RNN 等实现，将算法部署时间从数周缩短至几天，快速验证想法。\n- **标准化仿真环境**：利用其自带的 Gym 风格金融市场环境，无缝切换股票与期货数据，获得更贴近真实的交易反馈，显著提升了回测的可信度。\n- **高级模型提升精度**：应用集成的双阶段注意力机制（DA-RNN）和混合神经网络（TreNet），有效捕捉长短期依赖关系，在相同数据下大幅提升了价格预测的准确度。\n- **清晰的效果评估**：基于统一的实验设置，轻松生成总收益与基准收益的对比图表，直观量化新策略相对于传统方法的超额收益，加速决策流程。\n\nPersonae 通过提供标准化的深度学习和强化学习实现及仿真环境，让量化团队能将精力从重复造轮子转移到核心策略创新上，显著缩短了从理论到实盘的周期。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FCeruleanacg_Personae_1eea6c70.jpg","Ceruleanacg","Shuyu","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FCeruleanacg_cdc30516.png","Quant Researcher @ Hedge Fund\r\n\r\nhttps:\u002F\u002Fwww.zhihu.com\u002Fpeople\u002Fceruleanw","WASEDA University","China",null,"https:\u002F\u002Fgithub.com\u002FCeruleanacg",[84,88],{"name":85,"color":86,"percentage":87},"Python","#3572A5",99.8,{"name":89,"color":90,"percentage":91},"Dockerfile","#384d54",0.2,1400,340,"2026-04-01T01:04:33","MIT",4,"Linux","可选。若使用 GPU 加速，需 NVIDIA GPU 支持 CUDA 8.0 及 cuDNN 6 (基于官方 Docker 镜像 nvidia\u002Fcuda:8.0-cudnn6-runtime)。","未说明",{"notes":101,"python":102,"dependencies":103},"该项目目前处于重构状态（自 2018 年起）。强烈建议使用 Docker 运行以避免手动安装依赖。运行前需自行搭建 MongoDB 服务并导入股票或期货数据（项目提供爬虫脚本）。若不使用 Docker，需手动安装 TA-Lib 和 MongoDB 相关驱动，并注意修改代码中的 MongoDB 主机配置。","3.5",[104,105,106,107,108,25,109,110,111,112],"tensorflow==1.4","numpy","scipy","pandas","rqalpha","tushare","matplotlib","mongoengine","ta-lib",[14],[115,116,117,118,119,120,121,122],"reinforcement-learning","supervised-learning","stock-data","trading","paper","stock","time-series-prediction","stock-price-prediction","2026-03-27T02:49:30.150509","2026-04-06T05:37:52.401436",[126,131,136,141,146,151],{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},11833,"在 Docker 中运行项目时遇到 'ImportError: libcuda.so.1: file too short' 错误，如何解决？","这是因为容器无法正确访问宿主机的 GPU 驱动。请使用 nvidia-docker (或配置了 NVIDIA 容器的 docker) 来运行容器，并添加环境变量。具体命令示例：\n1. 构建镜像：docker image build -t ppdemo .\n2. 启动 MongoDB：docker run --name my_mongo -p 27017:27017 -d mongo\n3. 运行算法（关键步骤）：sudo nvidia-docker run -t --link my_mongo:mongo -v $PWD:\u002Fapp\u002FPersonae ppdemo algorithm\u002FSL\u002FDualAttnRNN.py\n或者使用标准 docker 命令并添加参数：docker run --gpus all -e NVIDIA_DRIVER_CAPABILITIES=compute,utility ...","https:\u002F\u002Fgithub.com\u002FCeruleanacg\u002FPersonae\u002Fissues\u002F14",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},11834,"运行脚本时出现 'ImportError: No module named algorithm' 或找不到 config 模块怎么办？","这通常是因为 Python 无法找到项目根目录。如果您直接使用 `python3.5 model_name.py` 运行模型，请确保已将项目根目录添加到 PYTHONPATH 环境变量中。如果您使用的是 PyCharm 等 IDE，请在设置中将项目根目录标记为 Sources Root。","https:\u002F\u002Fgithub.com\u002FCeruleanacg\u002FPersonae\u002Fissues\u002F13",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},11835,"如何在 Arch Linux 或其他系统上正确设置并运行 MongoDB 和 Docker 环境？","完整的运行步骤如下：\n1. 确保机器有 Nvidia GPU 并安装了 Ubuntu（推荐）及 Nvidia-docker2。\n2. 克隆代码：git clone https:\u002F\u002Fgithub.com\u002FCeruleanacg\u002FPersonae.git\n3. 创建 Docker 网络（如果报错 network not found）：docker network create your_network\n4. 构建镜像：sudo docker image build -t ppdemo .\n5. 启动 Mongo：sudo docker run --name my_mongo -p 27017:27017 -d mongo\n6. 抓取数据：sudo docker run -t --link my_mongo:mongo -v $PWD:\u002Fapp\u002FPersonae ppdemo spider\u002Fstock_spider.py\n7. 运行算法：sudo nvidia-docker run -t --link my_mongo:mongo -v $PWD:\u002Fapp\u002FPersonae ppdemo algorithm\u002FSL\u002FDualAttnRNN.py","https:\u002F\u002Fgithub.com\u002FCeruleanacg\u002FPersonae\u002Fissues\u002F17",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},11836,"参数 mix_index_state 是什么意思？'sh' 代码代表什么以及如何使用？","mix_index_state 是一个选项，决定是否将指数数据（如上证指数 SH000001）拼接到状态或序列数据中。\n- 'sh' 指的是上证指数代码 000001。\n- 获取方法：运行爬虫脚本时将代码设置为 000001 即可获取 'sh' 数据。\n- 使用原因：混合指数数据可以给代理或预测器提供市场的全局视角（big picture）。","https:\u002F\u002Fgithub.com\u002FCeruleanacg\u002FPersonae\u002Fissues\u002F15",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},11837,"动作空间（action space）的大小应该是 3 ** codes_count 还是 codes_count * 3？","动作空间的设计取决于具体的交易策略定义。在该项目的上下文中，如果每个股票有 3 种操作（买、卖、持有），且同时对多只股票操作，理论上的组合空间是 3 的 codes_count 次方。但在实际实现中，为了降低复杂度，往往采用线性空间或其他简化策略。维护者指出如果设置某些概率参数为真，PolicyGradient 可能会陷入局部最优，因此具体实现需参考代码中的 trader.action_times 逻辑。","https:\u002F\u002Fgithub.com\u002FCeruleanacg\u002FPersonae\u002Fissues\u002F4",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},11838,"强化学习算法中，为什么训练集的标签是 t+2 而验证集的标签是 t+1？","这是为了防止数据泄露并确保评估的公平性。在生成序列时：\n- 训练集：标签 y 取自 date_index + 1（即相对于输入序列末尾的 t+2 时刻），这是为了模拟真实的交易延迟或特定的预测目标。\n- 验证\u002F测试集：标签 y 取自 date_index（即 t+1 时刻）。\n注意：主分支代码中曾存在一个小 bug（instruments_y 赋值错误），已在开发分支修复，逻辑应为训练集取下一时刻，测试集取当前时刻对应的真实值以进行对比。","https:\u002F\u002Fgithub.com\u002FCeruleanacg\u002FPersonae\u002Fissues\u002F21",[]]